aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-01-26 00:55:15 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-01-26 01:58:38 +0300
commite61a287832532124a1a90a8bb9cc0f61f3a4db92 (patch)
tree1e95f720c526bdccd6348ccb9ec9db00ef0aed96
parent1ae34f7a3a7b7977338bb0bbd5b70add36255cf4 (diff)
Only pass diff --strip-trailing-cr in runner if running on Windows
-rw-r--r--build2/test/script/runner.cxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/build2/test/script/runner.cxx b/build2/test/script/runner.cxx
index 6f8446f..2eefdb7 100644
--- a/build2/test/script/runner.cxx
+++ b/build2/test/script/runner.cxx
@@ -285,13 +285,17 @@ namespace build2
path dp ("diff");
process_path pp (run_search (dp, true));
- cstrings args {
- pp.recall_string (),
- "--strip-trailing-cr", // Is essential for cross-testing.
- "-u",
- eop.string ().c_str (),
- op.string ().c_str (),
- nullptr};
+ cstrings args {pp.recall_string (), "-u"};
+
+ // Ignore Windows newline fluff if that's what we are running on.
+ //
+ if (cast<target_triplet> (
+ sp.root->test_target["test.target"]).class_ == "windows")
+ args.push_back ("--strip-trailing-cr");
+
+ args.push_back (eop.string ().c_str ());
+ args.push_back (op.string ().c_str ());
+ args.push_back (nullptr);
if (verb >= 2)
print_process (args);