diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-11-30 22:42:40 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-12-08 14:26:22 +0300 |
commit | fb34688841668e6e4c939395c8387feabe8ddfdf (patch) | |
tree | 5e0da2e74cee981337f9cd19d148e9824d7d3c36 /libbuild2/test/rule.cxx | |
parent | 121a075bc2558003990377843393ca27d784f50f (diff) |
Add support for config.test.runner
Diffstat (limited to 'libbuild2/test/rule.cxx')
-rw-r--r-- | libbuild2/test/rule.cxx | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/libbuild2/test/rule.cxx b/libbuild2/test/rule.cxx index d720b25..06fb12f 100644 --- a/libbuild2/test/rule.cxx +++ b/libbuild2/test/rule.cxx @@ -937,12 +937,32 @@ namespace build2 args.push_back (nullptr); } - // If dry-run, the target may not exist. + process_path pp; + + // Do we have a test runner? // - process_path pp (!ctx.dry_run - ? run_search (p, true /* init */) - : run_try_search (p, true)); - args.push_back (pp.empty () ? p.string ().c_str () : pp.recall_string ()); + if (runner_path == nullptr) + { + // If dry-run, the target may not exist. + // + pp = process_path (!ctx.dry_run + ? run_search (p, true /* init */) + : run_try_search (p, true)); + + args.push_back (pp.empty () + ? p.string ().c_str () + : pp.recall_string ()); + } + else + { + args.push_back (runner_path->recall_string ()); + + append_options (args, *runner_options); + + // Leave it to the runner to resolve the test program path. + // + args.push_back (p.string ().c_str ()); + } // Do we have options and/or arguments? // |