Line | Branch | Exec | Source |
---|---|---|---|
1 | // Copyright (c) 2021-2024 ChilliBits. All rights reserved. | ||
2 | |||
3 | #include <gtest/gtest.h> | ||
4 | |||
5 | #include <driver/Driver.h> | ||
6 | |||
7 | namespace spice::testing { | ||
8 | |||
9 | using namespace spice::compiler; | ||
10 | |||
11 | 8 | TEST(DriverTest, TestBuildSubcommandMinimal) { | |
12 | 2 | const char *argv[] = {"spice", "build", "../../media/test-project/test.spice"}; | |
13 | static constexpr int argc = std::size(argv); | ||
14 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | Driver driver(true); |
15 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | driver.init(); |
16 |
4/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
|
2 | ASSERT_EQ(EXIT_SUCCESS, driver.parse(argc, argv)); |
17 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | driver.enrich(); |
18 | |||
19 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.shouldCompile); |
20 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.shouldInstall); |
21 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.shouldUninstall); |
22 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.shouldExecute); |
23 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.execute); |
24 |
5/16✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✓ Branch 27 taken 1 times.
✗ Branch 28 not taken.
|
2 | ASSERT_EQ("../../media/test-project/test.spice", driver.cliOptions.mainSourceFile.relative_path().string()); |
25 |
3/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
2 | ASSERT_EQ(O0, driver.cliOptions.optLevel); |
26 |
3/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
2 | ASSERT_EQ(DEBUG, driver.cliOptions.buildMode); |
27 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.generateTestMain); |
28 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.testMode); |
29 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.noEntryFct); |
30 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | } |
31 | |||
32 | 8 | TEST(DriverTest, TestBuildSubcommandComplex) { | |
33 | 2 | const char *argv[] = {"spice", "b", "-d", "-ir", "-g", "-Os", "-m", "release", "-lto", "../../media/test-project/test.spice"}; | |
34 | static constexpr int argc = std::size(argv); | ||
35 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | Driver driver(true); |
36 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | driver.init(); |
37 |
4/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
|
2 | ASSERT_EQ(EXIT_SUCCESS, driver.parse(argc, argv)); |
38 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | driver.enrich(); |
39 | |||
40 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.shouldCompile); |
41 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.shouldInstall); |
42 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.shouldUninstall); |
43 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.shouldExecute); |
44 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.execute); |
45 |
5/16✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✓ Branch 27 taken 1 times.
✗ Branch 28 not taken.
|
2 | ASSERT_EQ("../../media/test-project/test.spice", driver.cliOptions.mainSourceFile.relative_path().string()); |
46 |
3/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
2 | ASSERT_EQ(Os, driver.cliOptions.optLevel); // -Os |
47 |
3/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
2 | ASSERT_EQ(RELEASE, driver.cliOptions.buildMode); // -m release |
48 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.generateTestMain); |
49 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.testMode); |
50 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.noEntryFct); |
51 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.cliOptions.generateDebugInfo); // -g |
52 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.cliOptions.useLTO); // -lto |
53 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.cliOptions.printDebugOutput); // -d |
54 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.cliOptions.dumpSettings.dumpIR); // -ir |
55 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | } |
56 | |||
57 | 8 | TEST(DriverTest, TestRunSubcommandMinimal) { | |
58 | 2 | const char *argv[] = {"spice", "run", "../../media/test-project/test.spice"}; | |
59 | static constexpr int argc = std::size(argv); | ||
60 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | Driver driver(true); |
61 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | driver.init(); |
62 |
4/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
|
2 | ASSERT_EQ(EXIT_SUCCESS, driver.parse(argc, argv)); |
63 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | driver.enrich(); |
64 | |||
65 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.shouldCompile); |
66 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.shouldInstall); |
67 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.shouldUninstall); |
68 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.shouldExecute); |
69 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.cliOptions.execute); |
70 |
5/16✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✓ Branch 27 taken 1 times.
✗ Branch 28 not taken.
|
2 | ASSERT_EQ("../../media/test-project/test.spice", driver.cliOptions.mainSourceFile.relative_path().string()); |
71 |
3/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
2 | ASSERT_EQ(O0, driver.cliOptions.optLevel); |
72 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.generateTestMain); |
73 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.testMode); |
74 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.noEntryFct); |
75 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | } |
76 | |||
77 | 8 | TEST(DriverTest, TestRunSubcommandComplex) { | |
78 | 2 | const char *argv[] = {"spice", "r", "-O2", "-j", "8", "-ast", "../../media/test-project/test.spice"}; | |
79 | static constexpr int argc = std::size(argv); | ||
80 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | Driver driver(true); |
81 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | driver.init(); |
82 |
4/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
|
2 | ASSERT_EQ(EXIT_SUCCESS, driver.parse(argc, argv)); |
83 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | driver.enrich(); |
84 | |||
85 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.shouldCompile); |
86 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.shouldInstall); |
87 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.shouldUninstall); |
88 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.shouldExecute); |
89 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.cliOptions.execute); |
90 |
5/16✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✓ Branch 27 taken 1 times.
✗ Branch 28 not taken.
|
2 | ASSERT_EQ("../../media/test-project/test.spice", driver.cliOptions.mainSourceFile.relative_path().string()); |
91 |
3/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
2 | ASSERT_EQ(O2, driver.cliOptions.optLevel); // -O2 |
92 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.generateTestMain); |
93 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.testMode); |
94 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.noEntryFct); |
95 |
3/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
2 | ASSERT_EQ(8, driver.cliOptions.compileJobCount); // -j 8 |
96 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.cliOptions.dumpSettings.dumpAST); // -ast |
97 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | } |
98 | |||
99 | 8 | TEST(DriverTest, TestTestSubcommandMinimal) { | |
100 | 2 | const char *argv[] = {"spice", "test", "../../media/test-project/test.spice"}; | |
101 | static constexpr int argc = std::size(argv); | ||
102 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | Driver driver(true); |
103 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | driver.init(); |
104 |
4/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
|
2 | ASSERT_EQ(EXIT_SUCCESS, driver.parse(argc, argv)); |
105 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | driver.enrich(); |
106 | |||
107 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.shouldCompile); |
108 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.shouldInstall); |
109 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.shouldUninstall); |
110 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.shouldExecute); |
111 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.cliOptions.execute); |
112 |
5/16✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✓ Branch 27 taken 1 times.
✗ Branch 28 not taken.
|
2 | ASSERT_EQ("../../media/test-project/test.spice", driver.cliOptions.mainSourceFile.relative_path().string()); |
113 |
3/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
2 | ASSERT_EQ(OptLevel::O0, driver.cliOptions.optLevel); |
114 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.cliOptions.generateTestMain); |
115 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.cliOptions.testMode); |
116 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.cliOptions.noEntryFct); |
117 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | } |
118 | |||
119 | 8 | TEST(DriverTest, TestTestSubcommandComplex) { | |
120 | 2 | const char *argv[] = {"spice", "t", "-s", "-cst", "../../media/test-project/test.spice"}; | |
121 | static constexpr int argc = std::size(argv); | ||
122 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | Driver driver(true); |
123 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | driver.init(); |
124 |
4/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
|
2 | ASSERT_EQ(EXIT_SUCCESS, driver.parse(argc, argv)); |
125 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | driver.enrich(); |
126 | |||
127 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.shouldCompile); |
128 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.shouldInstall); |
129 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.shouldUninstall); |
130 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.shouldExecute); |
131 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.cliOptions.execute); |
132 |
5/16✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✓ Branch 27 taken 1 times.
✗ Branch 28 not taken.
|
2 | ASSERT_EQ("../../media/test-project/test.spice", driver.cliOptions.mainSourceFile.relative_path().string()); |
133 |
3/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
2 | ASSERT_EQ(OptLevel::O0, driver.cliOptions.optLevel); |
134 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.cliOptions.generateTestMain); |
135 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.cliOptions.testMode); |
136 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.cliOptions.noEntryFct); |
137 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.cliOptions.dumpSettings.dumpCST); // -cst |
138 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.cliOptions.dumpSettings.dumpAssembly); // -s |
139 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | } |
140 | |||
141 | 8 | TEST(DriverTest, TestInstallSubcommandMinimal) { | |
142 | 2 | const char *argv[] = {"spice", "install", "../../media/test-project/test.spice"}; | |
143 | static constexpr int argc = std::size(argv); | ||
144 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | Driver driver(true); |
145 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | driver.init(); |
146 |
4/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
|
2 | ASSERT_EQ(EXIT_SUCCESS, driver.parse(argc, argv)); |
147 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | driver.enrich(); |
148 | |||
149 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.shouldCompile); |
150 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.shouldInstall); |
151 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.shouldUninstall); |
152 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.shouldExecute); |
153 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.execute); |
154 |
5/16✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✓ Branch 27 taken 1 times.
✗ Branch 28 not taken.
|
2 | ASSERT_EQ("../../media/test-project/test.spice", driver.cliOptions.mainSourceFile.relative_path().string()); |
155 |
3/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
2 | ASSERT_EQ(OptLevel::O0, driver.cliOptions.optLevel); |
156 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.generateTestMain); |
157 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.testMode); |
158 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.noEntryFct); |
159 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | } |
160 | |||
161 | 8 | TEST(DriverTest, TestUninstallSubcommandMinimal) { | |
162 | 2 | const char *argv[] = {"spice", "uninstall", "../../media/test-project/test.spice"}; | |
163 | static constexpr int argc = std::size(argv); | ||
164 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | Driver driver(true); |
165 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | driver.init(); |
166 |
4/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
|
2 | ASSERT_EQ(EXIT_SUCCESS, driver.parse(argc, argv)); |
167 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | driver.enrich(); |
168 | |||
169 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.shouldCompile); |
170 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.shouldInstall); |
171 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_TRUE(driver.shouldUninstall); |
172 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.shouldExecute); |
173 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.execute); |
174 |
5/16✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✓ Branch 27 taken 1 times.
✗ Branch 28 not taken.
|
2 | ASSERT_EQ("../../media/test-project/test.spice", driver.cliOptions.mainSourceFile.relative_path().string()); |
175 |
3/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
|
2 | ASSERT_EQ(O0, driver.cliOptions.optLevel); |
176 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.generateTestMain); |
177 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.testMode); |
178 |
2/12✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
|
2 | ASSERT_FALSE(driver.cliOptions.noEntryFct); |
179 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | } |
180 | |||
181 | } // namespace spice::testing | ||
182 |