diff options
Diffstat (limited to 'regress')
-rw-r--r-- | regress/infra-unittests/subst.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/regress/infra-unittests/subst.sh b/regress/infra-unittests/subst.sh index 07addd835d6..f443f8c1a5e 100644 --- a/regress/infra-unittests/subst.sh +++ b/regress/infra-unittests/subst.sh @@ -1099,3 +1099,33 @@ if test_case_begin "executable bit is preserved"; then 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 |