Crafter.Build/examples/tests/project.cpp
Jorijn van der Graaf 603840879d
All checks were successful
CI / build-test-release (push) Successful in 1h4m52s
new tests
2026-05-27 19:45:05 +02:00

25 lines
813 B
C++

import std;
import Crafter.Build;
namespace fs = std::filesystem;
using namespace Crafter;
// A pure library project: the root Configuration is the lib itself. Tests
// are declared with cfg.AddTest — one line per test, with deps and other
// options applied via the returned builder.
extern "C" Configuration CrafterBuildProject(std::span<const std::string_view>) {
Configuration cfg;
cfg.path = "./mylib/";
cfg.name = "MyMath";
cfg.outputName = "MyMath";
cfg.target = "x86_64-pc-linux-gnu";
cfg.type = ConfigurationType::LibraryStatic;
std::array<fs::path, 1> ifaces = { "MyMath" };
std::array<fs::path, 0> impls = {};
cfg.GetInterfacesAndImplementations(ifaces, impls);
cfg.AddTest("Smoke");
cfg.AddTest("UnitMyMath").Dependencies({ &cfg });
return cfg;
}