diff options
-rw-r--r-- | build2/test/script/runner.cxx | 18 |
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); |