| 158 | } |
| 159 | break; |
| 160 | case Platform::Emscripten: return Result::Error("Unsupported QEMU test host"); |
| 161 | } |
| 162 | SC_TRY(StringBuilder::format(packageRoot, "{}/qemu_{}", packagesRoot, leaf)); |
| 163 | return Result(true); |
| 164 | } |
| 165 | |
| 166 | struct SupportToolsTest : public TestCase |
| 167 | { |
| 168 | SupportToolsTest(SC::TestReport& report) : TestCase(report, "SupportToolsTest") |
| 169 | { |
| 170 | using namespace SC::Tools; |
| 171 | using namespace SC::Tools::detail; |
| 172 | StringPath outputDirectory; |
| 173 | (void)StringBuilder::format(outputDirectory, "{0}/_Build/_TestScratch/SupportToolsTest", |
| 174 | report.libraryRootDirectory); |
| 175 | { |
| 176 | FileSystem fs; |
| 177 | SC_TEST_EXPECT(fs.init(".")); |
| 178 | if (fs.existsAndIsDirectory(outputDirectory.view())) |
| 179 | { |
| 180 | SC_TEST_EXPECT(fs.removeDirectoriesRecursive(outputDirectory.view())); |
| 181 | } |
| 182 | SC_TEST_EXPECT(fs.makeDirectoryRecursive(outputDirectory.view())); |
| 183 | } |
| 184 | Tool::Arguments arguments{*globalConsole, |
| 185 | report.libraryRootDirectory, |
| 186 | report.libraryRootDirectory, |
| 187 | outputDirectory, |
| 188 | report.libraryRootDirectory, |
| 189 | StringView(), |
| 190 | StringView(), |
| 191 | {}}; |
| 192 | |
| 193 | const bool runHeavySections = shouldRunHeavySupportToolsTests(); |
| 194 | StringView args[10]; |
| 195 | if (test_section("build cli parses legacy positional arguments")) |
| 196 | { |
| 197 | arguments.tool = "build"; |
| 198 | arguments.action = "compile"; |
| 199 | args[0] = "SCTest"; |
| 200 | args[1] = "Release"; |
| 201 | args[2] = "native"; |
| 202 | args[3] = "arm64"; |
| 203 | args[4] = "quiet"; |
| 204 | arguments.arguments = {args, 5}; |
| 205 | |
| 206 | Build::Action action; |
| 207 | BuildCLIResolvedStorage storage; |
| 208 | BuildCLIStatus status = BuildCLIStatus::Error; |
| 209 | SC_TEST_EXPECT(prepareBuildAction(Build::Action::Compile, arguments, action, storage, status)); |
| 210 | SC_TEST_EXPECT(status == BuildCLIStatus::Ready); |
| 211 | SC_TEST_EXPECT(action.projectName == "SCTest"); |
| 212 | SC_TEST_EXPECT(action.configurationName == "Release"); |
| 213 | SC_TEST_EXPECT(action.parameters.generator == Build::Generator::Native); |
| 214 | SC_TEST_EXPECT(action.parameters.architecture == Build::Architecture::Arm64); |
| 215 | SC_TEST_EXPECT(action.parameters.execution.outputMode.hasBeenSet()); |
| 216 | SC_TEST_EXPECT(action.parameters.execution.outputMode == Build::OutputMode::Quiet); |
| 217 | } |
nothing calls this directly
no test coverage detected