build: declare package tests and run them in CI
This commit is contained in:
1 parent
3d80649b8c
commit
99c91ab5fc
2 files changed
+25
-2
No files matched your search
@@ -43,6 +43,29 @@ void build(Void::Build::Project &project) {
|
||||
project.install_directory("include", "include");
|
||||
project.install_file("README.md", "share/doc/VoidLibrary");
|
||||
|
||||
// Per-module package tests (standalone mains under tests/package/<Module>Only).
|
||||
const std::vector<std::pair<std::string, std::string>> package_tests = {
|
||||
{"algorithms", "Algorithms"}, {"core", "Core"},
|
||||
{"crypto", "Crypto"}, {"configuration", "Configuration"},
|
||||
{"archive", "Archive"}, {"binary", "Binary"},
|
||||
{"containers", "Containers"}, {"data", "Data"},
|
||||
{"fsm", "Fsm"}, {"io", "IO"},
|
||||
{"text", "Text"}, {"unicode", "Unicode"},
|
||||
{"async", "Async"}, {"log", "Log"},
|
||||
{"storage", "Storage"}, {"sqlite", "Sqlite"},
|
||||
};
|
||||
for (const auto &[test_name, module_name] : package_tests) {
|
||||
const std::string test_dir = "tests/package/" + module_name + "Only";
|
||||
if (!std::filesystem::is_directory(test_dir) ||
|
||||
!std::filesystem::is_regular_file(test_dir + "/main.cpp")) {
|
||||
continue;
|
||||
}
|
||||
auto package_test = project.test("void_" + test_name + "_tests");
|
||||
package_test.cxx_standard(Void::Build::CxxStandard::Cxx26)
|
||||
.sources({test_dir + "/main.cpp"})
|
||||
.link(libs.modules.at(module_name));
|
||||
}
|
||||
|
||||
// Smoke test exercising the native VoidLibrary closure through VBS.
|
||||
auto smoke = project.test("void_smoke");
|
||||
smoke.cxx_standard(Void::Build::CxxStandard::Cxx26)
|
||||
|
||||
Reference in new issue
Block a user