From e61a287832532124a1a90a8bb9cc0f61f3a4db92 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 26 Jan 2017 00:55:15 +0300 Subject: Only pass diff --strip-trailing-cr in runner if running on Windows --- build2/test/script/runner.cxx | 18 +++++++++++------- 1 file 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 ( + 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); -- cgit v1.1