Skip to content

Commit c2f6216

Browse files
committed
Fix tests after lifting unit test framework
1 parent c0250d7 commit c2f6216

6 files changed

+27
-71
lines changed

CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.22)
33

44
project(MatGui)
55

6+
enable_testing()
7+
68
add_library(MatGui SHARED matgui.cpp)
79

810
add_subdirectory(lib/sdlpp)

Makefile

-20
This file was deleted.

tests/CMakeLists.txt

+23-14
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,30 @@ cmake_minimum_required(VERSION 3.22)
33

44
enable_testing()
55

6-
function(test testname)
7-
add_executable(${testname}-test ${testname}-test.cpp)
86

9-
target_include_directories(${testname}-test PRIVATE tests)
7+
add_executable(
8+
matgui-tests
9+
font-test.cpp
10+
shadertranslate-test.cpp
11+
signal-test.cpp
12+
mls-unit-test/test_main.cpp
13+
)
1014

11-
target_link_libraries(${testname}-test
12-
MatGui
13-
SDL2_image
14-
)
15+
target_include_directories(
16+
matgui-tests
17+
PRIVATE
18+
tests
19+
)
20+
21+
add_test(
22+
NAME matgui-tests
23+
COMMAND matgui-tests
24+
)
25+
26+
target_link_libraries(
27+
matgui-tests
28+
MatGui
29+
SDL2_image
30+
)
1531

16-
add_test(NAME ${testname}-test
17-
COMMAND ${testname}-test
18-
)
19-
endfunction()
2032

21-
test(font)
22-
test(shadertranslate)
23-
test(signal)

tests/Makefile

-35
This file was deleted.

tests/font-test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ BitmapFontData bepData("xx\nxx\n");
1919

2020
} // namespace
2121

22-
TEST_SUIT_BEGIN
22+
TEST_SUIT_BEGIN(MatguiFont)
2323

2424
TEST_CASE("concat chars") {
2525
auto a = getFontDataVector("a");

tests/shadertranslate-test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ string lastLine(string code) {
2525
}
2626
} // namespace
2727

28-
TEST_SUIT_BEGIN
28+
TEST_SUIT_BEGIN(MatguiShaderTranslate)
2929

3030
TEST_CASE("frag color/out") {
3131
constexpr auto code = //

0 commit comments

Comments
 (0)