sointu/tests/CMakeLists.txt
Veikko Sariola 78d4cd50e8 Rewrote most of the synth to better support stereo signals and polyphony. VSTi removed as there is no plan to update the VSTi to support the new features.
The stereo opcode variants have bit 1 of the command stream set. The polyphony is split into two parts: 1) polyphony, meaning that voices reuse the same opcodes; 2) multitrack voices, meaning that a track triggers more than voice. They both can be flexible defined in any combinations: for example voice 1 and 2 can be triggered by track 1 and use instrument 1, and voice 3 by track 2/instrument 2 and voice 4 by track 3/instrument 2. This is achieved through the use of bitmasks: in the aforementioned example, bit 1 of su_voicetrack_bitmask would be set, meaning "the voice after voice #1 will be triggered by the same track". On the other hand, bits 1 and 3 of su_polyphony_bitmask would be set to indicate that "the voices after #1 and #3 will reuse the same instruments".
2020-05-16 08:25:52 +03:00

101 lines
4.6 KiB
CMake

function(regression_test testname)
if(${ARGC} LESS 4)
set(source ${testname})
else()
set(source ${ARGV3})
endif()
add_executable(${testname} ${source}.asm test_renderer.c)
# the tests include the entire ASM but we still want to rebuild when they change
file(GLOB FOURKLANG ${PROJECT_SOURCE_DIR}/src/*.inc ${PROJECT_SOURCE_DIR}/src/*.asm ${PROJECT_SOURCE_DIR}/src/opcodes/*.asm ${PROJECT_SOURCE_DIR}/src/opcodes/*.inc)
set_source_files_properties(${source}.asm PROPERTIES OBJECT_DEPENDS "${FOURKLANG}")
set_source_files_properties(${FOURKLANG} PROPERTIES HEADER_FILE_ONLY TRUE)
add_test(${testname} ${testname})
target_compile_definitions(${testname} PUBLIC TEST_NAME="${testname}" SU_USE_INTROSPECTION SU_USE_PLAYER)
set (rawinput ${CMAKE_CURRENT_SOURCE_DIR}/expected_output/${testname}.raw)
set (rawoutput ${CMAKE_CURRENT_BINARY_DIR}/expected_output/${testname}.raw)
add_custom_target(${testname}_rawcopy
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${rawinput} ${rawoutput}
)
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 "" ENVELOPE)
regression_test(test_load "" LOAD)
regression_test(test_send "" SEND)
regression_test(test_globalstore)
regression_test(test_panning ENVELOPE PANNING)
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 ENVELOPE VCO_SINE)
regression_test(test_vco_trisaw ENVELOPE)
regression_test(test_vco_noise ENVELOPE VCO_NOISE)
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;SEND")
regression_test(test_vco_dm_modulation "VCO_SINE;ENVELOPE;FOP_MULP;FOP_PUSH;SEND")
regression_test(test_vco_pm_modulation "VCO_SINE;ENVELOPE;FOP_MULP;FOP_PUSH;SEND")
regression_test(test_vco_cm_modulation "VCO_SINE;ENVELOPE;FOP_MULP;FOP_PUSH;SEND")
regression_test(test_vco_sm_modulation "VCO_SINE;ENVELOPE;FOP_MULP;FOP_PUSH;SEND")
regression_test(test_vco_gm_modulation "VCO_SINE;ENVELOPE;FOP_MULP;FOP_PUSH;SEND")
regression_test(test_dst ENVELOPE)
regression_test(test_dst_modulation "VCO_SINE;ENVELOPE;SEND")
regression_test(test_dst_sh ENVELOPE)
regression_test(test_dst_sh_modulation "VCO_SINE;ENVELOPE;SEND")
regression_test(test_dst_stereo ENVELOPE)
regression_test(test_vcf_band "VCO_SINE;ENVELOPE;FOP_MULP")
regression_test(test_vcf_low "VCO_SINE;ENVELOPE;FOP_MULP")
regression_test(test_vcf_high "VCO_SINE;ENVELOPE;FOP_MULP")
regression_test(test_vcf_peak "VCO_SINE;ENVELOPE;FOP_MULP")
regression_test(test_vcf_stereo "VCO_SINE;ENVELOPE;FOP_MULP")
regression_test(test_vcf_fm_modulation "VCO_SINE;ENVELOPE;FOP_MULP;SEND")
regression_test(test_vcf_rm_modulation "VCO_SINE;ENVELOPE;FOP_MULP;SEND")
regression_test(test_dll "ENVELOPE;FOP_MULP;PANNING;VCO_SINE")
regression_test(test_dll_stereo "ENVELOPE;FOP_MULP;PANNING;VCO_SINE")
regression_test(test_dll_notetracking "ENVELOPE;FOP_MULP;PANNING;VCO_NOISE")
regression_test(test_dll_reverb "ENVELOPE;FOP_MULP;PANNING;VCO_SINE")
regression_test(test_dll_fm_modulation "ENVELOPE;FOP_MULP;PANNING;VCO_SINE;SEND")
regression_test(test_dll_pm_modulation "ENVELOPE;FOP_MULP;PANNING;VCO_SINE;SEND")
regression_test(test_dll_dm_modulation "ENVELOPE;FOP_MULP;PANNING;VCO_SINE;SEND")
regression_test(test_dll_im_modulation "ENVELOPE;FOP_MULP;PANNING;VCO_SINE;SEND")
regression_test(test_envelope_modulation "VCO_SINE;ENVELOPE;SEND")
regression_test(test_envelope_16bit ENVELOPE "" test_envelope)
target_compile_definitions(test_envelope_16bit PUBLIC SU_USE_16BIT_OUTPUT)
regression_test(test_polyphony "ENVELOPE;VCO_SINE")