Skip to content

Commit

Permalink
Completely removed main from tests
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Sauter <[email protected]>
  • Loading branch information
COM8 committed Jul 27, 2022
1 parent 4e9cebb commit 1d99aeb
Show file tree
Hide file tree
Showing 15 changed files with 1 addition and 169 deletions.
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions test/TestAsyncOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
12 changes: 0 additions & 12 deletions test/TestDestroy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
12 changes: 0 additions & 12 deletions test/TestLogisticRegression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
12 changes: 0 additions & 12 deletions test/TestManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
12 changes: 0 additions & 12 deletions test/TestMultipleAlgoExecutions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,3 @@ TEST(TestMultipleAlgoExecutions, TestAlgorithmUtilFunctions)
EXPECT_EQ(algorithm->getPushConstants<float>(), pushConsts);
EXPECT_EQ(algorithm->getSpecializationConstants<float>(), specConsts);
}

int
main(int argc, char* argv[])
{
testing::InitGoogleTest(&argc, argv);

#if !KOMPUTE_OPT_LOG_LEVEL_DISABLED
logger::setupLogger();
#endif

return RUN_ALL_TESTS();
}
12 changes: 0 additions & 12 deletions test/TestOpShadersFromStringAndFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,3 @@ TEST(TestOpAlgoCreate, ShaderCompiledDataFromConstructor)
// EXPECT_EQ(tensorA->vector(), std::vector<float>({ 0, 1, 2 }));
// EXPECT_EQ(tensorB->vector(), std::vector<float>({ 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();
}
12 changes: 0 additions & 12 deletions test/TestOpTensorCopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,3 @@ TEST(TestOpTensorCopy, SingleTensorShouldFail)
EXPECT_THROW(mgr.sequence()->eval<kp::OpTensorCopy>({ 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();
}
12 changes: 0 additions & 12 deletions test/TestOpTensorCreate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
12 changes: 0 additions & 12 deletions test/TestOpTensorSync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
12 changes: 0 additions & 12 deletions test/TestPushConstant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
12 changes: 0 additions & 12 deletions test/TestSequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,3 @@ TEST(TestSequence, CorrectSequenceRunningError)

EXPECT_EQ(tensorOut->vector(), std::vector<float>({ 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();
}
12 changes: 0 additions & 12 deletions test/TestSpecializationConstant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
12 changes: 0 additions & 12 deletions test/TestTensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
12 changes: 0 additions & 12 deletions test/TestWorkgroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

0 comments on commit 1d99aeb

Please sign in to comment.