Run cmake-init and setup flake.nix and default.nix

This commit is contained in:
2023-08-15 15:58:43 +03:00
parent 40684d900b
commit 5745001064
35 changed files with 1562 additions and 1 deletions

17
test/CMakeLists.txt Normal file
View File

@@ -0,0 +1,17 @@
# Parent project does not export its library target, so this CML implicitly
# depends on being added from it, i.e. the testing is done only from the build
# tree and is not feasible from an install location
project(ec-controllerTests LANGUAGES CXX)
# ---- Tests ----
add_executable(ec-controller_test source/ec-controller_test.cpp)
target_link_libraries(ec-controller_test PRIVATE ec-controller_lib)
target_compile_features(ec-controller_test PRIVATE cxx_std_20)
add_test(NAME ec-controller_test COMMAND ec-controller_test)
# ---- End-of-file commands ----
add_folders(Test)

View File

@@ -0,0 +1,8 @@
#include "lib.hpp"
auto main() -> int
{
auto const lib = library {};
return lib.name == "ec-controller" ? 0 : 1;
}