pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/regress/infra-unittests
Module Name: pkgsrc
Committed By: rillig
Date: Sat Mar 28 12:08:28 UTC 2020
Modified Files:
pkgsrc/regress/infra-unittests: subst.sh
Log Message:
regress/infra-unittests: add test for SUBST_FILES without effect
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 pkgsrc/regress/infra-unittests/subst.sh
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/regress/infra-unittests/subst.sh
diff -u pkgsrc/regress/infra-unittests/subst.sh:1.14 pkgsrc/regress/infra-unittests/subst.sh:1.15
--- pkgsrc/regress/infra-unittests/subst.sh:1.14 Fri Mar 27 22:56:29 2020
+++ pkgsrc/regress/infra-unittests/subst.sh Sat Mar 28 12:08:28 2020
@@ -923,3 +923,38 @@ if test_case_begin "pattern matches only
test_case_end
fi
+
+
+if test_case_begin "first filename pattern has no effect"; then
+
+ # All patterns of SUBST_FILES should be applied before erroring out.
+ # TODO: also warn about file2
+
+ create_file_lines "testcase.mk" \
+ 'SUBST_CLASSES+= id' \
+ 'SUBST_STAGE.id= pre-configure' \
+ 'SUBST_FILES.id= file1 file2' \
+ 'SUBST_VARS.id= A B' \
+ 'SUBST_NOOP_OK.id= no' \
+ 'A= a-value' \
+ 'B= b-value' \
+ '' \
+ '.include "prepare-subst.mk"' \
+ '.include "mk/subst.mk"'
+ create_file_lines "file1" "nothing to replace"
+ create_file_lines "file2" "nothing to replace"
+
+ run_bmake "testcase.mk" "pre-configure" 1> "$tmpdir/out" 2>&1 \
+ && exitcode=0 || exitcode=$?
+
+ assert_that "out" --file-is-lines \
+ '=> Substituting "id" in file1 file2' \
+ 'warning: [subst.mk:id] Nothing changed in ./file1.' \
+ 'fail: [subst.mk:id] The pattern file1 has no effect.' \
+ '*** Error code 1' \
+ '' \
+ 'Stop.' \
+ "$make: stopped in $PWD"
+
+ test_case_end
+fi
Home |
Main Index |
Thread Index |
Old Index