aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xruntest.rb8
-rw-r--r--testcase/shell_var.mk4
-rw-r--r--testcase/shell_var_with_args.mk2
3 files changed, 10 insertions, 4 deletions
diff --git a/runtest.rb b/runtest.rb
index 2bb70ee..ce3b551 100755
--- a/runtest.rb
+++ b/runtest.rb
@@ -137,7 +137,7 @@ def normalize_make_log(expected, mk, via_ninja)
# GNU make 4.0 has this output.
expected.gsub!(/Makefile:\d+: commands for target ".*?" failed\n/, '')
# We treat some warnings as errors.
- expected.gsub!(/^\/bin\/sh: line 0: /, '')
+ expected.gsub!(/^\/bin\/(ba)?sh: line 0: /, '')
# We print out some ninja warnings in some tests to match what we expect
# ninja to produce. Remove them if we're not testing ninja.
if !via_ninja
@@ -168,6 +168,8 @@ def normalize_kati_log(output)
output
end
+bash_var = ' SHELL=/bin/bash'
+
run_make_test = proc do |mk|
c = File.read(mk)
expected_failure = false
@@ -219,6 +221,7 @@ run_make_test = proc do |mk|
if via_ninja || is_silent_test
cmd += ' -s'
end
+ cmd += bash_var
cmd += " #{tc} 2>&1"
res = `#{cmd}`
res = normalize_make_log(res, mk, via_ninja)
@@ -246,6 +249,7 @@ run_make_test = proc do |mk|
if is_silent_test
cmd += ' -s'
end
+ cmd += bash_var
if !gen_all_targets || mk =~ /makecmdgoals/
cmd += " #{tc}"
end
@@ -328,6 +332,7 @@ run_shell_test = proc do |sh|
if is_ninja_test
cmd += ' -s'
end
+ cmd += bash_var
expected = IO.popen(cmd, 'r:binary', &:read)
cleanup
@@ -344,6 +349,7 @@ run_shell_test = proc do |sh|
cmd = "sh ../../#{sh} ../../kati --use_cache -log_dir=."
end
end
+ cmd += bash_var
output = IO.popen(cmd, 'r:binary', &:read)
diff --git a/testcase/shell_var.mk b/testcase/shell_var.mk
index 8f5de31..b42b0c9 100644
--- a/testcase/shell_var.mk
+++ b/testcase/shell_var.mk
@@ -1,11 +1,11 @@
$(info $(SHELL))
-SHELL:=/bin/echo
+override SHELL:=/bin/echo
$(info $(shell foo))
echo=/bin/echo
-SHELL=$(echo)
+override SHELL=$(echo)
$(info $(shell bar))
diff --git a/testcase/shell_var_with_args.mk b/testcase/shell_var_with_args.mk
index ca7b54a..779fa12 100644
--- a/testcase/shell_var_with_args.mk
+++ b/testcase/shell_var_with_args.mk
@@ -2,7 +2,7 @@
export FOO=-x
-SHELL := PS4="cmd: " /bin/bash $${FOO}
+override SHELL := PS4="cmd: " /bin/bash $${FOO}
$(info $(shell echo foo))
test: