Skip to content

Commit b3add22

Browse files
committed
cmake: Move tests and CMakefiles to tests/
1 parent 7f1bd0f commit b3add22

7 files changed

+21
-21
lines changed

CMakeLists.txt

+2-21
Original file line numberDiff line numberDiff line change
@@ -475,25 +475,6 @@ if(CMAKE_CROSSCOMPILING)
475475
endif()
476476

477477
if(NOT CMAKE_CROSSCOMPILING)
478-
# do not build the firmware by default (tests are the focus if not crosscompiling)
479-
project(cmake_test)
480-
481-
# include catch_discover_tests function from Catch2
482-
include(${Catch2_SOURCE_DIR}/contrib/Catch.cmake)
483-
484-
# Make test executable
485-
set(TEST_SOURCES
486-
Tests/tests.cpp
487-
Tests/Example_test.cpp
488-
Tests/PrusaStatistics_test.cpp
489-
# Tests/Timer_test.cpp
490-
# Firmware/Timer.cpp
491-
)
492-
add_executable(tests ${TEST_SOURCES})
493-
target_include_directories(tests PRIVATE Tests)
494-
target_link_libraries(tests Catch2::Catch2)
495-
496-
enable_testing()
497-
catch_discover_tests(tests)
498-
478+
enable_testing()
479+
add_subdirectory(tests)
499480
endif()

Tests/Arduino.h tests/Arduino.h

File renamed without changes.

tests/CMakeLists.txt

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# do not build the firmware by default (tests are the focus if not crosscompiling)
2+
project(cmake_test)
3+
4+
# include catch_discover_tests function from Catch2
5+
include(${Catch2_SOURCE_DIR}/contrib/Catch.cmake)
6+
7+
# Make test executable
8+
set(TEST_SOURCES
9+
tests.cpp
10+
Example_test.cpp
11+
PrusaStatistics_test.cpp
12+
#Tests/Timer_test.cpp
13+
#Firmware/Timer.cpp
14+
)
15+
16+
add_executable(tests ${TEST_SOURCES})
17+
target_include_directories(tests PRIVATE Tests)
18+
target_link_libraries(tests Catch2::Catch2)
19+
catch_discover_tests(tests)
File renamed without changes.
File renamed without changes.
File renamed without changes.

Tests/tests.cpp tests/tests.cpp

File renamed without changes.

0 commit comments

Comments
 (0)