浏览代码

cmake: Move tests and CMakefiles to tests/

Yuri D'Elia 1 年之前
父节点
当前提交
b3add22885
共有 7 个文件被更改,包括 21 次插入21 次删除
  1. 2 21
      CMakeLists.txt
  2. 0 0
      tests/Arduino.h
  3. 19 0
      tests/CMakeLists.txt
  4. 0 0
      tests/Example_test.cpp
  5. 0 0
      tests/PrusaStatistics_test.cpp
  6. 0 0
      tests/Timer_test.cpp
  7. 0 0
      tests/tests.cpp

+ 2 - 21
CMakeLists.txt

@@ -475,25 +475,6 @@ if(CMAKE_CROSSCOMPILING)
 endif()
 
 if(NOT CMAKE_CROSSCOMPILING)
-	# do not build the firmware by default (tests are the focus if not crosscompiling)
-	project(cmake_test)
-
-	# include catch_discover_tests function from Catch2
-	include(${Catch2_SOURCE_DIR}/contrib/Catch.cmake)
-
-	# Make test executable
-	set(TEST_SOURCES
-		Tests/tests.cpp
-		Tests/Example_test.cpp
-		Tests/PrusaStatistics_test.cpp
-#		Tests/Timer_test.cpp
-#		Firmware/Timer.cpp
-	)
-	add_executable(tests ${TEST_SOURCES})
-	target_include_directories(tests PRIVATE Tests)
-	target_link_libraries(tests Catch2::Catch2)
-
-	enable_testing()
-	catch_discover_tests(tests)
-
+    enable_testing()
+    add_subdirectory(tests)
 endif()

Tests/Arduino.h → tests/Arduino.h


+ 19 - 0
tests/CMakeLists.txt

@@ -0,0 +1,19 @@
+# do not build the firmware by default (tests are the focus if not crosscompiling)
+project(cmake_test)
+
+# include catch_discover_tests function from Catch2
+include(${Catch2_SOURCE_DIR}/contrib/Catch.cmake)
+
+# Make test executable
+set(TEST_SOURCES
+	tests.cpp
+	Example_test.cpp
+	PrusaStatistics_test.cpp
+    #Tests/Timer_test.cpp
+    #Firmware/Timer.cpp
+	)
+
+add_executable(tests ${TEST_SOURCES})
+target_include_directories(tests PRIVATE Tests)
+target_link_libraries(tests Catch2::Catch2)
+catch_discover_tests(tests)

Tests/Example_test.cpp → tests/Example_test.cpp


Tests/PrusaStatistics_test.cpp → tests/PrusaStatistics_test.cpp


Tests/Timer_test.cpp → tests/Timer_test.cpp


Tests/tests.cpp → tests/tests.cpp