aboutsummaryrefslogtreecommitdiff
path: root/runtest.rb
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2015-08-25 14:22:35 -0700
committerDan Willemsen <dwillemsen@google.com>2015-08-31 19:25:58 -0700
commitf3a4ced0a4a6a9a71e3d2247d5f3e2608da04df6 (patch)
treef383be9cec99b4ac4bbd95bd859ab0644bedb86d /runtest.rb
parent3faa60f59806427411be456f8a71480f96fdfb40 (diff)
downloadkati-f3a4ced0a4a6a9a71e3d2247d5f3e2608da04df6.tar.gz
[C++] Fix ninja EmitNode early exit
Change-Id: I2b574a71472508515e9d06e55ff2c2e1a5292c2b
Diffstat (limited to 'runtest.rb')
-rwxr-xr-xruntest.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/runtest.rb b/runtest.rb
index ca42048..75b2eb5 100755
--- a/runtest.rb
+++ b/runtest.rb
@@ -93,6 +93,8 @@ def normalize_ninja_log(log, mk)
log.gsub!(/^ninja: no work to do\.\n/, '')
log.gsub!(/^ninja: error: (.*, needed by .*),.*/,
'*** No rule to make target \\1.')
+ log.gsub!(/^ninja: warning: multiple rules generate (.*)\. builds involving this target will not be correct.*$/,
+ 'ninja: warning: multiple rules generate \\1.')
if mk =~ /err_error_in_recipe.mk/
# This test expects ninja fails. Strip ninja specific error logs.
log.gsub!(/^FAILED: .*\n/, '')
@@ -101,7 +103,7 @@ def normalize_ninja_log(log, mk)
log
end
-def normalize_make_log(expected, mk)
+def normalize_make_log(expected, mk, via_ninja)
expected.gsub!(/^make(?:\[\d+\])?: (Entering|Leaving) directory.*\n/, '')
expected.gsub!(/^make(?:\[\d+\])?: /, '')
expected = move_circular_dep(expected)
@@ -123,6 +125,11 @@ def normalize_make_log(expected, mk)
expected.gsub!(/Nothing to be done for "test"\.\n/, '')
end
expected.gsub!(/^\/bin\/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
+ expected.gsub!(/^ninja: warning: .*\n/, '')
+ end
expected
end
@@ -192,7 +199,7 @@ run_make_test = proc do |mk|
end
cmd += " #{tc} 2>&1"
res = `#{cmd}`
- res = normalize_make_log(res, mk)
+ res = normalize_make_log(res, mk, via_ninja)
expected += "=== #{tc} ===\n" + res
expected_files = get_output_filenames
expected += "\n=== FILES ===\n#{expected_files * "\n"}\n"
@@ -299,7 +306,7 @@ run_shell_test = proc do |sh|
output = IO.popen(cmd, 'r:binary', &:read)
- expected = normalize_make_log(expected, sh)
+ expected = normalize_make_log(expected, sh, is_ninja_test)
output = normalize_kati_log(output)
if is_ninja_test
output = normalize_ninja_log(output, sh)