meta: CTest integration; expand test coverage
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I3e6bf966985f6212e99d146cb18e4e2f6a6a6964
This commit is contained in:
parent
584d84542e
commit
554f7f21f1
6 changed files with 31 additions and 8 deletions
|
|
@ -17,9 +17,11 @@ pkg_check_modules(NIX_MAIN REQUIRED IMPORTED_TARGET nix-main)
|
|||
add_executable(nix-irc
|
||||
src/irc/main.cpp
|
||||
src/irc/parser.cpp
|
||||
src/irc/lexer.cpp
|
||||
src/irc/resolver.cpp
|
||||
src/irc/ir_gen.cpp
|
||||
src/irc/serializer.cpp
|
||||
src/irc/types.cpp
|
||||
)
|
||||
|
||||
target_include_directories(nix-irc PRIVATE
|
||||
|
|
@ -38,10 +40,12 @@ target_link_libraries(nix-irc PRIVATE
|
|||
add_library(nix-ir-plugin MODULE
|
||||
src/plugin.cpp
|
||||
src/irc/parser.cpp
|
||||
src/irc/lexer.cpp
|
||||
src/irc/resolver.cpp
|
||||
src/irc/ir_gen.cpp
|
||||
src/irc/serializer.cpp
|
||||
src/irc/evaluator.cpp
|
||||
src/irc/types.cpp
|
||||
)
|
||||
|
||||
# Include directories from pkg-config
|
||||
|
|
@ -65,6 +69,10 @@ target_link_libraries(nix-ir-plugin PRIVATE
|
|||
${NIX_MAIN_LINK_LIBRARIES}
|
||||
)
|
||||
|
||||
# Set output directories to build/
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
|
||||
# Set output name
|
||||
set_target_properties(nix-ir-plugin PROPERTIES
|
||||
PREFIX ""
|
||||
|
|
@ -79,6 +87,8 @@ add_executable(regression_test
|
|||
tests/regression_test.cpp
|
||||
src/irc/serializer.cpp
|
||||
src/irc/parser.cpp
|
||||
src/irc/lexer.cpp
|
||||
src/irc/types.cpp
|
||||
)
|
||||
|
||||
target_include_directories(regression_test PRIVATE
|
||||
|
|
@ -93,3 +103,7 @@ target_link_libraries(regression_test PRIVATE
|
|||
${NIX_EXPR_LINK_LIBRARIES}
|
||||
${NIX_UTIL_LINK_LIBRARIES}
|
||||
)
|
||||
|
||||
# CTest integration
|
||||
enable_testing()
|
||||
add_test(NAME regression_test COMMAND regression_test)
|
||||
|
|
|
|||
18
flake.nix
18
flake.nix
|
|
@ -11,17 +11,19 @@
|
|||
in {
|
||||
default = pkgs.mkShell {
|
||||
name = "nixir";
|
||||
buildInputs = with pkgs; [
|
||||
buildInputs = with pkgs; let
|
||||
nixForLinking = nixVersions.nixComponents_2_32;
|
||||
in [
|
||||
boost.dev
|
||||
libblake3.dev
|
||||
pegtl
|
||||
|
||||
nixVersions.nixComponents_2_32.nix-store
|
||||
nixVersions.nixComponents_2_32.nix-expr
|
||||
nixVersions.nixComponents_2_32.nix-cmd
|
||||
nixVersions.nixComponents_2_32.nix-fetchers
|
||||
nixVersions.nixComponents_2_32.nix-main
|
||||
nixVersions.nixComponents_2_32.nix-util
|
||||
nixVersions.nix_2_32
|
||||
nixForLinking.nix-store
|
||||
nixForLinking.nix-expr
|
||||
nixForLinking.nix-cmd
|
||||
nixForLinking.nix-fetchers
|
||||
nixForLinking.nix-main
|
||||
nixForLinking.nix-util
|
||||
];
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
|
|
|
|||
BIN
tests/fixtures/lambda_pattern.nixr
vendored
Normal file
BIN
tests/fixtures/lambda_pattern.nixr
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/string_interp.nixr
vendored
Normal file
BIN
tests/fixtures/string_interp.nixr
vendored
Normal file
Binary file not shown.
2
tests/language/interp_test.nix
Normal file
2
tests/language/interp_test.nix
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# Test string interpolation
|
||||
let x = "world"; in "Hello ${x}!"
|
||||
5
tests/language/pattern_test.nix
Normal file
5
tests/language/pattern_test.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# Test lambda patterns
|
||||
({
|
||||
name,
|
||||
version ? "1.0",
|
||||
}: "${name}-${version}") {name = "test";}
|
||||
Loading…
Add table
Add a link
Reference in a new issue