aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-17 18:08:47 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-17 18:08:47 +0000
commite9caa130926c47aaedbbe0627944cd8a82ab14ae (patch)
tree855d528c6c42988d1c73b5eab1a60c9f745ea159
parent81564b60c7a9eb25e248681d92c95834e8d8a50d (diff)
downloadpaludis-e9caa130926c47aaedbbe0627944cd8a82ab14ae.tar.gz
paludis-e9caa130926c47aaedbbe0627944cd8a82ab14ae.tar.xz
Add setup/cleanup scripts for is_file_with_extension_TEST rather than using the source file so that distcheck works.
-rw-r--r--paludis/files.m42
-rw-r--r--paludis/is_file_with_extension_TEST.cc15
-rwxr-xr-xpaludis/is_file_with_extension_TEST_cleanup.sh9
-rwxr-xr-xpaludis/is_file_with_extension_TEST_setup.sh6
4 files changed, 25 insertions, 7 deletions
diff --git a/paludis/files.m4 b/paludis/files.m4
index e372005..7d1431a 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -57,7 +57,7 @@ add(`indirect_iterator', `hh', `cc', `test')
add(`instantiation_policy', `hh', `cc', `test')
add(`internal_error', `hh', `cc')
add(`is_const', `hh', `cc', `test')
-add(`is_file_with_extension', `hh', `cc', `test')
+add(`is_file_with_extension', `hh', `cc', `test', `testscript')
add(`join', `hh', `cc', `test')
add(`key_value_config_file', `hh', `cc', `test')
add(`keyword_name', `hh', `cc')
diff --git a/paludis/is_file_with_extension_TEST.cc b/paludis/is_file_with_extension_TEST.cc
index f9143ba..c0ca0dd 100644
--- a/paludis/is_file_with_extension_TEST.cc
+++ b/paludis/is_file_with_extension_TEST.cc
@@ -18,10 +18,12 @@ namespace test_cases
void run()
{
IsFileWithExtension a("foo");
- IsFileWithExtension b("cc");
+ IsFileWithExtension b("goat");
FSEntry c("teh.foo");
- FSEntry d("is_file_with_extension_TEST.cc");
+ FSEntry d("is_file_with_extension_TEST_file.goat");
+
+ TEST_CHECK(d.exists());
TEST_CHECK( !a(c) );
TEST_CHECK( !a(d) );
@@ -38,18 +40,19 @@ namespace test_cases
void run()
{
IsFileWithExtension a("teh","foo");
- IsFileWithExtension b("is", "cc");
- IsFileWithExtension c("with", "cc");
+ IsFileWithExtension b("is", "goat");
+ IsFileWithExtension c("with", "goat");
FSEntry d("teh.foo");
- FSEntry e("is_file_with_extension_TEST.cc");
+ FSEntry e("is_file_with_extension_TEST_file.goat");
+
+ TEST_CHECK(e.exists());
TEST_CHECK( !a(d) );
TEST_CHECK( !a(e) );
TEST_CHECK( !b(d) );
TEST_CHECK( b(e) );
TEST_CHECK( !c(e) );
-
}
} test_is_file_with_extension_prefix;
diff --git a/paludis/is_file_with_extension_TEST_cleanup.sh b/paludis/is_file_with_extension_TEST_cleanup.sh
new file mode 100755
index 0000000..19f12d6
--- /dev/null
+++ b/paludis/is_file_with_extension_TEST_cleanup.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# vim: set ft=sh sw=4 sts=4 et :
+
+if [ -f "is_file_with_extension_TEST_file.goat" ] ; then
+ rm -f "is_file_with_extension_TEST_file.goat"
+else
+ true
+fi
+
diff --git a/paludis/is_file_with_extension_TEST_setup.sh b/paludis/is_file_with_extension_TEST_setup.sh
new file mode 100755
index 0000000..e5c8b59
--- /dev/null
+++ b/paludis/is_file_with_extension_TEST_setup.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+# vim: set ft=sh sw=4 sts=4 et :
+
+touch is_file_with_extension_TEST_file.goat || exit 2
+
+