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:           Sun Apr 26 12:21:39 UTC 2020

Modified Files:
        pkgsrc/regress/infra-unittests: subst.sh

Log Message:
regress/infra-unittests: add test for subst.mk with unreadable file


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 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.23 pkgsrc/regress/infra-unittests/subst.sh:1.24
--- pkgsrc/regress/infra-unittests/subst.sh:1.23        Thu Apr 23 19:30:29 2020
+++ pkgsrc/regress/infra-unittests/subst.sh     Sun Apr 26 12:21:39 2020
@@ -1099,3 +1099,33 @@ if test_case_begin "executable bit is pr
 
        test_case_end
 fi
+
+
+if test_case_begin "unreadable file"; then
+
+       create_file_lines "testcase.mk" \
+               'SUBST_CLASSES+=        id' \
+               'SUBST_STAGE.id=        pre-configure' \
+               'SUBST_FILES.id=        unreadable-file' \
+               'SUBST_SED.id=          -e s,before,after,' \
+               '' \
+               '.include "prepare-subst.mk"' \
+               '.include "mk/subst.mk"'
+       create_file_lines "unreadable-file" \
+               'before'
+       chmod 0000 "$tmpdir/unreadable-file"
+
+       run_bmake "testcase.mk" "pre-configure" 1> "$tmpdir/out" 2>&1 \
+       && exitcode=0 || exitcode=$?
+
+       assert_that "out" --file-is-lines \
+               '=> Substituting "id" in unreadable-file' \
+               'sh: cannot open unreadable-file: permission denied' \
+               'sh: cannot open unreadable-file: permission denied' \
+               '*** Error code 1' \
+               '' \
+               'Stop.' \
+               "$make: stopped in $PWD"
+
+       test_case_end
+fi



Home | Main Index | Thread Index | Old Index