Skip to content

Commit b07f9de

Browse files
committed
Move codegen backend tests to codegen
1 parent 02df0da commit b07f9de

14 files changed

Lines changed: 47 additions & 41 deletions

‎test/CMakeLists.txt‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ add_subdirectory(scratchconfiguration)
2828
add_subdirectory(assets)
2929
add_subdirectory(script)
3030
add_subdirectory(extensions)
31-
if (NOT LIBSCRATCHCPP_CODEGEN_BACKEND STREQUAL "cpp")
3231
add_subdirectory(codegen)
32+
if (NOT LIBSCRATCHCPP_CODEGEN_BACKEND STREQUAL "cpp")
3333
add_subdirectory(engine)
3434
endif()
3535
add_subdirectory(clock)
@@ -47,9 +47,3 @@ add_subdirectory(promise)
4747
if (NOT LIBSCRATCHCPP_CODEGEN_BACKEND STREQUAL "cpp")
4848
add_subdirectory(test_api)
4949
endif()
50-
51-
if (LIBSCRATCHCPP_CODEGEN_BACKEND STREQUAL "llvm")
52-
add_subdirectory(llvm)
53-
elseif (LIBSCRATCHCPP_CODEGEN_BACKEND STREQUAL "cpp")
54-
add_subdirectory(cpp)
55-
endif()

‎test/codegen/CMakeLists.txt‎

Lines changed: 46 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,48 +16,54 @@ target_link_libraries(
1616
add_executable(
1717
codegen_test
1818
main.cpp
19-
codebuilder_test.cpp
2019
codegentestutils.cpp
2120
codegentestutils.h
2221
instructionlist_test.cpp
2322
code_analyzer/variable_type_analysis.cpp
2423
code_analyzer/list_type_analysis.cpp
2524
code_analyzer/mixed_type_analysis.cpp
26-
operators/equal_comparison_test.cpp
27-
operators/greater_than_test.cpp
28-
operators/less_than_test.cpp
29-
operators/math/add_test.cpp
30-
operators/math/subtract_test.cpp
31-
operators/math/multiply_test.cpp
32-
operators/math/divide_test.cpp
33-
operators/math/random_test.cpp
34-
operators/math/random_int_test.cpp
35-
operators/math/mod_test.cpp
36-
operators/math/abs_test.cpp
37-
operators/math/round_test.cpp
38-
operators/math/floor_test.cpp
39-
operators/math/ceil_test.cpp
40-
operators/math/sqrt_test.cpp
41-
operators/math/sin_test.cpp
42-
operators/math/cos_test.cpp
43-
operators/math/tan_test.cpp
44-
operators/math/asin_test.cpp
45-
operators/math/acos_test.cpp
46-
operators/math/atan_test.cpp
47-
operators/math/ln_test.cpp
48-
operators/math/log10_test.cpp
49-
operators/math/exp_test.cpp
50-
operators/math/exp10_test.cpp
51-
operators/logic/and_test.cpp
52-
operators/logic/or_test.cpp
53-
operators/logic/not_test.cpp
54-
operators/string/string_equal_case_sensitive_test.cpp
55-
operators/string/string_equal_case_insensitive_test.cpp
56-
operators/string/string_concat_test.cpp
57-
operators/string/string_char_test.cpp
58-
operators/string/string_length_test.cpp
5925
)
6026

27+
if (NOT LIBSCRATCHCPP_CODEGEN_BACKEND STREQUAL "cpp")
28+
# TODO: Move this to the executable sources
29+
target_sources(codegen_test PUBLIC
30+
codebuilder_test.cpp
31+
operators/equal_comparison_test.cpp
32+
operators/greater_than_test.cpp
33+
operators/less_than_test.cpp
34+
operators/math/add_test.cpp
35+
operators/math/subtract_test.cpp
36+
operators/math/multiply_test.cpp
37+
operators/math/divide_test.cpp
38+
operators/math/random_test.cpp
39+
operators/math/random_int_test.cpp
40+
operators/math/mod_test.cpp
41+
operators/math/abs_test.cpp
42+
operators/math/round_test.cpp
43+
operators/math/floor_test.cpp
44+
operators/math/ceil_test.cpp
45+
operators/math/sqrt_test.cpp
46+
operators/math/sin_test.cpp
47+
operators/math/cos_test.cpp
48+
operators/math/tan_test.cpp
49+
operators/math/asin_test.cpp
50+
operators/math/acos_test.cpp
51+
operators/math/atan_test.cpp
52+
operators/math/ln_test.cpp
53+
operators/math/log10_test.cpp
54+
operators/math/exp_test.cpp
55+
operators/math/exp10_test.cpp
56+
operators/logic/and_test.cpp
57+
operators/logic/or_test.cpp
58+
operators/logic/not_test.cpp
59+
operators/string/string_equal_case_sensitive_test.cpp
60+
operators/string/string_equal_case_insensitive_test.cpp
61+
operators/string/string_concat_test.cpp
62+
operators/string/string_char_test.cpp
63+
operators/string/string_length_test.cpp
64+
)
65+
endif()
66+
6167
target_link_libraries(
6268
codegen_test
6369
GTest::gtest_main
@@ -68,3 +74,9 @@ target_link_libraries(
6874
)
6975

7076
gtest_discover_tests(codegen_test)
77+
78+
if (LIBSCRATCHCPP_CODEGEN_BACKEND STREQUAL "llvm")
79+
add_subdirectory(llvm)
80+
elseif (LIBSCRATCHCPP_CODEGEN_BACKEND STREQUAL "cpp")
81+
add_subdirectory(cpp)
82+
endif()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)