Source-Changes-HG archive

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

[src/trunk]: src/tests/usr.bin/c++ Remove bogus architecture detection voodo ...



details:   https://anonhg.NetBSD.org/src/rev/1e1786bd4006
branches:  trunk
changeset: 1027704:1e1786bd4006
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Dec 16 16:30:55 2021 +0000

description:
Remove bogus architecture detection voodo - tsan is not available
on most architectures, so just state it that way.

diffstat:

 tests/usr.bin/c++/t_tsan_thread_leak.sh |  23 +++++------------------
 tests/usr.bin/c++/t_tsan_vptr_race.sh   |  24 ++++++------------------
 2 files changed, 11 insertions(+), 36 deletions(-)

diffs (127 lines):

diff -r a3387d0d1ef6 -r 1e1786bd4006 tests/usr.bin/c++/t_tsan_thread_leak.sh
--- a/tests/usr.bin/c++/t_tsan_thread_leak.sh   Thu Dec 16 11:36:25 2021 +0000
+++ b/tests/usr.bin/c++/t_tsan_thread_leak.sh   Thu Dec 16 16:30:55 2021 +0000
@@ -28,41 +28,33 @@
 
 test_target()
 {
-       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 thread_leak
 thread_leak_head() {
        atf_set "descr" "Test thread sanitizer for thread leak condition"
        atf_set "require.progs" "c++ paxctl"
+       test_target
 }
 
 atf_test_case thread_leak_profile
 thread_leak_profile_head() {
        atf_set "descr" "Test thread sanitizer for thread leak with profiling option"
        atf_set "require.progs" "c++ paxctl"
+       test_target
 }
 atf_test_case thread_leak_pic
 thread_leak_pic_head() {
        atf_set "descr" "Test thread sanitizer for thread leak with position independent code (PIC) flag"
        atf_set "require.progs" "c++ paxctl"
+       test_target
 }
 atf_test_case thread_leak_pie
 thread_leak_pie_head() {
        atf_set "descr" "Test thread sanitizer for thread leak with position independent execution (PIE) flag"
        atf_set "require.progs" "c++ paxctl"
+       test_target
 }
 
 thread_leak_body(){
@@ -202,11 +194,6 @@
 
 atf_init_test_cases()
 {
-       test_target
-       test $SUPPORT = 'n' && {
-               atf_add_test_case target_not_supported
-               return 0
-       }
        atf_add_test_case thread_leak
        atf_add_test_case thread_leak_profile
        atf_add_test_case thread_leak_pie
diff -r a3387d0d1ef6 -r 1e1786bd4006 tests/usr.bin/c++/t_tsan_vptr_race.sh
--- a/tests/usr.bin/c++/t_tsan_vptr_race.sh     Thu Dec 16 11:36:25 2021 +0000
+++ b/tests/usr.bin/c++/t_tsan_vptr_race.sh     Thu Dec 16 16:30:55 2021 +0000
@@ -26,43 +26,36 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
+
 test_target()
 {
-       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 vptr_race
 vptr_race_head() {
        atf_set "descr" "Test thread sanitizer for vptr race condition"
        atf_set "require.progs" "c++ paxctl"
+       test_target
 }
 
 atf_test_case vptr_race_profile
 vptr_race_profile_head() {
        atf_set "descr" "Test thread sanitizer for vptr race with profiling option"
        atf_set "require.progs" "c++ paxctl"
+       test_target
 }
 atf_test_case vptr_race_pic
 vptr_race_pic_head() {
        atf_set "descr" "Test thread sanitizer for vptr race with position independent code (PIC) flag"
        atf_set "require.progs" "c++ paxctl"
+       test_target
 }
 atf_test_case vptr_race_pie
 vptr_race_pie_head() {
        atf_set "descr" "Test thread sanitizer for vptr race with position independent execution (PIE) flag"
        atf_set "require.progs" "c++ paxctl"
+       test_target
 }
 
 vptr_race_body(){
@@ -226,11 +219,6 @@
 
 atf_init_test_cases()
 {
-       test_target
-       test $SUPPORT = 'n' && {
-               atf_add_test_case target_not_supported
-               return 0
-       }
        atf_add_test_case vptr_race
        atf_add_test_case vptr_race_profile
        atf_add_test_case vptr_race_pie



Home | Main Index | Thread Index | Old Index