From e2887eb075d810d57e802f76c75006d62c3e02cb Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Mon, 13 Jan 2014 22:50:30 -0800 Subject: [PATCH] make check working, 1 test app per library --- CMakeLists.txt | 1 + Sources/Tests/CMakeLists.txt | 4 ++-- Sources/Tests/CoreLibTests/CMakeLists.txt | 16 -------------- Sources/Tests/CoreTests/CMakeLists.txt | 15 +++++++++++++ .../test_plString.cpp} | 0 .../FeatureTests/pfPythonTest/CMakeLists.txt | 19 ++++++++++------- .../pnEncryptionTest/CMakeLists.txt | 21 +++++++++---------- .../plUnifiedTimeTest/CMakeLists.txt | 8 ++++++- 8 files changed, 47 insertions(+), 37 deletions(-) delete mode 100644 Sources/Tests/CoreLibTests/CMakeLists.txt create mode 100644 Sources/Tests/CoreTests/CMakeLists.txt rename Sources/Tests/{CoreLibTests/PlStringTest.cpp => CoreTests/test_plString.cpp} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index fcb1f744..2921a525 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -135,5 +135,6 @@ add_subdirectory(Sources/Tools) if(PLASMA_BUILD_TESTS) enable_testing() + add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) add_subdirectory(Sources/Tests EXCLUDE_FROM_ALL) endif(PLASMA_BUILD_TESTS) diff --git a/Sources/Tests/CMakeLists.txt b/Sources/Tests/CMakeLists.txt index a8d7d2f6..39c23e73 100644 --- a/Sources/Tests/CMakeLists.txt +++ b/Sources/Tests/CMakeLists.txt @@ -4,7 +4,7 @@ endif() add_subdirectory(gtest-1.6.0) -add_subdirectory(CoreLibTests) -add_subdirectory(FeatureTests) +add_subdirectory(CoreTests) add_subdirectory(NucleusTests) add_subdirectory(PubUtilTests) +add_subdirectory(FeatureTests) diff --git a/Sources/Tests/CoreLibTests/CMakeLists.txt b/Sources/Tests/CoreLibTests/CMakeLists.txt deleted file mode 100644 index c4c92b2d..00000000 --- a/Sources/Tests/CoreLibTests/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -project(CoreLibTests) - -include_directories(${GTEST_INCLUDE_DIR}) -include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) -include_directories(../../Plasma/CoreLib) -SET(TEST_PLSTRING -PlStringTest.cpp) - -add_executable(plStringTest ${TEST_PLSTRING}) - -target_link_libraries(plStringTest gtest gtest_main CoreLib) - -add_test( -NAME plStringTest -COMMAND plStringTest -) diff --git a/Sources/Tests/CoreTests/CMakeLists.txt b/Sources/Tests/CoreTests/CMakeLists.txt new file mode 100644 index 00000000..3f58acdd --- /dev/null +++ b/Sources/Tests/CoreTests/CMakeLists.txt @@ -0,0 +1,15 @@ +include_directories(${GTEST_INCLUDE_DIR}) +include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) +include_directories(../../Plasma/CoreLib) + +SET(CoreLibTest_SOURCES + test_plString.cpp + ) + +add_executable(test_CoreLib ${CoreLibTest_SOURCES}) + +target_link_libraries(test_CoreLib gtest gtest_main) +target_link_libraries(test_CoreLib CoreLib) + +add_test(NAME test_CoreLib COMMAND test_CoreLib) +add_dependencies(check test_CoreLib) diff --git a/Sources/Tests/CoreLibTests/PlStringTest.cpp b/Sources/Tests/CoreTests/test_plString.cpp similarity index 100% rename from Sources/Tests/CoreLibTests/PlStringTest.cpp rename to Sources/Tests/CoreTests/test_plString.cpp diff --git a/Sources/Tests/FeatureTests/pfPythonTest/CMakeLists.txt b/Sources/Tests/FeatureTests/pfPythonTest/CMakeLists.txt index f05bc03e..817cf540 100644 --- a/Sources/Tests/FeatureTests/pfPythonTest/CMakeLists.txt +++ b/Sources/Tests/FeatureTests/pfPythonTest/CMakeLists.txt @@ -5,15 +5,20 @@ include_directories(../../../Plasma/NucleusLib) include_directories(../../../Plasma/PubUtilLib) include_directories(../../../Plasma/FeatureLib) -add_executable(test_cyMisc test_cyMisc.cpp) -target_link_libraries(test_cyMisc gtest gtest_main) -target_link_libraries(test_cyMisc pfPython) +set(pfPythonTest_SOURCES + test_cyMisc.cpp + ) + +add_executable(test_pfPython ${pfPythonTest_SOURCES}) +target_link_libraries(test_pfPython gtest gtest_main) +target_link_libraries(test_pfPython pfPython) if(PYTHON_DEBUG_LIBRARY) - target_link_libraries(test_cyMisc debug ${PYTHON_DEBUG_LIBRARY}) - target_link_libraries(test_cyMisc optimized ${PYTHON_LIBRARY}) + target_link_libraries(test_pfPython debug ${PYTHON_DEBUG_LIBRARY}) + target_link_libraries(test_pfPython optimized ${PYTHON_LIBRARY}) else() - target_link_libraries(test_cyMisc ${PYTHON_LIBRARY}) + target_link_libraries(test_pfPython ${PYTHON_LIBRARY}) endif() -add_test(NAME test_cyMisc COMMAND test_cyMisc) +add_test(NAME test_pfPython COMMAND test_pfPython) +add_dependencies(check test_pfPython) diff --git a/Sources/Tests/NucleusTests/pnEncryptionTest/CMakeLists.txt b/Sources/Tests/NucleusTests/pnEncryptionTest/CMakeLists.txt index faa48c64..a838c933 100644 --- a/Sources/Tests/NucleusTests/pnEncryptionTest/CMakeLists.txt +++ b/Sources/Tests/NucleusTests/pnEncryptionTest/CMakeLists.txt @@ -2,16 +2,15 @@ include_directories(${GTEST_INCLUDE_DIR}) include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) include_directories(../../../Plasma/CoreLib) include_directories(../../../Plasma/NucleusLib) -include_directories(${OPENSSL_INCLUDE_DIR}) -add_executable(test_plMD5Checksum test_plMD5Checksum.cpp) -target_link_libraries(test_plMD5Checksum gtest gtest_main) -target_link_libraries(test_plMD5Checksum ${OPENSSL_LIBRARIES}) -target_link_libraries(test_plMD5Checksum CoreLib pnEncryption) -add_test(NAME test_plMD5Checksum COMMAND test_plMD5Checksum) +set(pnEncryptionTest_SOURCES + test_plMD5Checksum.cpp + test_plSHA1Checksum.cpp + ) -add_executable(test_plSHA1Checksum test_plSHA1Checksum.cpp) -target_link_libraries(test_plSHA1Checksum gtest gtest_main) -target_link_libraries(test_plSHA1Checksum ${OPENSSL_LIBRARIES}) -target_link_libraries(test_plSHA1Checksum CoreLib pnEncryption) -add_test(NAME test_plSHA1Checksum COMMAND test_plSHA1Checksum) +add_executable(test_pnEncryption ${pnEncryptionTest_SOURCES}) +target_link_libraries(test_pnEncryption gtest gtest_main) +target_link_libraries(test_pnEncryption pnEncryption) + +add_test(NAME test_pnEncryption COMMAND test_pnEncryption) +add_dependencies(check test_pnEncryption) diff --git a/Sources/Tests/PubUtilTests/plUnifiedTimeTest/CMakeLists.txt b/Sources/Tests/PubUtilTests/plUnifiedTimeTest/CMakeLists.txt index dd8c453b..b7f0c4e6 100644 --- a/Sources/Tests/PubUtilTests/plUnifiedTimeTest/CMakeLists.txt +++ b/Sources/Tests/PubUtilTests/plUnifiedTimeTest/CMakeLists.txt @@ -4,7 +4,13 @@ include_directories(../../../Plasma/CoreLib) include_directories(../../../Plasma/NucleusLib) include_directories(../../../Plasma/PubUtilLib) -add_executable(test_plUnifiedTime test_plUnifiedTime.cpp) +set(plUnifiedTimeTest_SOURCES + test_plUnifiedTime.cpp + ) + +add_executable(test_plUnifiedTime ${plUnifiedTimeTest_SOURCES}) target_link_libraries(test_plUnifiedTime gtest gtest_main) target_link_libraries(test_plUnifiedTime plUnifiedTime) + add_test(NAME test_plUnifiedTime COMMAND test_plUnifiedTime) +add_dependencies(check test_plUnifiedTime)