This commit is contained in:
Jorijn van der Graaf 2025-11-03 15:52:04 +01:00
commit ec64b17b27
4 changed files with 14 additions and 9 deletions

View file

@ -182,17 +182,16 @@ clang++ -std=c++26 -Wno-reserved-identifier -Wno-reserved-module-identifier --pr
name.replace_extension();
if(!fs::exists(buildDir/name)) {
if(!config.dependencies[i].branch.empty()) {
RunCommandIgnore(std::format("cd {} && git clone {} && cd {} && git switch {}", buildDir.string(), config.dependencies[i].path, (buildDir/name).string(), config.dependencies[i].branch));
system(std::format("cd {} && git clone {} && cd {} && git switch {}", buildDir.string(), config.dependencies[i].path, (buildDir/name).string(), config.dependencies[i].branch).c_str());
} else if(!config.dependencies[i].commit.empty()){
std::cout << std::format("cd {} && git clone {} && cd {} && git checkout {}", buildDir.string(), config.dependencies[i].path, (buildDir/name).string(), config.dependencies[i].commit) << std::endl;
RunCommandIgnore(std::format("cd {} && git clone {} && cd {} && git checkout {}", buildDir.string(), config.dependencies[i].path, (buildDir/name).string(), config.dependencies[i].commit));
system(std::format("cd {} && git clone {} && cd {} && git checkout {}", buildDir.string(), config.dependencies[i].path, (buildDir/name).string(), config.dependencies[i].commit).c_str());
} else {
RunCommandIgnore(std::format("cd {} && git clone {}", buildDir.string(), config.dependencies[i].path));
system(std::format("cd {} && git clone {}", buildDir.string(), config.dependencies[i].path).c_str());
}
} else if(config.dependencies[i].commit.empty()) {
RunCommandIgnore(std::format("cd {} && git pull", (buildDir/name).string()));
system(std::format("cd {} && git pull", (buildDir/name).string()).c_str());
}
config.dependencies[i].path = fs::path(config.dependencies[i].path).filename().replace_extension()/"project.json";
config.dependencies[i].path = buildDir/name/"project.json";
}
if(fs::path(config.dependencies[i].path).is_relative()) {
config.dependencies[i].path = this->path/config.dependencies[i].path;
@ -372,7 +371,12 @@ clang++ -std=c++26 -Wno-reserved-identifier -Wno-reserved-module-identifier --pr
dlclose(handle);
throw std::runtime_error(std::format("Cannot load symbol 'RunTest': {}", msg));
}
std::string* testResult = loadedTest();
std::string* testResult;
try {
testResult = loadedTest();
} catch(std::exception& e) {
return {test.config.name, std::string(e.what())};
}
if(testResult != nullptr) {
TestResult result = {test.config.name, *testResult};
delete testResult;

View file

@ -70,7 +70,8 @@ int main(int argc, char* argv[]) {
binDir = std::format("{}/{}", project.binDir.string(), config.name);
}
if(config.debug) {
system(std::format("cd {} && lldb -o run {}", (fs::path(projectPath).parent_path()/binDir).string(), project.name).c_str());
system(std::format("cd {} && ./{}", (fs::path(projectPath).parent_path()/binDir).string(), project.name).c_str());
//system(std::format("cd {} && lldb -o run {}", (fs::path(projectPath).parent_path()/binDir).string(), project.name).c_str());
} else {
system(std::format("cd {} && ./{}", (fs::path(projectPath).parent_path()/binDir).string(), project.name).c_str());
}