|
| 1 | +function(box64_add_test test_name test_num) |
| 2 | + set(options 32BIT DISABLED_ON_ANDROID) |
| 3 | + set(oneValueArgs REF_NUM ARGS2 ANDROID_REF_NUM) |
| 4 | + set(multiValueArgs ENV) |
| 5 | + cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) |
| 6 | + |
| 7 | + if(NOT ARG_REF_NUM) |
| 8 | + set(ARG_REF_NUM ${test_num}) |
| 9 | + endif() |
| 10 | + |
| 11 | + if(ARG_32BIT) |
| 12 | + set(_test_bin "${CMAKE_SOURCE_DIR}/tests32/test${test_num}") |
| 13 | + set(_ref_file "${CMAKE_SOURCE_DIR}/tests32/ref${ARG_REF_NUM}.txt") |
| 14 | + set(_output "tmpfile32_${test_num}.txt") |
| 15 | + else() |
| 16 | + if(ANDROID AND ARG_DISABLED_ON_ANDROID) |
| 17 | + return() |
| 18 | + endif() |
| 19 | + |
| 20 | + if(ANDROID) |
| 21 | + set(_test_bin "${CMAKE_CURRENT_SOURCE_DIR}/test${test_num}_android") |
| 22 | + if(ARG_ANDROID_REF_NUM) |
| 23 | + set(ARG_REF_NUM "${ARG_ANDROID_REF_NUM}") |
| 24 | + endif() |
| 25 | + else() |
| 26 | + set(_test_bin "${CMAKE_CURRENT_SOURCE_DIR}/test${test_num}") |
| 27 | + endif() |
| 28 | + |
| 29 | + set(_ref_file "${CMAKE_CURRENT_SOURCE_DIR}/ref${ARG_REF_NUM}.txt") |
| 30 | + set(_output "tmpfile${test_num}.txt") |
| 31 | + endif() |
| 32 | + |
| 33 | + add_test(NAME ${test_name} COMMAND ${CMAKE_COMMAND} |
| 34 | + -D TEST_PROGRAM=${CMAKE_BINARY_DIR}/${BOX64} |
| 35 | + -D TEST_ARGS=${_test_bin} |
| 36 | + -D TEST_ARGS2=${ARG_ARGS2} |
| 37 | + -D TEST_OUTPUT=${_output} |
| 38 | + -D TEST_REFERENCE=${_ref_file} |
| 39 | + -P ${CMAKE_SOURCE_DIR}/runTest.cmake) |
| 40 | + |
| 41 | + if(ARG_ENV) |
| 42 | + set_tests_properties(${test_name} PROPERTIES ENVIRONMENT "${ARG_ENV}") |
| 43 | + endif() |
| 44 | +endfunction() |
| 45 | + |
| 46 | +box64_add_test(bootSyscall 01) |
| 47 | +box64_add_test(bootSyscallC 02) |
| 48 | +box64_add_test(printf 03) |
| 49 | +box64_add_test(args 04 ARGS2 yeah) |
| 50 | +box64_add_test(maths1 05 ARGS2 7) |
| 51 | +box64_add_test(threadsStart 06) |
| 52 | +box64_add_test(trig 07) |
| 53 | +box64_add_test(pi 08) |
| 54 | +box64_add_test(fork 09) |
| 55 | +box64_add_test(cppThreads_nocosim 10 ENV "BOX64_LD_LIBRARY_PATH=${CMAKE_SOURCE_DIR}/x64lib" DISABLED_ON_ANDROID) |
| 56 | +box64_add_test(tlsData 11 DISABLED_ON_ANDROID) |
| 57 | +box64_add_test(fpu 12 ANDROID_REF_NUM 12_android) |
| 58 | +box64_add_test(contexts 13 DISABLED_ON_ANDROID) |
| 59 | +# box64_add_test(conditionalThreads 14) # disabled: unstable conditional threads test |
| 60 | +box64_add_test(linkingIndirectNoversion 15) |
| 61 | +box64_add_test(sse_asm 16 ENV "BOX64_DYNAREC_FASTROUND=0" DISABLED_ON_ANDROID) |
| 62 | +box64_add_test(sse_intrinsics 17 ENV "BOX64_DYNAREC_FASTNAN=0;BOX64_DYNAREC_FASTROUND=0" DISABLED_ON_ANDROID) |
| 63 | +box64_add_test(aes 18) |
| 64 | +box64_add_test(backtrace 19 DISABLED_ON_ANDROID) |
| 65 | +box64_add_test(irelative_reloc 20) |
| 66 | +box64_add_test(longjumpInSignals_nocosim 21 DISABLED_ON_ANDROID) |
| 67 | +box64_add_test(x87 22 ENV "BOX64_DYNAREC_FASTROUND=0" ANDROID_REF_NUM 22_android) |
| 68 | +box64_add_test(pshufb 23) |
| 69 | +box64_add_test(bswap 24) |
| 70 | +box64_add_test(x87cache 25) |
| 71 | +box64_add_test(feround 26 ENV "BOX64_SYNC_ROUNDING=1") |
| 72 | +box64_add_test(sse4_2 27 DISABLED_ON_ANDROID) |
| 73 | +box64_add_test(shaext 28) |
| 74 | +box64_add_test(lock 29) |
| 75 | +box64_add_test(avx_intrinsics 30 ENV "BOX64_DYNAREC_FASTNAN=0;BOX64_DYNAREC_FASTROUND=0;BOX64_AVX=2" DISABLED_ON_ANDROID) |
| 76 | +box64_add_test(fpu_rounding 31 ENV "BOX64_DYNAREC_FASTROUND=0" DISABLED_ON_ANDROID) |
| 77 | +box64_add_test(x87pc 32 ENV "BOX64_DYNAREC_X87DOUBLE=2" DISABLED_ON_ANDROID) |
| 78 | +box64_add_test(Boundary 33 DISABLED_ON_ANDROID) |
| 79 | +box64_add_test(mmx 34) |
| 80 | +box64_add_test(xsave_xrstor 35 DISABLED_ON_ANDROID) |
| 81 | + |
| 82 | +if(BOX32) |
| 83 | + box64_add_test(bootSyscall_32bits 01 32BIT) |
| 84 | + box64_add_test(bootSyscallC_32bits 02 32BIT) |
| 85 | + box64_add_test(printf_32bits 03 32BIT) |
| 86 | + box64_add_test(args_32bits 04 ARGS2 yeah 32BIT) |
| 87 | + box64_add_test(maths1_32bits 05 ARGS2 7 32BIT) |
| 88 | + box64_add_test(threadsStart_32bits 06 32BIT) |
| 89 | + box64_add_test(trig_32bits 07 32BIT) |
| 90 | + box64_add_test(pi_32bits 08 32BIT) |
| 91 | + box64_add_test(fork_32bits 09 32BIT) |
| 92 | + box64_add_test(cppThreads_32bits_nocosim 10 ENV "BOX64_LD_LIBRARY_PATH=${CMAKE_SOURCE_DIR}/x86lib" 32BIT) |
| 93 | + box64_add_test(tlsData_32bits 11 32BIT) |
| 94 | + box64_add_test(fpu_32bits 12 32BIT) |
| 95 | + box64_add_test(contexts_32bits 13 32BIT) |
| 96 | + if(NOT LD80BITS) |
| 97 | + box64_add_test(conditionalThreads_32bits_nocosim 14 32BIT) |
| 98 | + endif() |
| 99 | + box64_add_test(linkingIndirectNoversion_32bits 15 32BIT) |
| 100 | + box64_add_test(linkingIndirectVersion_32bits 16 32BIT) |
| 101 | + box64_add_test(sse_32bits 17 ENV "BOX64_DYNAREC_FASTNAN=0;BOX64_DYNAREC_FASTROUND=0" 32BIT) |
| 102 | + box64_add_test(longjumpInSignals_32bits_nocosim 18 32BIT) |
| 103 | + box64_add_test(x87_32bits 19 ENV "BOX64_DYNAREC_FASTROUND=0" 32BIT) |
| 104 | + box64_add_test(idiv_32bits 20 32BIT) |
| 105 | + box64_add_test(multiple_dlopen_32bits 21 32BIT) |
| 106 | + box64_add_test(bswap_32bits 23 32BIT) |
| 107 | + box64_add_test(arpl_32bits 27 32BIT) |
| 108 | + box64_add_test(mmx_32bits 28 32BIT) |
| 109 | +endif() |
0 commit comments