From 789fb7ef6e34611af3d66583b0ed90722ffba639 Mon Sep 17 00:00:00 2001 From: Jake Hillion Date: Fri, 21 Apr 2023 03:40:02 -0700 Subject: [PATCH] add feature addition to the integration test runner --- test/integration/runner_common.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/integration/runner_common.cpp b/test/integration/runner_common.cpp index bd63cd3..a10a728 100644 --- a/test/integration/runner_common.cpp +++ b/test/integration/runner_common.cpp @@ -29,6 +29,7 @@ bool verbose = false; bool preserve = false; bool preserve_on_failure = false; bool run_skipped_tests = false; +std::vector extra_feature_args{}; constexpr static OIOpts opts{ OIOpt{'h', "help", no_argument, nullptr, "Print this message and exit"}, @@ -42,6 +43,8 @@ constexpr static OIOpts opts{ "Force running tests, even if they are marked as skipped"}, OIOpt{'x', "oid", required_argument, nullptr, "Path to OID executable to test"}, + OIOpt{'\0', "enable-feature", required_argument, nullptr, + "Enable extra OID feature."}, }; void usage(std::string_view progname) { @@ -73,6 +76,9 @@ int main(int argc, char* argv[]) { // directory is changed oidExe = fs::absolute(optarg); break; + case '\0': + extra_feature_args.push_back(std::string("-f") + optarg); + break; case 'h': default: usage(argv[0]); @@ -218,8 +224,13 @@ OidProc OidIntegration::runOidOnProcess(OidOpts opts, "--script-source"s, opts.scriptSource, "--pid"s, std::to_string(targetProcess.id()), }; + // clang-format on - auto oid_args = extra_args; + + // Specify feature args first so they can be overridden by extra_args of + // specific tests. + auto oid_args = extra_feature_args; + oid_args.insert(oid_args.end(), extra_args.begin(), extra_args.end()); oid_args.insert(oid_args.end(), default_args.begin(), default_args.end()); if (verbose) {