Add asm generation target (off by default) and function to add a test to generate asm. Add existing span test to set of asm tests. (Note: this commit does not change any CI system or introduce any automatic diffing)

This commit is contained in:
Daniel Donenfeld 2018-12-06 11:47:52 -08:00
parent 0f68d133fa
commit 346093c99e

View File

@ -171,3 +171,36 @@ endfunction()
add_gsl_test_noexcept(no_exception_throw_tests) add_gsl_test_noexcept(no_exception_throw_tests)
add_gsl_test_noexcept(no_exception_ensure_tests) add_gsl_test_noexcept(no_exception_ensure_tests)
set(ASM_LOCATION ${CMAKE_SOURCE_DIR}\\asm\\${CMAKE_GENERATOR})
file(MAKE_DIRECTORY ${ASM_LOCATION})
add_custom_target(asm_tests)
function(add_gsl_asm_test name)
add_library(${name}_asm ${name}.cpp)
target_compile_options(${name}_asm PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:
/FA
/Fa${ASM_LOCATION}\\${name}_asm.asm
>
${GSL_CPLUSPLUS_OPT}
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:
-S
-o ${ASM_LOCATION}\${name}.s
>
)
target_link_libraries(${name}_asm
GSL
test_catch
gsl_tests_config
)
add_dependencies(${name}_asm catch)
add_dependencies(asm_tests ${name}_asm)
# group all tests under GSL_tests
set_property(TARGET ${name}_asm PROPERTY FOLDER "GSL_tests")
endfunction()
add_gsl_asm_test(span_tests)