summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog7
-rw-r--r--tests/scripts/targets/POSIX26
-rw-r--r--tests/scripts/variables/SHELL14
3 files changed, 47 insertions, 0 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index c8f3aab..a611422 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,10 @@
+2010-07-06 Paul Smith <psmith@gnu.org>
+
+ * scripts/variables/SHELL: Test the new .SHELLFLAGS variable.
+
+ * scripts/targets/POSIX: New file. Test the .POSIX special target.
+ Verify that enabling .POSIX changes the shell flags to set -e.
+
2010-07-01 Paul Smith <psmith@gnu.org>
* scripts/features/recursion: Add a space to separate command-line
diff --git a/tests/scripts/targets/POSIX b/tests/scripts/targets/POSIX
new file mode 100644
index 0000000..662c16d
--- /dev/null
+++ b/tests/scripts/targets/POSIX
@@ -0,0 +1,26 @@
+# -*-perl-*-
+
+$description = "Test the behaviour of the .PHONY target.";
+
+$details = "";
+
+
+# Ensure turning on .POSIX enables the -e flag for the shell
+
+run_make_test(q!
+.POSIX:
+all: ; @false; true
+!,
+ '', "#MAKE#: *** [all] Error 1\n", 512);
+
+# User settings must override .POSIX
+
+run_make_test(q!
+.SHELLFLAGS = -xc
+.POSIX:
+all: ; @false; true
+!,
+ '', "+ false\n+ true\n");
+
+# This tells the test driver that the perl test script executed properly.
+1;
diff --git a/tests/scripts/variables/SHELL b/tests/scripts/variables/SHELL
index a303540..69871d2 100644
--- a/tests/scripts/variables/SHELL
+++ b/tests/scripts/variables/SHELL
@@ -56,4 +56,18 @@ two: export SHELL := /./$mshell\n".'
one two:;@echo "$@: $(SHELL) $$SHELL"
', '', "two: /./$mshell /./$mshell\none: /././$mshell $mshell\n");
+# Test .SHELLFLAGS
+
+run_make_test(q!
+.SHELLFLAGS = -xc
+all: ; @true
+!,
+ '', "+ true\n");
+
+run_make_test(q!
+.SHELLFLAGS = -xec
+all: ; @true; false; true
+!,
+ '', "+ true\n+ false\n#MAKE#: *** [all] Error 1\n", 512);
+
1;