commit: 96743d0fd0b33e04b4bcceccffef33dff6219c5c
parent 0b85e0da3d7de10bddb31bacb313ccb18f321dd6
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sat, 24 Aug 2024 04:16:59 +0200
Work around NetBSD lacking C.UTF-8
Diffstat:
4 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
@@ -30,7 +30,7 @@ MAN_EXAMPLES = cmd/readlink.1
TEST_LIBS = test-lib/mode test-lib/strtodur test-lib/symbolize_mode test-lib/truncation test-lib/sha1
.PHONY: check
check: all $(TEST_LIBS) check-man
- MALLOC_CHECK_=3 POSIX_ME_HARDER=1 POSIXLY_CORRECT=1 LC_ALL=C.UTF-8 LDSTATIC=$(LDSTATIC) kyua test || (kyua report --verbose --results-filter=broken,failed; false)
+ LDSTATIC=$(LDSTATIC) kyua test || (kyua report --verbose --results-filter=broken,failed; false)
MALLOC_CHECK_=3 POSIX_ME_HARDER=1 POSIXLY_CORRECT=1 LC_ALL=C.UTF-8 $(CRAM) test-cmd/*.t ${MAN_EXAMPLES}
.PHONY: check_status
diff --git a/test-cmd/cut.sh b/test-cmd/cut.sh
@@ -6,6 +6,7 @@ WD="$(dirname "$0")/../"
target="${WD}/cmd/cut"
plans=6
. "${WD}/test-cmd/tap.sh"
+. "${WD}/test-cmd/init_env.sh"
t 'bytes:2-3,10-20,4,12' "-b 2-3,10-20,4,12 ${WD}/test-cmd/inputs/alnum" '1239ABCDEFGHIJ
'
diff --git a/test-cmd/date.sh b/test-cmd/date.sh
@@ -5,6 +5,7 @@
target="$(dirname "$0")/../cmd/date"
plans=22
. "$(dirname "$0")/tap.sh"
+. "$(dirname "$0")/init_env.sh"
export TZ=UTC
export LC_ALL=C
diff --git a/test-cmd/init_env.sh b/test-cmd/init_env.sh
@@ -0,0 +1,7 @@
+#!/bin/false
+# SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
+# SPDX-License-Identifier: MPL-2.0
+
+export MALLOC_CHECK_=3 POSIX_ME_HARDER=1 POSIXLY_CORRECT=1 LC_ALL=C.UTF-8
+
+[ "$(uname -s)" = "NetBSD" ] && export LC_ALL=en_US.UTF-8