Source-Changes-HG archive

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

[src/trunk]: src/tests/usr.bin/xlint/lint1 tests/lint: take archsubdir from u...



details:   https://anonhg.NetBSD.org/src/rev/78fd62907ac8
branches:  trunk
changeset: 1022341:78fd62907ac8
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Jul 13 18:50:16 2021 +0000

description:
tests/lint: take archsubdir from usr.bin/xlint/Makefile.inc

This fixes the tests on the various ARM platforms where the platform
name does not correspond to MACHINE_ARCH, such as earmv7hf.

diffstat:

 tests/usr.bin/xlint/lint1/Makefile         |  10 ++++++++--
 tests/usr.bin/xlint/lint1/t_integration.sh |  15 +++++++--------
 2 files changed, 15 insertions(+), 10 deletions(-)

diffs (80 lines):

diff -r f4d8ee0f3bc4 -r 78fd62907ac8 tests/usr.bin/xlint/lint1/Makefile
--- a/tests/usr.bin/xlint/lint1/Makefile        Tue Jul 13 16:56:43 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/Makefile        Tue Jul 13 18:50:16 2021 +0000
@@ -1,13 +1,19 @@
-# $NetBSD: Makefile,v 1.86 2021/07/11 19:24:42 rillig Exp $
+# $NetBSD: Makefile,v 1.87 2021/07/13 18:50:16 rillig Exp $
 
 NOMAN=         # defined
 MAX_MESSAGE=   345             # see lint1/err.c
 
 .include <bsd.own.mk>
 
+ARCHSUBDIR!=   cd ${NETBSDSRCDIR}/usr.bin/xlint/lint1 && ${MAKE} -v ARCHSUBDIR
+
 TESTSDIR=      ${TESTSBASE}/usr.bin/xlint/lint1
 
 TESTS_SH=      t_integration
+TESTS_SH_SRC_t_integration=    archsubdir.sh t_integration.sh
+
+archsubdir.sh:
+       @echo archsubdir=${ARCHSUBDIR} >${.TARGET}
 
 FILESDIR=      ${TESTSDIR}
 FILES+=                c11_generic_expression.c
@@ -198,6 +204,6 @@
        cvs diff "$$mi" || true
 
 accept: .PHONY
-       @sh ./accept.sh ''
+       @archsubdir=${ARCHSUBDIR:Q} sh ./accept.sh ''
 
 .include <bsd.test.mk>
diff -r f4d8ee0f3bc4 -r 78fd62907ac8 tests/usr.bin/xlint/lint1/t_integration.sh
--- a/tests/usr.bin/xlint/lint1/t_integration.sh        Tue Jul 13 16:56:43 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/t_integration.sh        Tue Jul 13 18:50:16 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_integration.sh,v 1.67 2021/07/11 22:41:36 rillig Exp $
+# $NetBSD: t_integration.sh,v 1.68 2021/07/13 18:50:16 rillig Exp $
 #
 # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -26,8 +26,7 @@
 #
 
 lint1=/usr/libexec/lint1
-
-: "${machine_arch:="$(sysctl -n hw.machine_arch)"}"
+: "${archsubdir:=archsubdir_must_be_set}"
 
 
 configure_test_case()
@@ -37,7 +36,7 @@
        # shellcheck disable=SC2016
        awk='
                BEGIN {
-                       # see usr.bin/xlint/arch/.../targparam.h
+                       # see usr.bin/xlint/arch/*/targparam.h
                        platform["aarch64"]     = "schar lp64  long ldbl-128"
                        platform["alpha"]       = "schar lp64  long ldbl-64"
                        platform["arm"]         = "uchar ilp32 long ldbl-64"
@@ -68,15 +67,15 @@
                                printf("bad property '\''%s'\''\n", prop) > "/dev/stderr"
                                exit(1)
                        }
-                       if (platform[machine_arch] == "") {
-                               printf("bad machine_arch '\''%s'\''\n", machine_arch) > "/dev/stderr"
+                       if (platform[archsubdir] == "") {
+                               printf("bad archsubdir '\''%s'\''\n", archsubdir) > "/dev/stderr"
                                exit(1)
                        }
-                       return match(" " platform[machine_arch] " ", " " prop " ")
+                       return match(" " platform[archsubdir] " ", " " prop " ")
                }
 
                BEGIN {
-                       machine_arch = "'"$machine_arch"'"
+                       archsubdir = "'"$archsubdir"'"
                        flags = "-g -S -w"
                        skip = "no"
                }



Home | Main Index | Thread Index | Old Index