Skip to content

Commit 500fd4d

Browse files
authored
Merge pull request #696 from scratchcpp/generalize_codebuilder_tests
Generalize CodeBuilder tests
2 parents 0641df3 + 8e519d1 commit 500fd4d

77 files changed

Lines changed: 12568 additions & 12225 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎src/engine/internal/codebuilderfactory.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
#pragma once
44

55
#include "icodebuilderfactory.h"
6+
#include "test_export.h"
67

78
namespace libscratchcpp
89
{
910

10-
class CodeBuilderFactory : public ICodeBuilderFactory
11+
class LIBSCRATCHCPP_TEST_EXPORT CodeBuilderFactory : public ICodeBuilderFactory
1112
{
1213
public:
1314
static std::shared_ptr<CodeBuilderFactory> instance();

‎test/CMakeLists.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ add_subdirectory(scratchconfiguration)
2626
add_subdirectory(assets)
2727
add_subdirectory(script)
2828
add_subdirectory(extensions)
29+
add_subdirectory(codegen)
2930
add_subdirectory(engine)
3031
add_subdirectory(clock)
3132
add_subdirectory(timer)

‎test/codegen/CMakeLists.txt‎

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
add_library(
2+
codegen_test_functions SHARED
3+
testfunctions.cpp
4+
testfunctions.h
5+
testmock.h
6+
)
7+
8+
target_link_libraries(
9+
codegen_test_functions
10+
GTest::gtest_main
11+
GTest::gmock_main
12+
scratchcpp
13+
scratchcpp_mocks
14+
)
15+
16+
add_executable(
17+
codegen_test
18+
main.cpp
19+
codebuilder_test.cpp
20+
codegentestutils.cpp
21+
codegentestutils.h
22+
operators/equal_comparison_test.cpp
23+
operators/greater_than_test.cpp
24+
operators/less_than_test.cpp
25+
operators/math/add_test.cpp
26+
operators/math/subtract_test.cpp
27+
operators/math/multiply_test.cpp
28+
operators/math/divide_test.cpp
29+
operators/math/random_test.cpp
30+
operators/math/random_int_test.cpp
31+
operators/math/mod_test.cpp
32+
operators/math/abs_test.cpp
33+
operators/math/round_test.cpp
34+
operators/math/floor_test.cpp
35+
operators/math/ceil_test.cpp
36+
operators/math/sqrt_test.cpp
37+
operators/math/sin_test.cpp
38+
operators/math/cos_test.cpp
39+
operators/math/tan_test.cpp
40+
operators/math/asin_test.cpp
41+
operators/math/acos_test.cpp
42+
operators/math/atan_test.cpp
43+
operators/math/ln_test.cpp
44+
operators/math/log10_test.cpp
45+
operators/math/exp_test.cpp
46+
operators/math/exp10_test.cpp
47+
operators/logic/and_test.cpp
48+
operators/logic/or_test.cpp
49+
operators/logic/not_test.cpp
50+
operators/string/string_equal_case_sensitive_test.cpp
51+
operators/string/string_equal_case_insensitive_test.cpp
52+
operators/string/string_concat_test.cpp
53+
operators/string/string_char_test.cpp
54+
operators/string/string_length_test.cpp
55+
)
56+
57+
target_link_libraries(
58+
codegen_test
59+
GTest::gtest_main
60+
GTest::gmock_main
61+
scratchcpp
62+
scratchcpp_mocks
63+
codegen_test_functions
64+
)
65+
66+
gtest_discover_tests(codegen_test)

0 commit comments

Comments
 (0)