Catch2 standalone exe (#129)
* SWDEV-359379 - catch2: Standalone single exe per file -workaround for rsp file issue. -Creates single exe per file -tests detection is still during execution time and NOT compile time Change-Id: Iddfb83d57b2d767212f3d9307a276b7d572da6cd * SWDEV-359379 - Update CMakeList * Update Catch.cmake * Temporarily disable failing tests
Šī revīzija ir iekļauta:
revīziju iesūtīja
GitHub
vecāks
75bb521e18
revīzija
961245e9f4
@@ -41,12 +41,12 @@ set_source_files_properties(hipGetDeviceCount.cc PROPERTIES COMPILE_FLAGS -std=c
|
||||
set_source_files_properties(hipDeviceGetP2PAttribute.cc PROPERTIES COMPILE_FLAGS -std=c++17)
|
||||
|
||||
add_executable(getDeviceCount EXCLUDE_FROM_ALL getDeviceCount_exe.cc)
|
||||
add_executable(hipDeviceGetP2PAttribute EXCLUDE_FROM_ALL hipDeviceGetP2PAttribute_exe.cc)
|
||||
add_executable(hipDeviceGetP2PAttribute_exe EXCLUDE_FROM_ALL hipDeviceGetP2PAttribute_exe.cc)
|
||||
|
||||
hip_add_exe_to_target(NAME DeviceTest
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
COMPILE_OPTIONS -std=c++14)
|
||||
|
||||
add_dependencies(DeviceTest getDeviceCount)
|
||||
add_dependencies(DeviceTest hipDeviceGetP2PAttribute)
|
||||
add_dependencies(build_tests getDeviceCount)
|
||||
add_dependencies(build_tests hipDeviceGetP2PAttribute_exe)
|
||||
|
||||
@@ -122,20 +122,20 @@ TEST_CASE("Unit_hipDeviceGetP2PAttribute_Negative") {
|
||||
|
||||
/* https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#env-vars */
|
||||
SECTION("Hidden devices using environment variables") {
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute").run("") == hipSuccess);
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute").run("0") == hipErrorInvalidDevice);
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute").run("1") == hipErrorInvalidDevice);
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute").run("0,1") == hipSuccess);
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute").run("-1,0") == hipErrorNoDevice);
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute").run("0,-1") == hipErrorInvalidDevice);
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute").run("0,1,-1") == hipSuccess);
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute").run("0,-1,1") == hipErrorInvalidDevice);
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute_exe").run("") == hipSuccess);
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute_exe").run("0") == hipErrorInvalidDevice);
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute_exe").run("1") == hipErrorInvalidDevice);
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute_exe").run("0,1") == hipSuccess);
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute_exe").run("-1,0") == hipErrorNoDevice);
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute_exe").run("0,-1") == hipErrorInvalidDevice);
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute_exe").run("0,1,-1") == hipSuccess);
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute_exe").run("0,-1,1") == hipErrorInvalidDevice);
|
||||
|
||||
if (deviceCount > 2) {
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute").run("2,1") == hipSuccess);
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute").run("2") == hipErrorInvalidDevice);
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute_exe").run("2,1") == hipSuccess);
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute_exe").run("2") == hipErrorInvalidDevice);
|
||||
} else {
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute").run("2,1") == hipErrorNoDevice);
|
||||
REQUIRE(hip::SpawnProc("hipDeviceGetP2PAttribute_exe").run("2,1") == hipErrorNoDevice);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -59,7 +59,6 @@ set(TEST_SRC
|
||||
hipGraphEventWaitNodeGetEvent.cc
|
||||
hipGraphExecMemcpyNodeSetParams.cc
|
||||
hipStreamBeginCapture.cc
|
||||
hipGraphAddMemcpyNode1D.cc
|
||||
hipStreamIsCapturing.cc
|
||||
hipStreamGetCaptureInfo.cc
|
||||
hipStreamEndCapture.cc
|
||||
|
||||
@@ -18,10 +18,11 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
set(COMMON_SHARED_SRC DriverContext.cc)
|
||||
|
||||
# Common Tests - Test independent of all platforms
|
||||
if(HIP_PLATFORM MATCHES "amd")
|
||||
set(TEST_SRC
|
||||
DriverContext.cc
|
||||
memset.cc
|
||||
malloc.cc
|
||||
hipMemcpy2DToArray.cc
|
||||
@@ -46,7 +47,6 @@ set(TEST_SRC
|
||||
hipMemcpy_MultiThread.cc
|
||||
hipHostRegister.cc
|
||||
hipHostUnregister.cc
|
||||
hipMallocPitch.cc
|
||||
hipMemPtrGetInfo.cc
|
||||
hipPointerGetAttributes.cc
|
||||
hipHostGetFlags.cc
|
||||
@@ -79,7 +79,6 @@ set(TEST_SRC
|
||||
hipMemcpyWithStreamMultiThread.cc
|
||||
hipMemsetAsyncAndKernel.cc
|
||||
hipMemset2DAsyncMultiThreadAndKernel.cc
|
||||
hipMallocManaged.cc
|
||||
hipMallocConcurrency.cc
|
||||
hipMemcpyDtoD.cc
|
||||
hipMemcpyDtoDAsync.cc
|
||||
@@ -117,7 +116,6 @@ set(TEST_SRC
|
||||
)
|
||||
else()
|
||||
set(TEST_SRC
|
||||
DriverContext.cc
|
||||
memset.cc
|
||||
malloc.cc
|
||||
hipMemcpy2DToArray.cc
|
||||
@@ -142,7 +140,6 @@ set(TEST_SRC
|
||||
hipMemcpy_MultiThread.cc
|
||||
hipHostRegister.cc
|
||||
hipHostUnregister.cc
|
||||
hipMallocPitch.cc
|
||||
hipHostGetFlags.cc
|
||||
hipHostGetDevicePointer.cc
|
||||
hipMallocManaged_MultiScenario.cc
|
||||
@@ -172,7 +169,6 @@ set(TEST_SRC
|
||||
hipMemcpyWithStreamMultiThread.cc
|
||||
hipMemsetAsyncAndKernel.cc
|
||||
hipMemset2DAsyncMultiThreadAndKernel.cc
|
||||
hipMallocManaged.cc
|
||||
hipMallocConcurrency.cc
|
||||
hipMemcpyDtoD.cc
|
||||
hipMemcpyDtoDAsync.cc
|
||||
@@ -217,4 +213,5 @@ endif()
|
||||
|
||||
hip_add_exe_to_target(NAME MemoryTest
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests)
|
||||
TEST_TARGET_NAME build_tests
|
||||
COMMON_SHARED_SRC ${COMMON_SHARED_SRC})
|
||||
|
||||
@@ -18,8 +18,8 @@ elseif (HIP_PLATFORM MATCHES "nvidia")
|
||||
endif()
|
||||
|
||||
# Standalone exes
|
||||
add_executable(printfFlags EXCLUDE_FROM_ALL printfFlags_exe.cc)
|
||||
add_executable(printfSpecifiers EXCLUDE_FROM_ALL printfSpecifiers_exe.cc)
|
||||
add_executable(printfFlags_exe EXCLUDE_FROM_ALL printfFlags_exe.cc)
|
||||
add_executable(printfSpecifiers_exe EXCLUDE_FROM_ALL printfSpecifiers_exe.cc)
|
||||
|
||||
add_dependencies(printfTests printfFlags)
|
||||
add_dependencies(printfTests printfSpecifiers)
|
||||
add_dependencies(build_tests printfFlags_exe)
|
||||
add_dependencies(build_tests printfSpecifiers_exe)
|
||||
|
||||
@@ -37,7 +37,7 @@ xyzzy
|
||||
00000042
|
||||
)here");
|
||||
|
||||
hip::SpawnProc proc("printfFlags", true);
|
||||
hip::SpawnProc proc("printfFlags_exe", true);
|
||||
REQUIRE(proc.run() == 0);
|
||||
REQUIRE(proc.getOutput() == reference);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ x
|
||||
)here");
|
||||
#endif
|
||||
|
||||
hip::SpawnProc proc("printfSpecifiers", true);
|
||||
hip::SpawnProc proc("printfSpecifiers_exe", true);
|
||||
REQUIRE(0 == proc.run());
|
||||
REQUIRE(proc.getOutput() == reference);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
set(COMMON_SHARED_SRC streamCommon.cc)
|
||||
|
||||
if(HIP_PLATFORM MATCHES "amd")
|
||||
set(TEST_SRC
|
||||
hipStreamCreate.cc
|
||||
@@ -10,7 +12,6 @@ set(TEST_SRC
|
||||
hipStreamDestroy.cc
|
||||
hipStreamGetCUMask.cc
|
||||
hipAPIStreamDisable.cc
|
||||
streamCommon.cc
|
||||
hipStreamValue.cc
|
||||
hipStreamWithCUMask.cc
|
||||
hipStreamACb_MultiThread.cc
|
||||
@@ -34,7 +35,6 @@ set(TEST_SRC
|
||||
hipAPIStreamDisable.cc
|
||||
# hipStreamAttachMemAsync_old.cc # Disabling it on nvidia due to issue in function definition of hipStreamAttachMemAsync
|
||||
# Fixing would break ABI, to be re-enabled when the fix is made.
|
||||
streamCommon.cc
|
||||
hipStreamValue.cc
|
||||
hipStreamSynchronize.cc
|
||||
hipStreamQuery.cc
|
||||
@@ -48,4 +48,5 @@ endif()
|
||||
hip_add_exe_to_target(NAME StreamTest
|
||||
TEST_SRC ${TEST_SRC}
|
||||
TEST_TARGET_NAME build_tests
|
||||
COMPILE_OPTIONS -std=c++17)
|
||||
COMPILE_OPTIONS -std=c++17
|
||||
COMMON_SHARED_SRC ${COMMON_SHARED_SRC})
|
||||
|
||||
@@ -37,9 +37,6 @@ set(TEST_SRC
|
||||
hipGetChanDesc.cc
|
||||
hipTexObjPitch.cc
|
||||
hipTextureObj1DFetch.cc
|
||||
hipBindTex2DPitch.cc
|
||||
hipBindTexRef1DFetch.cc
|
||||
hipTex1DFetchCheckModes.cc
|
||||
hipTextureObj1DCheckModes.cc
|
||||
hipTextureObj2DCheckModes.cc
|
||||
hipTextureObj3DCheckModes.cc
|
||||
|
||||
Atsaukties uz šo jaunā problēmā
Block a user