Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin Simplify test requirements: we only build tsan...



details:   https://anonhg.NetBSD.org/src/rev/2a539f2417a5
branches:  trunk
changeset: 938823:2a539f2417a5
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Sep 15 09:33:12 2020 +0000

description:
Simplify test requirements: we only build tsan for amd64 currently.

diffstat:

 tests/usr.bin/c++/t_tsan_data_race.sh            |  37 +++-------------------
 tests/usr.bin/c++/t_tsan_heap_use_after_free.sh  |  25 +++++----------
 tests/usr.bin/c++/t_tsan_lock_order_inversion.sh |  38 ++++-------------------
 tests/usr.bin/c++/t_tsan_locked_mutex_destroy.sh |  37 ++++------------------
 tests/usr.bin/c++/t_tsan_signal_errno.sh         |  37 +++-------------------
 tests/usr.bin/cc/t_tsan_data_race.sh             |  37 +++-------------------
 tests/usr.bin/cc/t_tsan_heap_use_after_free.sh   |  37 +++-------------------
 tests/usr.bin/cc/t_tsan_lock_order_inversion.sh  |  37 +++-------------------
 tests/usr.bin/cc/t_tsan_locked_mutex_destroy.sh  |  37 +++-------------------
 tests/usr.bin/cc/t_tsan_signal_errno.sh          |  37 +++-------------------
 tests/usr.bin/cc/t_tsan_thread_leak.sh           |  37 +++-------------------
 11 files changed, 71 insertions(+), 325 deletions(-)

diffs (truncated from 858 to 300 lines):

diff -r 31365ad2956e -r 2a539f2417a5 tests/usr.bin/c++/t_tsan_data_race.sh
--- a/tests/usr.bin/c++/t_tsan_data_race.sh     Tue Sep 15 09:32:31 2020 +0000
+++ b/tests/usr.bin/c++/t_tsan_data_race.sh     Tue Sep 15 09:33:12 2020 +0000
@@ -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 @@
        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 -r 31365ad2956e -r 2a539f2417a5 tests/usr.bin/c++/t_tsan_heap_use_after_free.sh
--- a/tests/usr.bin/c++/t_tsan_heap_use_after_free.sh   Tue Sep 15 09:32:31 2020 +0000
+++ b/tests/usr.bin/c++/t_tsan_heap_use_after_free.sh   Tue Sep 15 09:33:12 2020 +0000
@@ -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 @@
 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 @@
 }
 
 
-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 -r 31365ad2956e -r 2a539f2417a5 tests/usr.bin/c++/t_tsan_lock_order_inversion.sh
--- a/tests/usr.bin/c++/t_tsan_lock_order_inversion.sh  Tue Sep 15 09:32:31 2020 +0000
+++ b/tests/usr.bin/c++/t_tsan_lock_order_inversion.sh  Tue Sep 15 09:33:12 2020 +0000
@@ -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 @@
        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 -r 31365ad2956e -r 2a539f2417a5 tests/usr.bin/c++/t_tsan_locked_mutex_destroy.sh
--- a/tests/usr.bin/c++/t_tsan_locked_mutex_destroy.sh  Tue Sep 15 09:32:31 2020 +0000
+++ b/tests/usr.bin/c++/t_tsan_locked_mutex_destroy.sh  Tue Sep 15 09:33:12 2020 +0000
@@ -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 @@
 }
 
 
-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



Home | Main Index | Thread Index | Old Index