SWDEV-277697 - Fix issues with nvcc + catch2

Change-Id: If9be2d7d6a635964ee0abf8ffa9d948b734864f1


[ROCm/hip commit: 6311c3251b]
This commit is contained in:
Jatin Chaudhary
2021-06-15 03:20:27 -07:00
committed by Jatin Chaudhary
orang tua 4a9689eb49
melakukan fc385e09b8
3 mengubah file dengan 19 tambahan dan 9 penghapusan
+6 -1
Melihat File
@@ -64,8 +64,13 @@ set(CMAKE_CXX_EXTENSIONS OFF)
add_custom_target(build_tests)
# Tests folder
add_subdirectory(unit)
add_subdirectory(hipTestMain)
add_subdirectory(stress)
add_subdirectory(multiproc)
if(UNIX AND HIP_PLATFORM MATCHES "amd")
add_subdirectory(multiproc)
endif()
cmake_policy(POP)
@@ -3,7 +3,11 @@ if(CMAKE_BUILD_TYPE MATCHES "^Debug$")
endif()
add_executable(UnitTests EXCLUDE_FROM_ALL main.cc hip_test_context.cc)
set_property(TARGET UnitTests PROPERTY CXX_STANDARD 17)
if(HIP_PLATFORM MATCHES "amd")
set_property(TARGET UnitTests PROPERTY CXX_STANDARD 17)
else()
target_compile_options(UnitTests PUBLIC -std=c++17)
endif()
target_link_libraries(UnitTests PRIVATE DeviceLibs
MemoryTest
@@ -19,11 +23,11 @@ catch_discover_tests(UnitTests PROPERTIES SKIP_REGULAR_EXPRESSION "HIP_SKIP_THI
add_dependencies(build_tests UnitTests)
# Add Multiproc tests as seperate binary
if(UNIX)
add_executable(MultiProcTests EXCLUDE_FROM_ALL main.cc hip_test_context.cc)
set_property(TARGET MultiProcTests PROPERTY CXX_STANDARD 17)
target_link_libraries(MultiProcTests PRIVATE MultiProc
if(UNIX AND HIP_PLATFORM MATCHES "amd")
add_executable(MultiProcTests EXCLUDE_FROM_ALL main.cc hip_test_context.cc)
set_property(TARGET MultiProcTests PROPERTY CXX_STANDARD 17)
target_link_libraries(MultiProcTests PRIVATE MultiProc
stdc++fs)
catch_discover_tests(MultiProcTests PROPERTIES SKIP_REGULAR_EXPRESSION "HIP_SKIP_THIS_TEST")
add_dependencies(build_tests MultiProcTests)
catch_discover_tests(MultiProcTests PROPERTIES SKIP_REGULAR_EXPRESSION "HIP_SKIP_THIS_TEST")
add_dependencies(build_tests MultiProcTests)
endif()
@@ -120,7 +120,7 @@ bool TestContext::parseJsonFile() {
LogPrintf("Json contents:: %s", json_str.data());
picojson::value v;
std::string err;
std::string err = picojson::parse(v, json_str);
if (err.size() > 1) {
LogPrintf("Error from PicoJson: %s", err.data());
return false;
@@ -130,6 +130,7 @@ bool TestContext::parseJsonFile() {
LogPrintf("%s", "Data in json is not in correct format, it should be an object");
return false;
}
const picojson::object &o = v.get<picojson::object>();
for (picojson::object::const_iterator i = o.begin(); i != o.end(); ++i) {
// Processing for DisabledTests