diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index eb52d9b52..6f1ad80c6 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -13,7 +13,7 @@ add_subdirectory(shaders) macro(add_kompute_test _TEST_NAME) add_executable("${_TEST_NAME}_tests" "Test${_TEST_NAME}.cpp" ${ARGN}) - target_link_libraries("${_TEST_NAME}_tests" PRIVATE GTest::GTest + target_link_libraries("${_TEST_NAME}_tests" PRIVATE GTest::gtest_main kompute::kompute kp_logger test_shaders diff --git a/test/TestAsyncOperations.cpp b/test/TestAsyncOperations.cpp index 91a8fab1b..d549dda41 100644 --- a/test/TestAsyncOperations.cpp +++ b/test/TestAsyncOperations.cpp @@ -259,15 +259,3 @@ TEST(TestAsyncOperations, TestManagerAsyncExecutionTimeout) EXPECT_EQ(tensorA->vector(), resultAsync); EXPECT_EQ(tensorB->vector(), resultAsync); } - -int -main(int argc, char* argv[]) -{ - testing::InitGoogleTest(&argc, argv); - -#if !KOMPUTE_OPT_LOG_LEVEL_DISABLED - logger::setupLogger(); -#endif - - return RUN_ALL_TESTS(); -} diff --git a/test/TestDestroy.cpp b/test/TestDestroy.cpp index c58557bc7..f6b92cd90 100644 --- a/test/TestDestroy.cpp +++ b/test/TestDestroy.cpp @@ -140,15 +140,3 @@ TEST(TestDestroy, TestDestroySequenceSingle) } } } - -int -main(int argc, char* argv[]) -{ - testing::InitGoogleTest(&argc, argv); - -#if !KOMPUTE_OPT_LOG_LEVEL_DISABLED - logger::setupLogger(); -#endif - - return RUN_ALL_TESTS(); -} diff --git a/test/TestLogisticRegression.cpp b/test/TestLogisticRegression.cpp index 072463a18..6b417a94c 100644 --- a/test/TestLogisticRegression.cpp +++ b/test/TestLogisticRegression.cpp @@ -157,15 +157,3 @@ TEST(TestLogisticRegression, TestMainLogisticRegressionManualCopy) bIn->data()[0]); } } - -int -main(int argc, char* argv[]) -{ - testing::InitGoogleTest(&argc, argv); - -#if !KOMPUTE_OPT_LOG_LEVEL_DISABLED - logger::setupLogger(); -#endif - - return RUN_ALL_TESTS(); -} diff --git a/test/TestManager.cpp b/test/TestManager.cpp index 5b78d5c7f..a7e488d11 100644 --- a/test/TestManager.cpp +++ b/test/TestManager.cpp @@ -106,15 +106,3 @@ TEST(TestManager, TestClearDestroy) mgr.destroy(); } - -int -main(int argc, char* argv[]) -{ - testing::InitGoogleTest(&argc, argv); - -#if !KOMPUTE_OPT_LOG_LEVEL_DISABLED - logger::setupLogger(); -#endif - - return RUN_ALL_TESTS(); -} diff --git a/test/TestMultipleAlgoExecutions.cpp b/test/TestMultipleAlgoExecutions.cpp index 75547b86c..f3d7315ba 100644 --- a/test/TestMultipleAlgoExecutions.cpp +++ b/test/TestMultipleAlgoExecutions.cpp @@ -271,15 +271,3 @@ TEST(TestMultipleAlgoExecutions, TestAlgorithmUtilFunctions) EXPECT_EQ(algorithm->getPushConstants(), pushConsts); EXPECT_EQ(algorithm->getSpecializationConstants(), specConsts); } - -int -main(int argc, char* argv[]) -{ - testing::InitGoogleTest(&argc, argv); - -#if !KOMPUTE_OPT_LOG_LEVEL_DISABLED - logger::setupLogger(); -#endif - - return RUN_ALL_TESTS(); -} diff --git a/test/TestOpShadersFromStringAndFile.cpp b/test/TestOpShadersFromStringAndFile.cpp index 12948d780..c95f2f516 100644 --- a/test/TestOpShadersFromStringAndFile.cpp +++ b/test/TestOpShadersFromStringAndFile.cpp @@ -108,15 +108,3 @@ TEST(TestOpAlgoCreate, ShaderCompiledDataFromConstructor) // EXPECT_EQ(tensorA->vector(), std::vector({ 0, 1, 2 })); // EXPECT_EQ(tensorB->vector(), std::vector({ 3, 4, 5 })); //} - -int -main(int argc, char* argv[]) -{ - testing::InitGoogleTest(&argc, argv); - -#if !KOMPUTE_OPT_LOG_LEVEL_DISABLED - logger::setupLogger(); -#endif - - return RUN_ALL_TESTS(); -} diff --git a/test/TestOpTensorCopy.cpp b/test/TestOpTensorCopy.cpp index 2ebb50c2a..22e8130c7 100644 --- a/test/TestOpTensorCopy.cpp +++ b/test/TestOpTensorCopy.cpp @@ -157,15 +157,3 @@ TEST(TestOpTensorCopy, SingleTensorShouldFail) EXPECT_THROW(mgr.sequence()->eval({ tensorA }), std::runtime_error); } - -int -main(int argc, char* argv[]) -{ - testing::InitGoogleTest(&argc, argv); - -#if !KOMPUTE_OPT_LOG_LEVEL_DISABLED - logger::setupLogger(); -#endif - - return RUN_ALL_TESTS(); -} diff --git a/test/TestOpTensorCreate.cpp b/test/TestOpTensorCreate.cpp index ec725915a..c3508ff89 100644 --- a/test/TestOpTensorCreate.cpp +++ b/test/TestOpTensorCreate.cpp @@ -58,15 +58,3 @@ TEST(TestOpTensorCreate, ExceptionOnZeroSizeTensor) std::string::npos); } } - -int -main(int argc, char* argv[]) -{ - testing::InitGoogleTest(&argc, argv); - -#if !KOMPUTE_OPT_LOG_LEVEL_DISABLED - logger::setupLogger(); -#endif - - return RUN_ALL_TESTS(); -} diff --git a/test/TestOpTensorSync.cpp b/test/TestOpTensorSync.cpp index fa4f76932..b59ee1481 100644 --- a/test/TestOpTensorSync.cpp +++ b/test/TestOpTensorSync.cpp @@ -53,15 +53,3 @@ TEST(TestOpTensorSync, SyncToDeviceMemoryMultiTensor) EXPECT_EQ(tensorB->vector(), testVec); EXPECT_EQ(tensorC->vector(), testVec); } - -int -main(int argc, char* argv[]) -{ - testing::InitGoogleTest(&argc, argv); - -#if !KOMPUTE_OPT_LOG_LEVEL_DISABLED - logger::setupLogger(); -#endif - - return RUN_ALL_TESTS(); -} diff --git a/test/TestPushConstant.cpp b/test/TestPushConstant.cpp index ec03bc08c..1356425cf 100644 --- a/test/TestPushConstant.cpp +++ b/test/TestPushConstant.cpp @@ -390,15 +390,3 @@ TEST(TestPushConstants, TestConstantsDouble) } } } - -int -main(int argc, char* argv[]) -{ - testing::InitGoogleTest(&argc, argv); - -#if !KOMPUTE_OPT_LOG_LEVEL_DISABLED - logger::setupLogger(); -#endif - - return RUN_ALL_TESTS(); -} diff --git a/test/TestSequence.cpp b/test/TestSequence.cpp index 5e5e3254c..d99107a96 100644 --- a/test/TestSequence.cpp +++ b/test/TestSequence.cpp @@ -243,15 +243,3 @@ TEST(TestSequence, CorrectSequenceRunningError) EXPECT_EQ(tensorOut->vector(), std::vector({ 2, 4, 6 })); } - -int -main(int argc, char* argv[]) -{ - testing::InitGoogleTest(&argc, argv); - -#if !KOMPUTE_OPT_LOG_LEVEL_DISABLED - logger::setupLogger(); -#endif - - return RUN_ALL_TESTS(); -} diff --git a/test/TestSpecializationConstant.cpp b/test/TestSpecializationConstant.cpp index 3140ba5b4..7f15f8443 100644 --- a/test/TestSpecializationConstant.cpp +++ b/test/TestSpecializationConstant.cpp @@ -102,15 +102,3 @@ TEST(TestSpecializationConstants, TestConstantsInt) } } } - -int -main(int argc, char* argv[]) -{ - testing::InitGoogleTest(&argc, argv); - -#if !KOMPUTE_OPT_LOG_LEVEL_DISABLED - logger::setupLogger(); -#endif - - return RUN_ALL_TESTS(); -} diff --git a/test/TestTensor.cpp b/test/TestTensor.cpp index 0a53220dd..7eeff4af3 100644 --- a/test/TestTensor.cpp +++ b/test/TestTensor.cpp @@ -44,15 +44,3 @@ TEST(TestTensor, DataTypes) EXPECT_EQ(tensor->dataType(), kp::Tensor::TensorDataTypes::eDouble); } } - -int -main(int argc, char* argv[]) -{ - testing::InitGoogleTest(&argc, argv); - -#if !KOMPUTE_OPT_LOG_LEVEL_DISABLED - logger::setupLogger(); -#endif - - return RUN_ALL_TESTS(); -} diff --git a/test/TestWorkgroup.cpp b/test/TestWorkgroup.cpp index a2e41865b..914ee721e 100644 --- a/test/TestWorkgroup.cpp +++ b/test/TestWorkgroup.cpp @@ -63,15 +63,3 @@ TEST(TestWorkgroup, TestSimpleWorkgroup) } } } - -int -main(int argc, char* argv[]) -{ - testing::InitGoogleTest(&argc, argv); - -#if !KOMPUTE_OPT_LOG_LEVEL_DISABLED - logger::setupLogger(); -#endif - - return RUN_ALL_TESTS(); -}