Run cmake-init and setup flake.nix and default.nix
This commit is contained in:
17
test/CMakeLists.txt
Normal file
17
test/CMakeLists.txt
Normal 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)
|
||||
8
test/source/ec-controller_test.cpp
Normal file
8
test/source/ec-controller_test.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#include "lib.hpp"
|
||||
|
||||
auto main() -> int
|
||||
{
|
||||
auto const lib = library {};
|
||||
|
||||
return lib.name == "ec-controller" ? 0 : 1;
|
||||
}
|
||||
Reference in New Issue
Block a user