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
|
add_executable(nix-irc
|
||||||
src/irc/main.cpp
|
src/irc/main.cpp
|
||||||
src/irc/parser.cpp
|
src/irc/parser.cpp
|
||||||
|
src/irc/lexer.cpp
|
||||||
src/irc/resolver.cpp
|
src/irc/resolver.cpp
|
||||||
src/irc/ir_gen.cpp
|
src/irc/ir_gen.cpp
|
||||||
src/irc/serializer.cpp
|
src/irc/serializer.cpp
|
||||||
|
src/irc/types.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(nix-irc PRIVATE
|
target_include_directories(nix-irc PRIVATE
|
||||||
|
|
@ -38,10 +40,12 @@ target_link_libraries(nix-irc PRIVATE
|
||||||
add_library(nix-ir-plugin MODULE
|
add_library(nix-ir-plugin MODULE
|
||||||
src/plugin.cpp
|
src/plugin.cpp
|
||||||
src/irc/parser.cpp
|
src/irc/parser.cpp
|
||||||
|
src/irc/lexer.cpp
|
||||||
src/irc/resolver.cpp
|
src/irc/resolver.cpp
|
||||||
src/irc/ir_gen.cpp
|
src/irc/ir_gen.cpp
|
||||||
src/irc/serializer.cpp
|
src/irc/serializer.cpp
|
||||||
src/irc/evaluator.cpp
|
src/irc/evaluator.cpp
|
||||||
|
src/irc/types.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
# Include directories from pkg-config
|
# Include directories from pkg-config
|
||||||
|
|
@ -65,6 +69,10 @@ target_link_libraries(nix-ir-plugin PRIVATE
|
||||||
${NIX_MAIN_LINK_LIBRARIES}
|
${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 output name
|
||||||
set_target_properties(nix-ir-plugin PROPERTIES
|
set_target_properties(nix-ir-plugin PROPERTIES
|
||||||
PREFIX ""
|
PREFIX ""
|
||||||
|
|
@ -79,6 +87,8 @@ add_executable(regression_test
|
||||||
tests/regression_test.cpp
|
tests/regression_test.cpp
|
||||||
src/irc/serializer.cpp
|
src/irc/serializer.cpp
|
||||||
src/irc/parser.cpp
|
src/irc/parser.cpp
|
||||||
|
src/irc/lexer.cpp
|
||||||
|
src/irc/types.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(regression_test PRIVATE
|
target_include_directories(regression_test PRIVATE
|
||||||
|
|
@ -93,3 +103,7 @@ target_link_libraries(regression_test PRIVATE
|
||||||
${NIX_EXPR_LINK_LIBRARIES}
|
${NIX_EXPR_LINK_LIBRARIES}
|
||||||
${NIX_UTIL_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 {
|
in {
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
name = "nixir";
|
name = "nixir";
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; let
|
||||||
|
nixForLinking = nixVersions.nixComponents_2_32;
|
||||||
|
in [
|
||||||
boost.dev
|
boost.dev
|
||||||
libblake3.dev
|
libblake3.dev
|
||||||
|
pegtl
|
||||||
|
|
||||||
nixVersions.nixComponents_2_32.nix-store
|
nixForLinking.nix-store
|
||||||
nixVersions.nixComponents_2_32.nix-expr
|
nixForLinking.nix-expr
|
||||||
nixVersions.nixComponents_2_32.nix-cmd
|
nixForLinking.nix-cmd
|
||||||
nixVersions.nixComponents_2_32.nix-fetchers
|
nixForLinking.nix-fetchers
|
||||||
nixVersions.nixComponents_2_32.nix-main
|
nixForLinking.nix-main
|
||||||
nixVersions.nixComponents_2_32.nix-util
|
nixForLinking.nix-util
|
||||||
nixVersions.nix_2_32
|
|
||||||
];
|
];
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
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