diff options
| author | martin <martin@NetBSD.org> | 2020-09-15 09:33:12 +0000 |
|---|---|---|
| committer | martin <martin@NetBSD.org> | 2020-09-15 09:33:12 +0000 |
| commit | b5b1c9c70ab65a516eb32f5d1f72f4d2afc67915 (patch) | |
| tree | bbadcc36be4c92860294a3e00f11eb704daf5422 /tests/usr.bin/c++ | |
| parent | 528017f2d8ffb4078ff690dd598570251c5452f0 (diff) | |
Simplify test requirements: we only build tsan for amd64 currently.
Diffstat (limited to 'tests/usr.bin/c++')
| -rw-r--r-- | tests/usr.bin/c++/t_tsan_data_race.sh | 37 | ||||
| -rw-r--r-- | tests/usr.bin/c++/t_tsan_heap_use_after_free.sh | 25 | ||||
| -rw-r--r-- | tests/usr.bin/c++/t_tsan_lock_order_inversion.sh | 38 | ||||
| -rw-r--r-- | tests/usr.bin/c++/t_tsan_locked_mutex_destroy.sh | 37 | ||||
| -rw-r--r-- | tests/usr.bin/c++/t_tsan_signal_errno.sh | 37 |
5 files changed, 35 insertions, 139 deletions
diff --git a/tests/usr.bin/c++/t_tsan_data_race.sh b/tests/usr.bin/c++/t_tsan_data_race.sh index 1434c1d3d57..d47ae570ba6 100644 --- a/tests/usr.bin/c++/t_tsan_data_race.sh +++ b/tests/usr.bin/c++/t_tsan_data_race.sh @@ -26,43 +26,35 @@ # POSSIBILITY OF SUCH DAMAGE. # -test_target() +tsan_available_archs() { - SUPPORT='n' - # Detect address space larger than 32 bits - maxaddress=`sysctl vm.maxaddress|awk '{print $3}'` - if [ $maxaddress -gt 4294967295 ]; then - if command -v cc >/dev/null 2>&1; then - if ! echo __clang__ | cc -E - | grep -q __clang__; then - SUPPORT='y' - elif ! cc -v 2>&1 | awk '/gcc version/{print $3}' | \ - awk -F '.' '($0+0) > 9 {exit 1}'; then - SUPPORT='y' - fi - fi - fi + atf_set "require.arch" "x86_64" } atf_test_case data_race data_race_head() { atf_set "descr" "Test thread sanitizer for data race condition" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } atf_test_case data_race_profile data_race_profile_head() { atf_set "descr" "Test thread sanitizer for data race with profiling option" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } atf_test_case data_race_pic data_race_pic_head() { atf_set "descr" "Test thread sanitizer for data race with position independent code (PIC) flag" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } atf_test_case data_race_pie data_race_pie_head() { atf_set "descr" "Test thread sanitizer for data race with position independent execution (PIE) flag" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } data_race_body(){ @@ -163,25 +155,8 @@ EOF atf_check -s ignore -o ignore -e match:"WARNING: ThreadSanitizer: data race " ./test } - -atf_test_case target_not_supported -target_not_supported_head() -{ - atf_set "descr" "Test forced skip" -} - -target_not_supported_body() -{ - atf_skip "Target is not supported" -} - atf_init_test_cases() { - test_target - test $SUPPORT = 'n' && { - atf_add_test_case target_not_supported - return 0 - } atf_add_test_case data_race atf_add_test_case data_race_profile atf_add_test_case data_race_pie diff --git a/tests/usr.bin/c++/t_tsan_heap_use_after_free.sh b/tests/usr.bin/c++/t_tsan_heap_use_after_free.sh index e85d3155ab2..433c69691ad 100644 --- a/tests/usr.bin/c++/t_tsan_heap_use_after_free.sh +++ b/tests/usr.bin/c++/t_tsan_heap_use_after_free.sh @@ -26,6 +26,11 @@ # POSSIBILITY OF SUCH DAMAGE. # +tsan_available_archs() +{ + atf_set "require.arch" "x86_64" +} + test_target() { SUPPORT='n' @@ -47,22 +52,26 @@ atf_test_case heap_use_after_free heap_use_after_free_head() { atf_set "descr" "Test thread sanitizer for use-after-free condition" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } atf_test_case heap_use_after_free_profile heap_use_after_free_profile_head() { atf_set "descr" "Test thread sanitizer for use-after-free with profiling option" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } atf_test_case heap_use_after_free_pic heap_use_after_free_pic_head() { atf_set "descr" "Test thread sanitizer for use-after-free with position independent code (PIC) flag" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } atf_test_case heap_use_after_free_pie heap_use_after_free_pie_head() { atf_set "descr" "Test thread sanitizer for use-after-free with position independent execution (PIE) flag" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } heap_use_after_free_body(){ @@ -200,24 +209,8 @@ EOF } -atf_test_case target_not_supported -target_not_supported_head() -{ - atf_set "descr" "Test forced skip" -} - -target_not_supported_body() -{ - atf_skip "Target is not supported" -} - atf_init_test_cases() { - test_target - test $SUPPORT = 'n' && { - atf_add_test_case target_not_supported - return 0 - } atf_add_test_case heap_use_after_free atf_add_test_case heap_use_after_free_profile atf_add_test_case heap_use_after_free_pie diff --git a/tests/usr.bin/c++/t_tsan_lock_order_inversion.sh b/tests/usr.bin/c++/t_tsan_lock_order_inversion.sh index 7dcb25f941a..4060b725aac 100644 --- a/tests/usr.bin/c++/t_tsan_lock_order_inversion.sh +++ b/tests/usr.bin/c++/t_tsan_lock_order_inversion.sh @@ -26,43 +26,36 @@ # POSSIBILITY OF SUCH DAMAGE. # -test_target() + +tsan_available_archs() { - SUPPORT='n' - # Detect address space larger than 32 bits - maxaddress=`sysctl vm.maxaddress|awk '{print $3}'` - if [ $maxaddress -gt 4294967295 ]; then - if command -v cc >/dev/null 2>&1; then - if ! echo __clang__ | cc -E - | grep -q __clang__; then - SUPPORT='y' - elif ! cc -v 2>&1 | awk '/gcc version/{print $3}' | \ - awk -F '.' '($0+0) > 9 {exit 1}'; then - SUPPORT='y' - fi - fi - fi + atf_set "require.arch" "x86_64" } atf_test_case lock_order_inversion lock_order_inversion_head() { atf_set "descr" "Test thread sanitizer for lock order inversion condition" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } atf_test_case lock_order_inversion_profile lock_order_inversion_profile_head() { atf_set "descr" "Test thread sanitizer for lock order inversion with profiling option" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } atf_test_case lock_order_inversion_pic lock_order_inversion_pic_head() { atf_set "descr" "Test thread sanitizer for lock order inversion with position independent code (PIC) flag" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } atf_test_case lock_order_inversion_pie lock_order_inversion_pie_head() { atf_set "descr" "Test thread sanitizer for lock order inversion with position independent execution (PIE) flag" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } lock_order_inversion_body(){ @@ -183,25 +176,8 @@ EOF atf_check -s ignore -o ignore -e match:"WARNING: ThreadSanitizer: lock-order-inversion" ./test } - -atf_test_case target_not_supported -target_not_supported_head() -{ - atf_set "descr" "Test forced skip" -} - -target_not_supported_body() -{ - atf_skip "Target is not supported" -} - atf_init_test_cases() { - test_target - test $SUPPORT = 'n' && { - atf_add_test_case target_not_supported - return 0 - } atf_add_test_case lock_order_inversion atf_add_test_case lock_order_inversion_profile atf_add_test_case lock_order_inversion_pie diff --git a/tests/usr.bin/c++/t_tsan_locked_mutex_destroy.sh b/tests/usr.bin/c++/t_tsan_locked_mutex_destroy.sh index 661b4dfebe2..102ef36dcb7 100644 --- a/tests/usr.bin/c++/t_tsan_locked_mutex_destroy.sh +++ b/tests/usr.bin/c++/t_tsan_locked_mutex_destroy.sh @@ -26,43 +26,36 @@ # POSSIBILITY OF SUCH DAMAGE. # -test_target() + +tsan_available_archs() { - SUPPORT='n' - # Detect address space larger than 32 bits - maxaddress=`sysctl vm.maxaddress|awk '{print $3}'` - if [ $maxaddress -gt 4294967295 ]; then - if command -v cc >/dev/null 2>&1; then - if ! echo __clang__ | cc -E - | grep -q __clang__; then - SUPPORT='y' - elif ! cc -v 2>&1 | awk '/gcc version/{print $3}' | \ - awk -F '.' '($0+0) > 9 {exit 1}'; then - SUPPORT='y' - fi - fi - fi + atf_set "require.arch" "x86_64" } atf_test_case locked_mutex_destroy locked_mutex_destroy_head() { atf_set "descr" "Test thread sanitizer for destroying locked mutex condition" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } atf_test_case locked_mutex_destroy_profile locked_mutex_destroy_profile_head() { atf_set "descr" "Test thread sanitizer for destroying locked mutex with profiling option" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } atf_test_case locked_mutex_destroy_pic locked_mutex_destroy_pic_head() { atf_set "descr" "Test thread sanitizer for destroying locked mutex with position independent code (PIC) flag" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } atf_test_case locked_mutex_destroy_pie locked_mutex_destroy_pie_head() { atf_set "descr" "Test thread sanitizer for destroying locked mutex with position independent execution (PIE) flag" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } locked_mutex_destroy_body(){ @@ -200,24 +193,8 @@ EOF } -atf_test_case target_not_supported -target_not_supported_head() -{ - atf_set "descr" "Test forced skip" -} - -target_not_supported_body() -{ - atf_skip "Target is not supported" -} - atf_init_test_cases() { - test_target - test $SUPPORT = 'n' && { - atf_add_test_case target_not_supported - return 0 - } atf_add_test_case locked_mutex_destroy atf_add_test_case locked_mutex_destroy_profile atf_add_test_case locked_mutex_destroy_pie diff --git a/tests/usr.bin/c++/t_tsan_signal_errno.sh b/tests/usr.bin/c++/t_tsan_signal_errno.sh index 2a8f63086e7..f3012000b6d 100644 --- a/tests/usr.bin/c++/t_tsan_signal_errno.sh +++ b/tests/usr.bin/c++/t_tsan_signal_errno.sh @@ -26,43 +26,35 @@ # POSSIBILITY OF SUCH DAMAGE. # -test_target() +tsan_available_archs() { - SUPPORT='n' - # Detect address space larger than 32 bits - maxaddress=`sysctl vm.maxaddress|awk '{print $3}'` - if [ $maxaddress -gt 4294967295 ]; then - if command -v cc >/dev/null 2>&1; then - if ! echo __clang__ | cc -E - | grep -q __clang__; then - SUPPORT='y' - elif ! cc -v 2>&1 | awk '/gcc version/{print $3}' | \ - awk -F '.' '($0+0) > 9 {exit 1}'; then - SUPPORT='y' - fi - fi - fi + atf_set "require.arch" "x86_64" } atf_test_case signal_errno signal_errno_head() { atf_set "descr" "Test thread sanitizer for errno modification in signal condition" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } atf_test_case signal_errno_profile signal_errno_profile_head() { atf_set "descr" "Test thread sanitizer for errno modification in signal with profiling option" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } atf_test_case signal_errno_pic signal_errno_pic_head() { atf_set "descr" "Test thread sanitizer for errno modification in signal with position independent code (PIC) flag" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } atf_test_case signal_errno_pie signal_errno_pie_head() { atf_set "descr" "Test thread sanitizer for errno modification in signal with position independent execution (PIE) flag" atf_set "require.progs" "c++ paxctl" + tsan_available_archs } signal_errno_body(){ @@ -187,25 +179,8 @@ EOF atf_check -s ignore -o ignore -e match:"WARNING: ThreadSanitizer: signal handler spoils errno" ./test } - -atf_test_case target_not_supported -target_not_supported_head() -{ - atf_set "descr" "Test forced skip" -} - -target_not_supported_body() -{ - atf_skip "Target is not supported" -} - atf_init_test_cases() { - test_target - test $SUPPORT = 'n' && { - atf_add_test_case target_not_supported - return 0 - } atf_add_test_case signal_errno atf_add_test_case signal_errno_profile atf_add_test_case signal_errno_pie |
