fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
c5e4fed02
master
1FILE ( GLOB FISH_CHECKS CONFIGURE_DEPENDS ${ CMAKE_SOURCE_DIR } /tests/checks/*.fish ) 2foreach ( CHECK${ FISH_CHECKS }) 3get_filename_component ( CHECK_NAME ${ CHECK } NAME ) 4add_custom_target ( 5test_ ${ CHECK_NAME } 6COMMAND ${ CMAKE_SOURCE_DIR } /tests/test_driver.py ${ CMAKE_CURRENT_BINARY_DIR } 7checks/ ${ CHECK_NAME } 8WORKING_DIRECTORY ${ CMAKE_SOURCE_DIR } /tests 9DEPENDS fish fish_indent fish_key_reader 10USES_TERMINAL 11) 12endforeach ( CHECK) 13 14FILE ( GLOB PEXPECTS CONFIGURE_DEPENDS ${ CMAKE_SOURCE_DIR } /tests/pexpects/*.py ) 15foreach ( PEXPECT${ PEXPECTS }) 16get_filename_component ( PEXPECT ${ PEXPECT } NAME ) 17add_custom_target ( 18test_ ${ PEXPECT } 19COMMAND ${ CMAKE_SOURCE_DIR } /tests/test_driver.py ${ CMAKE_CURRENT_BINARY_DIR } 20pexpects/ ${ PEXPECT } 21WORKING_DIRECTORY ${ CMAKE_SOURCE_DIR } /tests 22DEPENDS fish fish_indent fish_key_reader 23USES_TERMINAL 24) 25endforeach ( PEXPECT) 26 27# Rust stuff. 28set ( cargo_test_flags ) 29if ( DEFINED ASAN) 30# Rust w/ -Zsanitizer=address requires explicitly specifying the --target triple or else linker 31# errors pertaining to asan symbols will ensue. 32if ( NOT DEFINED Rust_CARGO_TARGET) 33message ( 34FATAL_ERROR 35"ASAN requires defining the CMake variable Rust_CARGO_TARGET to the 36intended target triple" 37) 38endif () 39endif () 40if ( DEFINED TSAN) 41if ( NOT DEFINED Rust_CARGO_TARGET) 42message ( 43FATAL_ERROR 44"TSAN requires defining the CMake variable Rust_CARGO_TARGET to the 45intended target triple" 46) 47endif () 48endif () 49 50if ( DEFINED Rust_CARGO_TARGET) 51list ( APPEND cargo_test_flags "--target" ${ Rust_CARGO_TARGET }) 52list ( APPEND cargo_test_flags "--lib" ) 53endif () 54 55set ( max_concurrency_flag ) 56if ( DEFINED ENV{FISH_TEST_MAX_CONCURRENCY}) 57list ( APPEND max_concurrency_flag "--max-concurrency" $ ENV { FISH_TEST_MAX_CONCURRENCY }) 58endif () 59 60# The top-level test target is "fish_run_tests". 61add_custom_target ( fish_run_tests 62# TODO: This should be replaced with a unified solution, possibly build_tools/check.sh. 63COMMAND ${ CMAKE_SOURCE_DIR } /tests/test_driver.py ${ max_concurrency_flag } ${ CMAKE_CURRENT_BINARY_DIR } 64COMMAND 65env ${ VARS_FOR_CARGO } ${ Rust_CARGO } 66test 67--no-default-features 68--features= ${ FISH_CARGO_FEATURES } 69${ CARGO_FLAGS } 70--workspace 71--target-dir ${ rust_target_dir } 72${ cargo_test_flags } 73WORKING_DIRECTORY " ${ CMAKE_SOURCE_DIR } " 74DEPENDS fish fish_indent fish_key_reader 75USES_TERMINAL 76)