From 9c78ef57841503eca0c7a798fcb36529cc84f438 Mon Sep 17 00:00:00 2001 From: John Beard Date: Tue, 25 Sep 2018 12:11:10 +0100 Subject: [PATCH] QA: Make a generic common test suite * Renames /qa/common to /qa/qa_utils, as it is not to do with /common * Renames /qa/geometry to /qa/common * Put existing geometry tests into a subdirectory of /qa/common, to echo the layout of the main tree. The intention is to provide a place to put tests of other libcommon code in the /qa/common suite. --- qa/CMakeLists.txt | 2 +- qa/{geometry => common}/CMakeLists.txt | 10 +++++----- qa/{ => common}/geometry/geom_test_utils.h | 0 qa/{ => common}/geometry/test_fillet.cpp | 2 +- qa/{geometry => common}/test_module.cpp | 2 +- qa/pcb_test_window/CMakeLists.txt | 6 +++--- qa/polygon_generator/CMakeLists.txt | 2 +- qa/polygon_triangulation/CMakeLists.txt | 2 +- qa/{common => qa_utils}/mocks.cpp | 0 qa/{common => qa_utils}/pcb_test_frame.cpp | 0 qa/{common => qa_utils}/pcb_test_frame.h | 0 11 files changed, 13 insertions(+), 13 deletions(-) rename qa/{geometry => common}/CMakeLists.txt (91%) rename qa/{ => common}/geometry/geom_test_utils.h (100%) rename qa/{ => common}/geometry/test_fillet.cpp (99%) rename qa/{geometry => common}/test_module.cpp (95%) rename qa/{common => qa_utils}/mocks.cpp (100%) rename qa/{common => qa_utils}/pcb_test_frame.cpp (100%) rename qa/{common => qa_utils}/pcb_test_frame.h (100%) diff --git a/qa/CMakeLists.txt b/qa/CMakeLists.txt index e82afcd73c..a932b87541 100644 --- a/qa/CMakeLists.txt +++ b/qa/CMakeLists.txt @@ -12,7 +12,7 @@ if( KICAD_SCRIPTING_MODULES ) endif() -add_subdirectory( geometry ) +add_subdirectory( common ) add_subdirectory( shape_poly_set_refactor ) add_subdirectory( pcb_test_window ) add_subdirectory( polygon_triangulation ) diff --git a/qa/geometry/CMakeLists.txt b/qa/common/CMakeLists.txt similarity index 91% rename from qa/geometry/CMakeLists.txt rename to qa/common/CMakeLists.txt index 031c02b3a7..293532c18b 100644 --- a/qa/geometry/CMakeLists.txt +++ b/qa/common/CMakeLists.txt @@ -25,9 +25,9 @@ find_package( wxWidgets 3.0.0 COMPONENTS gl aui adv html core net base xml stc R add_definitions(-DBOOST_TEST_DYN_LINK) -add_executable( qa_geometry +add_executable( qa_common test_module.cpp - test_fillet.cpp + geometry/test_fillet.cpp ) include_directories( @@ -37,13 +37,13 @@ include_directories( ${Boost_INCLUDE_DIR} ) -target_link_libraries( qa_geometry +target_link_libraries( qa_common common polygon ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${wxWidgets_LIBRARIES} ) -add_test( NAME geometry - COMMAND qa_geometry +add_test( NAME common + COMMAND qa_common ) \ No newline at end of file diff --git a/qa/geometry/geom_test_utils.h b/qa/common/geometry/geom_test_utils.h similarity index 100% rename from qa/geometry/geom_test_utils.h rename to qa/common/geometry/geom_test_utils.h diff --git a/qa/geometry/test_fillet.cpp b/qa/common/geometry/test_fillet.cpp similarity index 99% rename from qa/geometry/test_fillet.cpp rename to qa/common/geometry/test_fillet.cpp index c7d758ec6e..119db6b198 100644 --- a/qa/geometry/test_fillet.cpp +++ b/qa/common/geometry/test_fillet.cpp @@ -29,7 +29,7 @@ #include -#include +#include "geom_test_utils.h" struct FilletFixture { diff --git a/qa/geometry/test_module.cpp b/qa/common/test_module.cpp similarity index 95% rename from qa/geometry/test_module.cpp rename to qa/common/test_module.cpp index 6fb45de1fd..38f18fd035 100644 --- a/qa/geometry/test_module.cpp +++ b/qa/common/test_module.cpp @@ -26,7 +26,7 @@ */ #define BOOST_TEST_MAIN -#define BOOST_TEST_MODULE "Geometry module tests" +#define BOOST_TEST_MODULE "Common library module tests" #include diff --git a/qa/pcb_test_window/CMakeLists.txt b/qa/pcb_test_window/CMakeLists.txt index 3bcc664dc4..af9f01f81e 100644 --- a/qa/pcb_test_window/CMakeLists.txt +++ b/qa/pcb_test_window/CMakeLists.txt @@ -35,8 +35,8 @@ add_dependencies( pnsrouter pcbcommon pcad2kicadpcb ${GITHUB_PLUGIN_LIBRARIES} ) add_executable(test_window WIN32 test.cpp - ../common/pcb_test_frame.cpp - ../common/mocks.cpp + ../qa_utils/pcb_test_frame.cpp + ../qa_utils/mocks.cpp ../../common/base_units.cpp ../../pcbnew/tools/pcb_tool.cpp ../../pcbnew/tools/selection.cpp @@ -57,7 +57,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/pcbnew/dialogs ${CMAKE_SOURCE_DIR}/polygon ${CMAKE_SOURCE_DIR}/common/geometry - ${CMAKE_SOURCE_DIR}/qa/common + ${CMAKE_SOURCE_DIR}/qa/qa_utils ${Boost_INCLUDE_DIR} ${INC_AFTER} ) diff --git a/qa/polygon_generator/CMakeLists.txt b/qa/polygon_generator/CMakeLists.txt index 6c600f5227..ba79297fbf 100644 --- a/qa/polygon_generator/CMakeLists.txt +++ b/qa/polygon_generator/CMakeLists.txt @@ -33,7 +33,7 @@ endif() add_dependencies( pnsrouter pcbcommon pcad2kicadpcb ${GITHUB_PLUGIN_LIBRARIES} ) add_executable(test_polygon_generator - ../common/mocks.cpp + ../qa_utils/mocks.cpp ../../common/base_units.cpp test_polygon_generator.cpp ) diff --git a/qa/polygon_triangulation/CMakeLists.txt b/qa/polygon_triangulation/CMakeLists.txt index c611e73d96..2281206916 100644 --- a/qa/polygon_triangulation/CMakeLists.txt +++ b/qa/polygon_triangulation/CMakeLists.txt @@ -33,7 +33,7 @@ endif() add_dependencies( pnsrouter pcbcommon pcad2kicadpcb ${GITHUB_PLUGIN_LIBRARIES} ) add_executable(test_polygon_triangulation - ../common/mocks.cpp + ../qa_utils/mocks.cpp ../../common/base_units.cpp test_polygon_triangulation.cpp ) diff --git a/qa/common/mocks.cpp b/qa/qa_utils/mocks.cpp similarity index 100% rename from qa/common/mocks.cpp rename to qa/qa_utils/mocks.cpp diff --git a/qa/common/pcb_test_frame.cpp b/qa/qa_utils/pcb_test_frame.cpp similarity index 100% rename from qa/common/pcb_test_frame.cpp rename to qa/qa_utils/pcb_test_frame.cpp diff --git a/qa/common/pcb_test_frame.h b/qa/qa_utils/pcb_test_frame.h similarity index 100% rename from qa/common/pcb_test_frame.h rename to qa/qa_utils/pcb_test_frame.h