Improve CMakeLists.txt for tests, so it is easier to define test prerequirements.

Also added a few missing prerequirements.
This commit is contained in:
Veikko Sariola 2020-04-18 13:16:33 +03:00
parent d9f4def1d4
commit 886ee85a09

View File

@ -1,8 +1,8 @@
function(regression_test testname)
if(${ARGC} LESS 2)
if(${ARGC} LESS 4)
set(source ${testname})
else()
set(source ${ARGV1})
set(source ${ARGV3})
endif()
add_executable(${testname} ${source}.asm test_renderer.c)
@ -16,75 +16,53 @@ function(regression_test testname)
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${rawinput} ${rawoutput}
)
add_dependencies(${testname} ${testname}_rawcopy)
add_dependencies(${testname} ${testname}_rawcopy)
if(ARGC GREATER 1)
if (ARGV1)
message("${testname} requires ${ARGV1}")
set_tests_properties(${testname} PROPERTIES FIXTURES_REQUIRED "${ARGV1}")
endif()
endif()
if(ARGC GREATER 2)
if (ARGV2)
message("${testname} setups ${ARGV2}")
set_tests_properties(${testname} PROPERTIES FIXTURES_SETUP "${ARGV2}")
endif()
endif()
endfunction(regression_test)
regression_test(test_envelope)
regression_test(test_load)
regression_test(test_store)
regression_test(test_envelope "" ENVELOPE)
regression_test(test_load "" LOAD)
regression_test(test_store "" STORE)
regression_test(test_globalstore)
regression_test(test_panning)
regression_test(test_multiple_instruments)
regression_test(test_fop_pop)
regression_test(test_fop_addp)
regression_test(test_fop_mulp)
regression_test(test_fop_push)
regression_test(test_fop_xch)
regression_test(test_fop_add)
regression_test(test_fop_mul)
regression_test(test_fop_addp2)
regression_test(test_fop_mulp2)
regression_test(test_panning ENVELOPE)
regression_test(test_multiple_instruments ENVELOPE)
regression_test(test_fop_pop LOAD FOP_POP)
regression_test(test_fop_addp LOAD)
regression_test(test_fop_mulp LOAD FOP_MULP)
regression_test(test_fop_push "LOAD;FOP_POP" FOP_PUSH)
regression_test(test_fop_xch LOAD)
regression_test(test_fop_add LOAD)
regression_test(test_fop_mul LOAD)
regression_test(test_fop_addp2 LOAD)
regression_test(test_fop_mulp2 LOAD FOP_MULP2)
regression_test(test_fop_loadnote)
regression_test(test_vco_sine)
regression_test(test_vco_trisaw)
regression_test(test_vco_noise)
regression_test(test_vco_pulse)
regression_test(test_vco_gate)
regression_test(test_vco_stereo)
regression_test(test_vco_lfo)
regression_test(test_vco_tm_modulation)
regression_test(test_vco_dm_modulation)
regression_test(test_vco_fm_modulation)
regression_test(test_vco_pm_modulation)
regression_test(test_vco_cm_modulation)
regression_test(test_vco_sm_modulation)
regression_test(test_vco_gm_modulation)
regression_test(test_envelope_16bit test_envelope)
regression_test(test_envelope_modulation)
target_compile_definitions(test_envelope_16bit PUBLIC GO4K_USE_16BIT_OUTPUT)
set_tests_properties(test_envelope PROPERTIES FIXTURES_SETUP ENVELOPE)
set_tests_properties(test_panning PROPERTIES FIXTURES_REQUIRED ENVELOPE)
set_tests_properties(test_multiple_instruments PROPERTIES FIXTURES_REQUIRED ENVELOPE)
set_tests_properties(test_vco_sine PROPERTIES FIXTURES_REQUIRED ENVELOPE)
set_tests_properties(test_vco_trisaw PROPERTIES FIXTURES_REQUIRED ENVELOPE)
set_tests_properties(test_vco_noise PROPERTIES FIXTURES_REQUIRED ENVELOPE)
set_tests_properties(test_vco_pulse PROPERTIES FIXTURES_REQUIRED ENVELOPE)
set_tests_properties(test_vco_gate PROPERTIES FIXTURES_REQUIRED ENVELOPE)
set_tests_properties(test_vco_stereo PROPERTIES FIXTURES_REQUIRED ENVELOPE)
set_tests_properties(test_load PROPERTIES FIXTURES_SETUP LOAD)
set_tests_properties(test_fop_pop PROPERTIES FIXTURES_REQUIRED LOAD)
set_tests_properties(test_fop_addp PROPERTIES FIXTURES_REQUIRED LOAD)
set_tests_properties(test_fop_mulp PROPERTIES FIXTURES_REQUIRED LOAD)
set_tests_properties(test_fop_push PROPERTIES FIXTURES_REQUIRED LOAD)
set_tests_properties(test_fop_xch PROPERTIES FIXTURES_REQUIRED LOAD)
set_tests_properties(test_fop_add PROPERTIES FIXTURES_REQUIRED LOAD)
set_tests_properties(test_fop_mul PROPERTIES FIXTURES_REQUIRED LOAD)
set_tests_properties(test_fop_addp2 PROPERTIES FIXTURES_REQUIRED LOAD)
set_tests_properties(test_fop_mulp2 PROPERTIES FIXTURES_REQUIRED LOAD)
set_tests_properties(test_fop_pop PROPERTIES FIXTURES_SETUP FOP_POP)
set_tests_properties(test_fop_push PROPERTIES FIXTURES_REQUIRED FOP_POP)
set_tests_properties(test_vco_sine PROPERTIES FIXTURES_SETUP VCO_SINE)
set_tests_properties(test_fop_mulp PROPERTIES FIXTURES_SETUP FOP_MULP)
set_tests_properties(test_fop_push PROPERTIES FIXTURES_SETUP FOP_PUSH)
set_tests_properties(test_store PROPERTIES FIXTURES_SETUP STORE)
set_tests_properties(test_vco_tm_modulation PROPERTIES FIXTURES_REQUIRED "VCO_SINE;ENVELOPE;FOP_MULP;FOP_PUSH;STORE")
set_tests_properties(test_vco_dm_modulation PROPERTIES FIXTURES_REQUIRED "VCO_SINE;ENVELOPE;FOP_MULP;FOP_PUSH;STORE")
set_tests_properties(test_vco_fm_modulation PROPERTIES FIXTURES_REQUIRED "VCO_SINE;ENVELOPE;FOP_MULP;FOP_PUSH;STORE")
set_tests_properties(test_vco_pm_modulation PROPERTIES FIXTURES_REQUIRED "VCO_SINE;ENVELOPE;FOP_MULP;FOP_PUSH;STORE")
set_tests_properties(test_vco_sm_modulation PROPERTIES FIXTURES_REQUIRED "VCO_SINE;ENVELOPE;FOP_MULP;FOP_PUSH;STORE")
set_tests_properties(test_vco_gm_modulation PROPERTIES FIXTURES_REQUIRED "VCO_SINE;ENVELOPE;FOP_MULP;FOP_PUSH;STORE")
regression_test(test_vco_sine ENVELOPE VCO_SINE)
regression_test(test_vco_trisaw ENVELOPE)
regression_test(test_vco_noise ENVELOPE)
regression_test(test_vco_pulse ENVELOPE VCO_PULSE)
regression_test(test_vco_gate ENVELOPE)
regression_test(test_vco_stereo ENVELOPE)
regression_test(test_vco_lfo "ENVELOPE;VCO_SINE;VCO_PULSE;FOP_MULP2")
regression_test(test_vco_tm_modulation "VCO_SINE;ENVELOPE;FOP_MULP;FOP_PUSH;STORE")
regression_test(test_vco_dm_modulation "VCO_SINE;ENVELOPE;FOP_MULP;FOP_PUSH;STORE")
regression_test(test_vco_fm_modulation "VCO_SINE;ENVELOPE;FOP_MULP;FOP_PUSH;STORE")
regression_test(test_vco_pm_modulation "VCO_SINE;ENVELOPE;FOP_MULP;FOP_PUSH;STORE")
regression_test(test_vco_cm_modulation "VCO_SINE;ENVELOPE;FOP_MULP;FOP_PUSH;STORE")
regression_test(test_vco_sm_modulation "VCO_SINE;ENVELOPE;FOP_MULP;FOP_PUSH;STORE")
regression_test(test_vco_gm_modulation "VCO_SINE;ENVELOPE;FOP_MULP;FOP_PUSH;STORE")
regression_test(test_envelope_modulation "VCO_SINE;ENVELOPE;STORE")
regression_test(test_envelope_16bit ENVELOPE "" test_envelope)
target_compile_definitions(test_envelope_16bit PUBLIC GO4K_USE_16BIT_OUTPUT)