summaryrefslogtreecommitdiff
path: root/pkgtools/wrapper/files
diff options
context:
space:
mode:
authorschmonz <schmonz@pkgsrc.org>2008-07-12 06:49:43 +0000
committerschmonz <schmonz@pkgsrc.org>2008-07-12 06:49:43 +0000
commit10d58b769a0707dfa685bcf62670cc79a3b331e7 (patch)
tree63f27a5b314de9bda7276a022f90754304a370db /pkgtools/wrapper/files
parent6dcec215af03ad83ed1e94e05e7d4ffb7ba41add (diff)
downloadpkgsrc-10d58b769a0707dfa685bcf62670cc79a3b331e7.tar.gz
Twiddle quoting in tests. Add a couple more tests. Autogenerate
Atffile, and hence remove it from CVS control. Encleverify the Makefile some.
Diffstat (limited to 'pkgtools/wrapper/files')
-rw-r--r--pkgtools/wrapper/files/tests/Atffile6
-rw-r--r--pkgtools/wrapper/files/tests/Makefile27
-rw-r--r--pkgtools/wrapper/files/tests/test-include_pkgdir_slashdot.sh13
-rw-r--r--pkgtools/wrapper/files/tests/test-lib-expand.sh10
-rw-r--r--pkgtools/wrapper/files/tests/test-quoted_arg.sh13
-rw-r--r--pkgtools/wrapper/files/tests/test-remove-dir.sh2
6 files changed, 52 insertions, 19 deletions
diff --git a/pkgtools/wrapper/files/tests/Atffile b/pkgtools/wrapper/files/tests/Atffile
deleted file mode 100644
index a2a3d265601..00000000000
--- a/pkgtools/wrapper/files/tests/Atffile
+++ /dev/null
@@ -1,6 +0,0 @@
-Content-Type: application/X-atf-atffile; version="1"
-
-prop: test-suite = "regress-buildlink-transform"
-
-tp: test-remove-dir
-tp: test-lib-expand
diff --git a/pkgtools/wrapper/files/tests/Makefile b/pkgtools/wrapper/files/tests/Makefile
index a91518a9e2a..1d6cb1adcb0 100644
--- a/pkgtools/wrapper/files/tests/Makefile
+++ b/pkgtools/wrapper/files/tests/Makefile
@@ -1,13 +1,26 @@
# XXX snarf and atfify the tests from regress/buildlink-transform
-test: Atffile test-lib-expand test-remove-dir
- atf-run
+.SUFFIXES: .sh .atf
+.sh.atf:
+ atf-compile -o ${.TARGET} ${.IMPSRC}
+
+TESTS= include_pkgdir_slashdot lib-expand quoted_arg remove-dir
+TESTFILES= ${TESTS:S/^/test-/g:S/$/.atf/g}
+ALLFILES= Atffile ${TESTFILES}
clean:
- rm -f test-lib-expand test-remove-dir
+ rm -f ${ALLFILES}
+
+test: all
+ atf-run
-test-lib-expand: test-lib-expand.sh
- atf-compile -o test-lib-expand test-lib-expand.sh
+all: ${ALLFILES}
-test-remove-dir: test-remove-dir.sh
- atf-compile -o test-remove-dir test-remove-dir.sh
+Atffile:
+ @echo 'Content-Type: application/X-atf-atffile; version="1"' > Atffile
+ @echo >> Atffile
+ @echo 'prop: test-suite = "regress-buildlink-transform"' >> Atffile
+ @echo >> Atffile
+. for i in ${TESTFILES}
+ @echo "tp: ${i}" >> Atffile
+. endfor
diff --git a/pkgtools/wrapper/files/tests/test-include_pkgdir_slashdot.sh b/pkgtools/wrapper/files/tests/test-include_pkgdir_slashdot.sh
new file mode 100644
index 00000000000..162381f09e6
--- /dev/null
+++ b/pkgtools/wrapper/files/tests/test-include_pkgdir_slashdot.sh
@@ -0,0 +1,13 @@
+atf_test_case include_pkgdir_slashdot
+include_pkgdir_slashdot_head() {
+ atf_set 'descr' 'Checks that trailing /. is elided from includes'
+}
+include_pkgdir_slashdot_body() {
+ input="-I${LOCALBASE}/include/."
+ echo "-I${BUILDLINK_DIR}/include" > expout
+ atf_check 'echowrapper ${input}' 0 expout ignore
+}
+
+atf_init_test_cases() {
+ atf_add_test_case include_pkgdir_slashdot
+}
diff --git a/pkgtools/wrapper/files/tests/test-lib-expand.sh b/pkgtools/wrapper/files/tests/test-lib-expand.sh
index de3d0b673d8..22f1d3dd8ca 100644
--- a/pkgtools/wrapper/files/tests/test-lib-expand.sh
+++ b/pkgtools/wrapper/files/tests/test-lib-expand.sh
@@ -1,13 +1,13 @@
-atf_test_case libexpand
-libexpand_head() {
+atf_test_case lib_expand
+lib_expand_head() {
atf_set 'descr' 'Checks that one -llib can be expanded into several'
}
-libexpand_body() {
+lib_expand_body() {
input='-lreadline'
echo '-ledit -ltermcap -lm' > expout
- atf_check "echowrapper ${input}" 0 expout ignore
+ atf_check 'echowrapper ${input}' 0 expout ignore
}
atf_init_test_cases() {
- atf_add_test_case libexpand
+ atf_add_test_case lib_expand
}
diff --git a/pkgtools/wrapper/files/tests/test-quoted_arg.sh b/pkgtools/wrapper/files/tests/test-quoted_arg.sh
new file mode 100644
index 00000000000..bbb96a21fdd
--- /dev/null
+++ b/pkgtools/wrapper/files/tests/test-quoted_arg.sh
@@ -0,0 +1,13 @@
+atf_test_case quoted_arg
+quoted_arg_head() {
+ atf_set 'descr' 'Checks that quoted arguments pass unmolested'
+}
+quoted_arg_body() {
+ input='-D"DEFAULT_MODULE_PATH=\"${LOCALBASE}/lib/security/\""'
+ echo "${input}" > expout
+ atf_check 'echowrapper ${input}' 0 expout ignore
+}
+
+atf_init_test_cases() {
+ atf_add_test_case quoted_arg
+}
diff --git a/pkgtools/wrapper/files/tests/test-remove-dir.sh b/pkgtools/wrapper/files/tests/test-remove-dir.sh
index 2c7a4787093..3f9dace76f8 100644
--- a/pkgtools/wrapper/files/tests/test-remove-dir.sh
+++ b/pkgtools/wrapper/files/tests/test-remove-dir.sh
@@ -5,7 +5,7 @@ removedir_head() {
removedir_body() {
input='-L/opt/schily/lib -I/opt/schily/include'
echo > expout
- atf_check "echowrapper ${input}" 0 expout ignore
+ atf_check 'echowrapper ${input}' 0 expout ignore
}
atf_init_test_cases() {