Module Name:    src
Committed By:   rillig
Date:           Tue Jul 13 18:50:16 UTC 2021

Modified Files:
        src/tests/usr.bin/xlint/lint1: Makefile t_integration.sh

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/tests/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r1.67 -r1.68 src/tests/usr.bin/xlint/lint1/t_integration.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/xlint/lint1/Makefile
diff -u src/tests/usr.bin/xlint/lint1/Makefile:1.86 src/tests/usr.bin/xlint/lint1/Makefile:1.87
--- src/tests/usr.bin/xlint/lint1/Makefile:1.86	Sun Jul 11 19:24:42 2021
+++ src/tests/usr.bin/xlint/lint1/Makefile	Tue Jul 13 18:50:16 2021
@@ -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 @@ sync-mi: .PHONY
 	cvs diff "$$mi" || true
 
 accept: .PHONY
-	@sh ./accept.sh ''
+	@archsubdir=${ARCHSUBDIR:Q} sh ./accept.sh ''
 
 .include <bsd.test.mk>

Index: src/tests/usr.bin/xlint/lint1/t_integration.sh
diff -u src/tests/usr.bin/xlint/lint1/t_integration.sh:1.67 src/tests/usr.bin/xlint/lint1/t_integration.sh:1.68
--- src/tests/usr.bin/xlint/lint1/t_integration.sh:1.67	Sun Jul 11 22:41:36 2021
+++ src/tests/usr.bin/xlint/lint1/t_integration.sh	Tue Jul 13 18:50:16 2021
@@ -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 @@ configure_test_case()
 	# 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 @@ configure_test_case()
 				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"
 		}

Reply via email to