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: Thu Apr 23 18:52:56 UTC 2020
Modified Files:
pkgsrc/regress/infra-unittests: subst.sh
Log Message:
regress/infra-unittests: ensure that subst.mk preserves the x bit
To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 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.20 pkgsrc/regress/infra-unittests/subst.sh:1.21
--- pkgsrc/regress/infra-unittests/subst.sh:1.20 Thu Apr 23 18:30:37 2020
+++ pkgsrc/regress/infra-unittests/subst.sh Thu Apr 23 18:52:55 2020
@@ -12,7 +12,7 @@ test_case_set_up() {
create_file "prepare-subst.mk" <<EOF
# The tools that are used by subst.mk
-CHMOD= chmod-is-not-used
+CHMOD= chmod
CMP= cmp
DIFF= diff
ECHO= echo
@@ -1065,3 +1065,36 @@ if test_case_begin "typo in SUBST_CLASSE
test_case_end
fi
+
+
+if test_case_begin "executable bit is preserved"; then
+
+ create_file_lines "testcase.mk" \
+ 'SUBST_CLASSES+= id' \
+ 'SUBST_STAGE.id= pre-configure' \
+ 'SUBST_FILES.id= cmd data' \
+ 'SUBST_VARS.id= VAR' \
+ 'VAR= replaced' \
+ '' \
+ '.include "prepare-subst.mk"' \
+ '.include "mk/subst.mk"'
+ create_file_lines "cmd" \
+ '@VAR@'
+ create_file_lines "data" \
+ '@VAR@'
+ chmod +x "$tmpdir/cmd"
+
+ run_bmake "testcase.mk" "pre-configure" 1> "$tmpdir/out" 2>&1 \
+ && exitcode=0 || exitcode=$?
+
+ assert_that "out" --file-is-lines \
+ '=> Substituting "id" in cmd data'
+ assert_that "cmd" --file-is-lines "replaced"
+ assert_that "data" --file-is-lines "replaced"
+ [ -x "$tmpdir/cmd" ] \
+ || assert_fail "cmd must still be executable"
+ [ -x "$tmpdir/data" ] \
+ && assert_fail "data must not be executable"
+
+ test_case_end
+fi
Home |
Main Index |
Thread Index |
Old Index