GCC Code Coverage Report


Directory: ../
File: test/driver/Driver.cpp
Date: 2025-03-05 01:50:32
Exec Total Coverage
Lines: 0 0 100.0%
Functions: 0 0 -%
Branches: 0 0 -%

Line Branch Exec Source
1 // Copyright (c) 2021-2025 ChilliBits. All rights reserved.
2
3 #include "Driver.h"
4
5 #include "util/CommonUtil.h"
6
7 // GCOV_EXCL_START
8 namespace spice::testing {
9
10 TestDriverCliOptions testDriverCliOptions;
11
12 void Driver::createInterface() {
13 // Allow positional args
14 app.allow_non_standard_option_names();
15 app.positionals_at_end();
16 app.require_subcommand(0);
17 app.allow_extras(false);
18 app.footer("(c) Marc Auberer 2021-2025");
19
20 // Add version flag
21 app.set_version_flag("--version,-v", compiler::CommonUtil::buildVersionInfo());
22 }
23
24 void Driver::addOptions() {
25 // --update-refs
26 app.add_flag<bool>("--update-refs,-u", testDriverCliOptions.updateRefs, "Update test reference files");
27 // --run-benchmarks
28 app.add_flag<bool>("--run-benchmarks,-b", testDriverCliOptions.runBenchmarks, "Also run benchmarks and check baseline values");
29 // --leak-detection
30 app.add_flag<bool>("--leak-detection,-l", testDriverCliOptions.enableLeakDetection, "Use Valgrind on tests to detect memory leaks");
31 // --is-github-actions
32 app.add_flag<bool>("--is-github-actions,-gh", testDriverCliOptions.isGitHubActions, "Skip tests that are not supported to run on GitHub Actions");
33 // --verbose
34 app.add_flag<bool>("--verbose", testDriverCliOptions.isVerbose, "Print debug output for the test runner");
35 }
36
37 /**
38 * Start the parsing process
39 *
40 * @param argc Argument count
41 * @param argv Argument vector
42 * @return Return code
43 */
44 int Driver::parse(int argc, char **argv) {
45 try {
46 app.parse(argc, argv);
47 } catch (const CLI::ParseError &parseError) {
48 return app.exit(parseError);
49 }
50 return 0;
51 }
52
53 } // namespace spice::testing
54
55 // GCOV_EXCL_STOP
56