git: b0f058525b5b - stable/14 - awk: Fix the tests

From: Warner Losh <imp_at_FreeBSD.org>
Date: Tue, 12 Mar 2024 14:49:10 UTC
The branch stable/14 has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=b0f058525b5b67e140b6c1ae9415092175290d97

commit b0f058525b5b67e140b6c1ae9415092175290d97
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-03-08 05:40:43 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-03-12 04:53:47 +0000

    awk: Fix the tests
    
    I'd forgotten that we have to adjust the stderr tests from
    upstream. Remove the OK files. Also remove system-status.*.  These
    restore the fixes I made in 517e52b6c21c which were lost when I imported
    the last version of awk.
    
    Also, force LANG to be C.UTF-8 when testing to ensure that stray lang
    settings don't fail tests.
    
    Sponsored by:           Netflix
    
    (cherry picked from commit ba7b7f94c239ce43343d7af403734fdc941b7664)
---
 contrib/one-true-awk/bugs-fixed/missing-precision.ok |  2 --
 contrib/one-true-awk/bugs-fixed/negative-nf.ok       |  2 --
 contrib/one-true-awk/bugs-fixed/pfile-overflow.ok    |  4 ----
 contrib/one-true-awk/bugs-fixed/system-status.awk    | 19 -------------------
 contrib/one-true-awk/bugs-fixed/system-status.bad    |  3 ---
 contrib/one-true-awk/bugs-fixed/system-status.ok     |  3 ---
 contrib/one-true-awk/bugs-fixed/system-status.ok2    |  3 ---
 usr.bin/awk/tests/bugs-fixed/bug_fix_test.sh         |  1 +
 8 files changed, 1 insertion(+), 36 deletions(-)

diff --git a/contrib/one-true-awk/bugs-fixed/missing-precision.ok b/contrib/one-true-awk/bugs-fixed/missing-precision.ok
deleted file mode 100644
index 75e1e3d00446..000000000000
--- a/contrib/one-true-awk/bugs-fixed/missing-precision.ok
+++ /dev/null
@@ -1,2 +0,0 @@
-../a.out: not enough args in printf(%*s)
- source line number 1
diff --git a/contrib/one-true-awk/bugs-fixed/negative-nf.ok b/contrib/one-true-awk/bugs-fixed/negative-nf.ok
deleted file mode 100644
index de97f8b27def..000000000000
--- a/contrib/one-true-awk/bugs-fixed/negative-nf.ok
+++ /dev/null
@@ -1,2 +0,0 @@
-../a.out: cannot set NF to a negative value
- source line number 1
diff --git a/contrib/one-true-awk/bugs-fixed/pfile-overflow.ok b/contrib/one-true-awk/bugs-fixed/pfile-overflow.ok
deleted file mode 100644
index a0de50f9007f..000000000000
--- a/contrib/one-true-awk/bugs-fixed/pfile-overflow.ok
+++ /dev/null
@@ -1,4 +0,0 @@
-../a.out: syntax error at source line 1 source file pfile-overflow.awk
- context is
-	 >>>  <<< 
-../a.out: bailing out at source line 1 source file pfile-overflow.awk
diff --git a/contrib/one-true-awk/bugs-fixed/system-status.awk b/contrib/one-true-awk/bugs-fixed/system-status.awk
deleted file mode 100644
index 8daf563e6f4f..000000000000
--- a/contrib/one-true-awk/bugs-fixed/system-status.awk
+++ /dev/null
@@ -1,19 +0,0 @@
-# Unmodified nawk prints the 16 bit exit status divided by 256, but
-# does so using floating point arithmetic, yielding strange results.
-#
-# The fix is to use the various macros defined for wait(2) and to
-# use the signal number + 256 for death by signal, or signal number + 512
-# for death by signal with core dump.
-
-BEGIN {
-	status = system("exit 42")
-	print "normal status", status
-
-	status = system("kill -HUP $$")
-	print "death by signal status", status
-
-	status = system("kill -ABRT $$")
-	print "death by signal with core dump status", status
-
-	system("rm -f core*")
-}
diff --git a/contrib/one-true-awk/bugs-fixed/system-status.bad b/contrib/one-true-awk/bugs-fixed/system-status.bad
deleted file mode 100644
index a1317dba54a8..000000000000
--- a/contrib/one-true-awk/bugs-fixed/system-status.bad
+++ /dev/null
@@ -1,3 +0,0 @@
-normal status 42
-death by signal status 0.00390625
-death by signal with core dump status 0.523438
diff --git a/contrib/one-true-awk/bugs-fixed/system-status.ok b/contrib/one-true-awk/bugs-fixed/system-status.ok
deleted file mode 100644
index 737828f5ed7a..000000000000
--- a/contrib/one-true-awk/bugs-fixed/system-status.ok
+++ /dev/null
@@ -1,3 +0,0 @@
-normal status 42
-death by signal status 257
-death by signal with core dump status 518
diff --git a/contrib/one-true-awk/bugs-fixed/system-status.ok2 b/contrib/one-true-awk/bugs-fixed/system-status.ok2
deleted file mode 100644
index f1f631e1cb33..000000000000
--- a/contrib/one-true-awk/bugs-fixed/system-status.ok2
+++ /dev/null
@@ -1,3 +0,0 @@
-normal status 42
-death by signal status 257
-death by signal with core dump status 262
diff --git a/usr.bin/awk/tests/bugs-fixed/bug_fix_test.sh b/usr.bin/awk/tests/bugs-fixed/bug_fix_test.sh
index 7c8cfa47f99e..588e2f86b0b7 100644
--- a/usr.bin/awk/tests/bugs-fixed/bug_fix_test.sh
+++ b/usr.bin/awk/tests/bugs-fixed/bug_fix_test.sh
@@ -25,6 +25,7 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
+export LANG=C.UTF-8
 SRCDIR=$(atf_get_srcdir)
 
 check()