diff options
author | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2016-04-28 16:50:46 +0900 |
---|---|---|
committer | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2016-04-28 16:50:46 +0900 |
commit | 2d2ed95265fe5fed97953af68eef5479e5c7e5e5 (patch) | |
tree | 98019f088158869c6b73172f06cfe212d8e89888 | |
parent | d07e29712544000b65cc036677d4752961e815b6 (diff) | |
download | android_build_kati-2d2ed95265fe5fed97953af68eef5479e5c7e5e5.tar.gz android_build_kati-2d2ed95265fe5fed97953af68eef5479e5c7e5e5.tar.bz2 android_build_kati-2d2ed95265fe5fed97953af68eef5479e5c7e5e5.zip |
Explicitly use SHELL=/bin/bash
Also use override in tests which set $(SHELL)
-rwxr-xr-x | runtest.rb | 8 | ||||
-rw-r--r-- | testcase/shell_var.mk | 4 | ||||
-rw-r--r-- | testcase/shell_var_with_args.mk | 2 |
3 files changed, 10 insertions, 4 deletions
@@ -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: |