mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
[romi,xrp] Translate unit tests to catch2 (#9012)
This commit is contained in:
@@ -78,7 +78,7 @@ cc_test(
|
||||
srcs = glob(["src/test/native/cpp/**"]),
|
||||
deps = [
|
||||
":romiVendordep",
|
||||
"//thirdparty/googletest",
|
||||
"//thirdparty/catch2",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ install(FILES ${WPILIB_BINARY_DIR}/romivendordep-config.cmake DESTINATION share/
|
||||
install(EXPORT romivendordep DESTINATION share/romiVendordep)
|
||||
|
||||
if(WITH_TESTS)
|
||||
wpilib_add_test(romiVendordep src/test/native/cpp)
|
||||
wpilib_add_test_catch2(romiVendordep src/test/native/cpp)
|
||||
target_include_directories(romiVendordep_test PRIVATE src/test/native/include)
|
||||
target_link_libraries(romiVendordep_test romiVendordep googletest)
|
||||
target_link_libraries(romiVendordep_test romiVendordep)
|
||||
endif()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
ext {
|
||||
nativeName = 'romiVendordep'
|
||||
devMain = 'org.wpilib.romi.DevMain'
|
||||
nativeTestSuiteName = "${nativeName}Catch2Test"
|
||||
}
|
||||
|
||||
evaluationDependsOn(":ntcore")
|
||||
|
||||
@@ -2,9 +2,12 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <catch2/catch_session.hpp>
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
TEST_CASE("romiVendordep native test binary loads",
|
||||
"[romi][vendordep][smoke]") {}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
return Catch::Session().run(argc, argv);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ cc_test(
|
||||
srcs = glob(["src/test/native/cpp/**"]),
|
||||
deps = [
|
||||
":xrpVendordep",
|
||||
"//thirdparty/googletest",
|
||||
"//thirdparty/catch2",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ install(FILES ${WPILIB_BINARY_DIR}/xrpvendordep-config.cmake DESTINATION share/x
|
||||
install(EXPORT xrpvendordep DESTINATION share/xrpVendordep)
|
||||
|
||||
if(WITH_TESTS)
|
||||
wpilib_add_test(xrpVendordep src/test/native/cpp)
|
||||
wpilib_add_test_catch2(xrpVendordep src/test/native/cpp)
|
||||
target_include_directories(xrpVendordep_test PRIVATE src/test/native/include)
|
||||
target_link_libraries(xrpVendordep_test xrpVendordep googletest)
|
||||
target_link_libraries(xrpVendordep_test xrpVendordep)
|
||||
endif()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
ext {
|
||||
nativeName = 'xrpVendordep'
|
||||
devMain = 'org.wpilib.xrp.DevMain'
|
||||
nativeTestSuiteName = "${nativeName}Catch2Test"
|
||||
}
|
||||
|
||||
evaluationDependsOn(":ntcore")
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <catch2/catch_session.hpp>
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
TEST_CASE("xrpVendordep native test binary loads", "[xrp][vendordep][smoke]") {}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
return Catch::Session().run(argc, argv);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user