diff --git a/Code/Geometry/catch_tests.cpp b/Code/Geometry/catch_tests.cpp index 0986a3c65..14203c821 100644 --- a/Code/Geometry/catch_tests.cpp +++ b/Code/Geometry/catch_tests.cpp @@ -7,8 +7,6 @@ // which is included in the file license.txt, found at the root // of the RDKit source tree. // -#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do - // this in one cpp file #include "catch.hpp" #include #include diff --git a/Code/GraphMol/Abbreviations/CMakeLists.txt b/Code/GraphMol/Abbreviations/CMakeLists.txt index c9c67e2d0..a9a437e2c 100644 --- a/Code/GraphMol/Abbreviations/CMakeLists.txt +++ b/Code/GraphMol/Abbreviations/CMakeLists.txt @@ -7,7 +7,7 @@ target_compile_definitions(Abbreviations PRIVATE RDKIT_ABBREVIATIONS_BUILD) rdkit_headers(Abbreviations.h DEST GraphMol/Abbreviations) -rdkit_catch_test(testAbbreviations ../catch_main.cpp catch_tests.cpp +rdkit_catch_test(testAbbreviations catch_tests.cpp LINK_LIBRARIES Abbreviations SmilesParse FileParsers ) if(RDK_BUILD_PYTHON_WRAPPERS) diff --git a/Code/GraphMol/CIPLabeler/CMakeLists.txt b/Code/GraphMol/CIPLabeler/CMakeLists.txt index 8959a2b5e..025fd441c 100644 --- a/Code/GraphMol/CIPLabeler/CMakeLists.txt +++ b/Code/GraphMol/CIPLabeler/CMakeLists.txt @@ -28,7 +28,7 @@ rdkit_headers(CIPLabeler.h TooManyNodesException.h DEST CIPLabeler) -rdkit_catch_test(testCIPLabeler catch_tests.cpp ../catch_main.cpp +rdkit_catch_test(testCIPLabeler catch_tests.cpp CIPMol.cpp CIPLabeler.cpp Mancude.cpp Digraph.cpp Node.cpp Edge.cpp Sort.cpp ${configs_src} ${rules_src} diff --git a/Code/GraphMol/CMakeLists.txt b/Code/GraphMol/CMakeLists.txt index cf1422520..bf8d20a9d 100644 --- a/Code/GraphMol/CMakeLists.txt +++ b/Code/GraphMol/CMakeLists.txt @@ -161,17 +161,17 @@ rdkit_test(testSGroup testSGroup.cpp LINK_LIBRARIES FileParsers GraphMol) rdkit_test(test-valgrind test-valgrind.cpp LINK_LIBRARIES SmilesParse GraphMol ) -rdkit_catch_test(graphmolTestsCatch catch_graphmol.cpp catch_main.cpp +rdkit_catch_test(graphmolTestsCatch catch_graphmol.cpp LINK_LIBRARIES SubstructMatch FileParsers SmilesParse GraphMol ) -rdkit_catch_test(graphmolSGroupCatch catch_sgroups.cpp catch_main.cpp +rdkit_catch_test(graphmolSGroupCatch catch_sgroups.cpp LINK_LIBRARIES SmilesParse FileParsers GraphMol ) -rdkit_catch_test(graphmolAdjustQueryCatch catch_adjustquery.cpp catch_main.cpp +rdkit_catch_test(graphmolAdjustQueryCatch catch_adjustquery.cpp LINK_LIBRARIES SubstructMatch FileParsers SmilesParse GraphMol ) -rdkit_catch_test(chiralityTestsCatch catch_chirality.cpp catch_main.cpp +rdkit_catch_test(chiralityTestsCatch catch_chirality.cpp LINK_LIBRARIES FileParsers SmilesParse GraphMol ) -rdkit_catch_test(moliteratorTestsCatch catch_moliterators.cpp catch_main.cpp +rdkit_catch_test(moliteratorTestsCatch catch_moliterators.cpp LINK_LIBRARIES SubstructMatch SmilesParse GraphMol ) diff --git a/Code/GraphMol/ChemReactions/CMakeLists.txt b/Code/GraphMol/ChemReactions/CMakeLists.txt index 05f18ba2f..00ba0e8f3 100644 --- a/Code/GraphMol/ChemReactions/CMakeLists.txt +++ b/Code/GraphMol/ChemReactions/CMakeLists.txt @@ -53,7 +53,7 @@ ChemReactions ) rdkit_test(testEnumeration Enumerate/testEnumerate.cpp LINK_LIBRARIES ChemReactions ) -rdkit_catch_test(rxnTestCatch ../catch_main.cpp catch_tests.cpp LINK_LIBRARIES ChemReactions ) +rdkit_catch_test(rxnTestCatch catch_tests.cpp LINK_LIBRARIES ChemReactions ) if(RDK_BUILD_PYTHON_WRAPPERS) add_subdirectory(Wrap) diff --git a/Code/GraphMol/ChemTransforms/CMakeLists.txt b/Code/GraphMol/ChemTransforms/CMakeLists.txt index 91c2dc703..9025f982a 100644 --- a/Code/GraphMol/ChemTransforms/CMakeLists.txt +++ b/Code/GraphMol/ChemTransforms/CMakeLists.txt @@ -13,4 +13,4 @@ rdkit_headers(ChemTransforms.h rdkit_test(testChemTransforms testChemTransforms.cpp LINK_LIBRARIES ChemTransforms FileParsers) -rdkit_catch_test(chemTransformsTestCatch ../catch_main.cpp catch_tests.cpp LINK_LIBRARIES ChemTransforms FileParsers) +rdkit_catch_test(chemTransformsTestCatch catch_tests.cpp LINK_LIBRARIES ChemTransforms FileParsers) diff --git a/Code/GraphMol/Depictor/CMakeLists.txt b/Code/GraphMol/Depictor/CMakeLists.txt index cc3d9b06b..588e4eab8 100644 --- a/Code/GraphMol/Depictor/CMakeLists.txt +++ b/Code/GraphMol/Depictor/CMakeLists.txt @@ -30,7 +30,7 @@ set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${extra_clean_files};${TEST_OUTPUT_FILES}") -rdkit_catch_test(depictorCatch catch_tests.cpp ../catch_main.cpp LINK_LIBRARIES Depictor SmilesParse FileParsers ) +rdkit_catch_test(depictorCatch catch_tests.cpp LINK_LIBRARIES Depictor SmilesParse FileParsers ) if(RDK_BUILD_PYTHON_WRAPPERS) diff --git a/Code/GraphMol/Deprotect/deprotectTest.cpp b/Code/GraphMol/Deprotect/deprotectTest.cpp index d893e012a..34042f107 100644 --- a/Code/GraphMol/Deprotect/deprotectTest.cpp +++ b/Code/GraphMol/Deprotect/deprotectTest.cpp @@ -8,8 +8,6 @@ // which is included in the file license.txt, found at the root // of the RDKit source tree. // -#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do - // this in one cpp file #include "catch.hpp" #include diff --git a/Code/GraphMol/Descriptors/CMakeLists.txt b/Code/GraphMol/Descriptors/CMakeLists.txt index 7e304af62..f067ff019 100644 --- a/Code/GraphMol/Descriptors/CMakeLists.txt +++ b/Code/GraphMol/Descriptors/CMakeLists.txt @@ -65,7 +65,7 @@ LINK_LIBRARIES Descriptors ) LINK_LIBRARIES Descriptors ForceFieldHelpers DistGeomHelpers ) endif(RDK_BUILD_DESCRIPTORS3D) -rdkit_catch_test(descriptorsTestCatch ../catch_main.cpp catch_tests.cpp LINK_LIBRARIES Descriptors SmilesParse FileParsers) +rdkit_catch_test(descriptorsTestCatch catch_tests.cpp LINK_LIBRARIES Descriptors SmilesParse FileParsers) if(RDK_BUILD_PYTHON_WRAPPERS) add_subdirectory(Wrap) diff --git a/Code/GraphMol/DistGeomHelpers/CMakeLists.txt b/Code/GraphMol/DistGeomHelpers/CMakeLists.txt index d68f6ca90..4e04c7188 100644 --- a/Code/GraphMol/DistGeomHelpers/CMakeLists.txt +++ b/Code/GraphMol/DistGeomHelpers/CMakeLists.txt @@ -11,7 +11,7 @@ rdkit_test(testDistGeomHelpers testDgeomHelpers.cpp LINK_LIBRARIES DistGeomHelpers MolAlign MolTransforms FileParsers SmilesParse ) -rdkit_catch_test(distGeomHelpersCatch ../catch_main.cpp catch_tests.cpp +rdkit_catch_test(distGeomHelpersCatch catch_tests.cpp LINK_LIBRARIES DistGeomHelpers MolAlign MolTransforms FileParsers SmilesParse ) diff --git a/Code/GraphMol/FileParsers/CMakeLists.txt b/Code/GraphMol/FileParsers/CMakeLists.txt index 3565b4c32..fad8eb829 100644 --- a/Code/GraphMol/FileParsers/CMakeLists.txt +++ b/Code/GraphMol/FileParsers/CMakeLists.txt @@ -101,8 +101,8 @@ rdkit_test(testSequence testSequence.cpp LINK_LIBRARIES FileParsers ) rdkit_test(testExtendedStereoParsing testExtendedStereoParsing.cpp LINK_LIBRARIES FileParsers ) -rdkit_catch_test(fileParsersCatchTest file_parsers_catch.cpp catch_main.cpp +rdkit_catch_test(fileParsersCatchTest file_parsers_catch.cpp LINK_LIBRARIES FileParsers ) -rdkit_catch_test(testPropertyLists testPropertyLists.cpp catch_main.cpp +rdkit_catch_test(testPropertyLists testPropertyLists.cpp LINK_LIBRARIES FileParsers ) diff --git a/Code/GraphMol/FileParsers/catch_main.cpp b/Code/GraphMol/FileParsers/catch_main.cpp deleted file mode 100644 index d3b70902e..000000000 --- a/Code/GraphMol/FileParsers/catch_main.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// -// Copyright (C) 2020 Greg Landrum -// @@ All Rights Reserved @@ -// This file is part of the RDKit. -// The contents are covered by the terms of the BSD license -// which is included in the file license.txt, found at the root -// of the RDKit source tree. -// - -#define CATCH_CONFIG_RUNNER -#include "catch.hpp" -#include - -int main(int argc, char* argv[]) { - RDLog::InitLogs(); - - int result = Catch::Session().run(argc, argv); - - return result; -} \ No newline at end of file diff --git a/Code/GraphMol/Fingerprints/CMakeLists.txt b/Code/GraphMol/Fingerprints/CMakeLists.txt index ae7c08178..654c9a111 100644 --- a/Code/GraphMol/Fingerprints/CMakeLists.txt +++ b/Code/GraphMol/Fingerprints/CMakeLists.txt @@ -30,7 +30,7 @@ rdkit_test(testMHFPFingerprint testMHFPFingerprint.cpp LINK_LIBRARIES rdkit_test(testFingerprintGenerators testFingerprintGenerators.cpp LINK_LIBRARIES Fingerprints FileParsers ) -rdkit_catch_test(fpTestCatch ../catch_main.cpp catch_tests.cpp LINK_LIBRARIES Fingerprints FileParsers) +rdkit_catch_test(fpTestCatch catch_tests.cpp LINK_LIBRARIES Fingerprints FileParsers) if(RDK_BUILD_PYTHON_WRAPPERS) diff --git a/Code/GraphMol/GenericGroups/CMakeLists.txt b/Code/GraphMol/GenericGroups/CMakeLists.txt index f888a04fd..15ecc6af3 100644 --- a/Code/GraphMol/GenericGroups/CMakeLists.txt +++ b/Code/GraphMol/GenericGroups/CMakeLists.txt @@ -6,4 +6,5 @@ target_compile_definitions(GenericGroups PRIVATE RDKIT_GENERICGROUPS_BUILD) rdkit_headers(GenericGroups.h DEST GraphMol/GenericGroups) -rdkit_catch_test(testGenericGroups ../catch_main.cpp generic_tests.cpp LINK_LIBRARIES GenericGroups FileParsers SmilesParse SubstructMatch) +rdkit_catch_test(testGenericGroups generic_tests.cpp + LINK_LIBRARIES GenericGroups FileParsers SmilesParse SubstructMatch) diff --git a/Code/GraphMol/MolDraw2D/CMakeLists.txt b/Code/GraphMol/MolDraw2D/CMakeLists.txt index eb9f3413d..31a33280e 100644 --- a/Code/GraphMol/MolDraw2D/CMakeLists.txt +++ b/Code/GraphMol/MolDraw2D/CMakeLists.txt @@ -95,7 +95,7 @@ endif(RDK_BUILD_FREETYPE_SUPPORT) rdkit_test(moldraw2DTest1 test1.cpp LINK_LIBRARIES MolDraw2D ) -rdkit_catch_test(moldraw2DTestCatch ../catch_main.cpp catch_tests.cpp LINK_LIBRARIES +rdkit_catch_test(moldraw2DTestCatch catch_tests.cpp LINK_LIBRARIES MolDraw2D CIPLabeler ) rdkit_test(moldraw2DRxnTest1 rxn_test1.cpp LINK_LIBRARIES diff --git a/Code/GraphMol/MolEnumerator/CMakeLists.txt b/Code/GraphMol/MolEnumerator/CMakeLists.txt index 1f57ac5e5..972a385ed 100644 --- a/Code/GraphMol/MolEnumerator/CMakeLists.txt +++ b/Code/GraphMol/MolEnumerator/CMakeLists.txt @@ -6,7 +6,7 @@ target_compile_definitions(MolEnumerator PRIVATE RDKIT_MOLENUMERATOR_BUILD) rdkit_headers(MolEnumerator.h LinkNode.h DEST GraphMol/MolEnumerator) -rdkit_catch_test(testMolEnumerator ../catch_main.cpp enumerator_catch.cpp +rdkit_catch_test(testMolEnumerator enumerator_catch.cpp LINK_LIBRARIES MolEnumerator SmilesParse FileParsers ) if(RDK_BUILD_PYTHON_WRAPPERS) diff --git a/Code/GraphMol/MolHash/CMakeLists.txt b/Code/GraphMol/MolHash/CMakeLists.txt index 92b9db0f8..311b3eef9 100644 --- a/Code/GraphMol/MolHash/CMakeLists.txt +++ b/Code/GraphMol/MolHash/CMakeLists.txt @@ -7,7 +7,7 @@ target_compile_definitions(MolHash PRIVATE RDKIT_MOLHASH_BUILD) rdkit_headers(MolHash.h nmmolhash.h DEST GraphMol/MolHash) -rdkit_catch_test(molHashCatchTest ../catch_main.cpp catch_tests.cpp LINK_LIBRARIES MolHash) +rdkit_catch_test(molHashCatchTest catch_tests.cpp LINK_LIBRARIES MolHash) if(RDK_BUILD_PYTHON_WRAPPERS) add_subdirectory(Wrap) diff --git a/Code/GraphMol/MolInterchange/CMakeLists.txt b/Code/GraphMol/MolInterchange/CMakeLists.txt index 80274448c..1673386a4 100644 --- a/Code/GraphMol/MolInterchange/CMakeLists.txt +++ b/Code/GraphMol/MolInterchange/CMakeLists.txt @@ -24,7 +24,7 @@ rdkit_headers(MolInterchange.h details.h rdkit_test(molInterchangeTest1 test1.cpp LINK_LIBRARIES MolInterchange FileParsers SmilesParse) -rdkit_catch_test(molInterchangeCatchTest ../catch_main.cpp molinterchange_catch.cpp +rdkit_catch_test(molInterchangeCatchTest molinterchange_catch.cpp LINK_LIBRARIES MolInterchange FileParsers SmilesParse ) if(RDK_BUILD_PYTHON_WRAPPERS) diff --git a/Code/GraphMol/MolStandardize/CMakeLists.txt b/Code/GraphMol/MolStandardize/CMakeLists.txt index fd91bb3bc..58dfb33f8 100644 --- a/Code/GraphMol/MolStandardize/CMakeLists.txt +++ b/Code/GraphMol/MolStandardize/CMakeLists.txt @@ -62,6 +62,6 @@ rdkit_test(molChargeTest testCharge.cpp LINK_LIBRARIES MolStandardize ) rdkit_test(molTautomerTest testTautomer.cpp LINK_LIBRARIES MolStandardize ) rdkit_test(molStandardizeSmallTest test2.cpp LINK_LIBRARIES MolStandardize ) rdkit_test(molFragmentTest testFragment.cpp LINK_LIBRARIES MolStandardize ) -rdkit_catch_test(molStandardizeCatchTest ../catch_main.cpp catch_tests.cpp LINK_LIBRARIES MolStandardize ) +rdkit_catch_test(molStandardizeCatchTest catch_tests.cpp LINK_LIBRARIES MolStandardize ) diff --git a/Code/GraphMol/RGroupDecomposition/CMakeLists.txt b/Code/GraphMol/RGroupDecomposition/CMakeLists.txt index a3a6918d1..3947df037 100644 --- a/Code/GraphMol/RGroupDecomposition/CMakeLists.txt +++ b/Code/GraphMol/RGroupDecomposition/CMakeLists.txt @@ -21,7 +21,7 @@ rdkit_test(testRGroupDecomp testRGroupDecomp.cpp rdkit_test(testRGroupDecompInternals testRGroupInternals.cpp LINK_LIBRARIES RGroupDecomposition ) -rdkit_catch_test(rgroupCatchTests catch_rgd.cpp ../catch_main.cpp +rdkit_catch_test(rgroupCatchTests catch_rgd.cpp LINK_LIBRARIES RGroupDecomposition ) diff --git a/Code/GraphMol/ScaffoldNetwork/CMakeLists.txt b/Code/GraphMol/ScaffoldNetwork/CMakeLists.txt index d12a839c6..74c9fa082 100644 --- a/Code/GraphMol/ScaffoldNetwork/CMakeLists.txt +++ b/Code/GraphMol/ScaffoldNetwork/CMakeLists.txt @@ -6,7 +6,7 @@ target_compile_definitions(ScaffoldNetwork PRIVATE RDKIT_SCAFFOLDNETWORK_BUILD) rdkit_headers(ScaffoldNetwork.h DEST GraphMol/ScaffoldNetwork) -rdkit_catch_test(testScaffoldNetwork catch_main.cpp catch_tests.cpp +rdkit_catch_test(testScaffoldNetwork catch_tests.cpp LINK_LIBRARIES ScaffoldNetwork SmilesParse ) if(RDK_BUILD_PYTHON_WRAPPERS) diff --git a/Code/GraphMol/ScaffoldNetwork/catch_main.cpp b/Code/GraphMol/ScaffoldNetwork/catch_main.cpp deleted file mode 100644 index 50883cea3..000000000 --- a/Code/GraphMol/ScaffoldNetwork/catch_main.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// -// Copyright (C) 2019 Greg Landrum and T5 Informatics GmbH -// @@ All Rights Reserved @@ -// This file is part of the RDKit. -// The contents are covered by the terms of the BSD license -// which is included in the file license.txt, found at the root -// of the RDKit source tree. -// - -#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do - // this in one cpp file -#include "catch.hpp" diff --git a/Code/GraphMol/SmilesParse/CMakeLists.txt b/Code/GraphMol/SmilesParse/CMakeLists.txt index 34dc06dad..5ec23cecf 100644 --- a/Code/GraphMol/SmilesParse/CMakeLists.txt +++ b/Code/GraphMol/SmilesParse/CMakeLists.txt @@ -70,4 +70,4 @@ rdkit_test(smiTest2 test2.cpp LINK_LIBRARIES SmilesParse ) rdkit_test(cxsmilesTest cxsmiles_test.cpp LINK_LIBRARIES FileParsers SmilesParse ) rdkit_test(smaTest1 smatest.cpp LINK_LIBRARIES SmilesParse SubstructMatch ) -rdkit_catch_test(smiTestCatch ../catch_main.cpp catch_tests.cpp LINK_LIBRARIES FileParsers SmilesParse ) +rdkit_catch_test(smiTestCatch catch_tests.cpp LINK_LIBRARIES FileParsers SmilesParse ) diff --git a/Code/GraphMol/Substruct/CMakeLists.txt b/Code/GraphMol/Substruct/CMakeLists.txt index 0d4f5f414..7e870ccb3 100644 --- a/Code/GraphMol/Substruct/CMakeLists.txt +++ b/Code/GraphMol/Substruct/CMakeLists.txt @@ -9,4 +9,4 @@ rdkit_headers(SubstructMatch.h rdkit_test(testSubstructMatch test1.cpp LINK_LIBRARIES FileParsers SmilesParse SubstructMatch) -rdkit_catch_test(substructTestCatch ../catch_main.cpp catch_tests.cpp LINK_LIBRARIES FileParsers SmilesParse SubstructMatch) +rdkit_catch_test(substructTestCatch catch_tests.cpp LINK_LIBRARIES FileParsers SmilesParse SubstructMatch) diff --git a/Code/GraphMol/SubstructLibrary/CMakeLists.txt b/Code/GraphMol/SubstructLibrary/CMakeLists.txt index 3bfa3ed93..2b38ddeba 100644 --- a/Code/GraphMol/SubstructLibrary/CMakeLists.txt +++ b/Code/GraphMol/SubstructLibrary/CMakeLists.txt @@ -24,4 +24,4 @@ endif() rdkit_test(substructLibraryTest substructLibraryTest.cpp LINK_LIBRARIES TautomerQuery MolStandardize SubstructLibrary FileParsers ) -rdkit_catch_test(substructLibraryCatchTest ../catch_main.cpp catch_tests.cpp LINK_LIBRARIES SubstructLibrary FileParsers ) +rdkit_catch_test(substructLibraryCatchTest catch_tests.cpp LINK_LIBRARIES SubstructLibrary FileParsers ) diff --git a/Code/GraphMol/TautomerQuery/CMakeLists.txt b/Code/GraphMol/TautomerQuery/CMakeLists.txt index b198aba4c..5b827670c 100644 --- a/Code/GraphMol/TautomerQuery/CMakeLists.txt +++ b/Code/GraphMol/TautomerQuery/CMakeLists.txt @@ -17,4 +17,4 @@ if(RDK_BUILD_PYTHON_WRAPPERS) add_subdirectory(Wrap) endif() -rdkit_catch_test(tautomerQueryTestCatch catch_tests.cpp ../catch_main.cpp LINK_LIBRARIES TautomerQuery ) +rdkit_catch_test(tautomerQueryTestCatch catch_tests.cpp LINK_LIBRARIES TautomerQuery ) diff --git a/Code/GraphMol/catch_main.cpp b/Code/GraphMol/catch_main.cpp deleted file mode 100644 index d3b70902e..000000000 --- a/Code/GraphMol/catch_main.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// -// Copyright (C) 2020 Greg Landrum -// @@ All Rights Reserved @@ -// This file is part of the RDKit. -// The contents are covered by the terms of the BSD license -// which is included in the file license.txt, found at the root -// of the RDKit source tree. -// - -#define CATCH_CONFIG_RUNNER -#include "catch.hpp" -#include - -int main(int argc, char* argv[]) { - RDLog::InitLogs(); - - int result = Catch::Session().run(argc, argv); - - return result; -} \ No newline at end of file diff --git a/Code/Numerics/testConrec.cpp b/Code/Numerics/testConrec.cpp index 15a66c180..3270c0faf 100644 --- a/Code/Numerics/testConrec.cpp +++ b/Code/Numerics/testConrec.cpp @@ -7,13 +7,12 @@ // which is included in the file license.txt, found at the root // of the RDKit source tree. // -#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do - // this in one cpp file #include "catch.hpp" #include -#include "Conrec.h" #include +#include +#include "Conrec.h" #include #include #include diff --git a/Code/RDGeneral/CMakeLists.txt b/Code/RDGeneral/CMakeLists.txt index f6fd861ef..5915fabad 100644 --- a/Code/RDGeneral/CMakeLists.txt +++ b/Code/RDGeneral/CMakeLists.txt @@ -79,8 +79,13 @@ if(RDK_BUILD_THREADSAFE_SSS) rdkit_test(testConcurrentQueue testConcurrentQueue.cpp LINK_LIBRARIES RDGeneral) endif(RDK_BUILD_THREADSAFE_SSS) -rdkit_catch_test(dictTestsCatch catch_dict.cpp catch_main.cpp +add_library(rdkitCatch catch_main.cpp) +target_link_libraries(rdkitCatch PUBLIC rdkit_base) +target_include_directories(rdkitCatch PUBLIC ${CATCH_INCLUDE_DIR}) + + +rdkit_catch_test(dictTestsCatch catch_dict.cpp LINK_LIBRARIES RDGeneral ) -rdkit_catch_test(logTestsCatch catch_logs.cpp catch_main.cpp +rdkit_catch_test(logTestsCatch catch_logs.cpp LINK_LIBRARIES RDGeneral ) \ No newline at end of file diff --git a/Code/SimDivPickers/catch_tests.cpp b/Code/SimDivPickers/catch_tests.cpp index 3f8990872..6bc588888 100644 --- a/Code/SimDivPickers/catch_tests.cpp +++ b/Code/SimDivPickers/catch_tests.cpp @@ -8,8 +8,6 @@ // of the RDKit source tree. // -#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do - // this in one cpp file #include "catch.hpp" #include #include diff --git a/Code/cmake/Modules/RDKitUtils.cmake b/Code/cmake/Modules/RDKitUtils.cmake index 5c7e4ad92..e8327aed2 100644 --- a/Code/cmake/Modules/RDKitUtils.cmake +++ b/Code/cmake/Modules/RDKitUtils.cmake @@ -194,7 +194,7 @@ macro(rdkit_catch_test) if(RDK_BUILD_CPP_TESTS) add_executable(${RDKTEST_NAME} ${RDKTEST_SOURCES}) target_include_directories(${RDKTEST_NAME} PRIVATE ${CATCH_INCLUDE_DIR}) - target_link_libraries(${RDKTEST_NAME} ${RDKTEST_LINK_LIBRARIES}) + target_link_libraries(${RDKTEST_NAME} rdkitCatch ${RDKTEST_LINK_LIBRARIES}) add_test(${RDKTEST_NAME} ${EXECUTABLE_OUTPUT_PATH}/${RDKTEST_NAME}) #ParseAndAddCatchTests(${RDKTEST_NAME}) add_dependencies(${RDKTEST_NAME} catch) diff --git a/External/YAeHMOP/test1.cpp b/External/YAeHMOP/test1.cpp index 685dcb71e..c9baea510 100644 --- a/External/YAeHMOP/test1.cpp +++ b/External/YAeHMOP/test1.cpp @@ -1,8 +1,6 @@ // // Copyright (C) 2018 Greg Landrum // -#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do - // this in one cpp file per test #include "catch.hpp" #include