From 7daa26d068e5e84eed1212e203c2ce79c074604c Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@fb.com>
Date: Tue, 27 Mar 2018 22:02:07 -0700
Subject: [PATCH] tests: don't run $(check_PROGRAMS) directly

testsuite/runtest was not portable to Solaris 10 /bin/sh, but was
used only to keep automake test machinery from running two compiled
binaries stand-alone.  We can inhibit that more cleanly by removing
those two files from the list of TESTS to run and then just remove
the offending script.
* testsuite/local.mk (LOG_COMPILER): Set to false.
(TESTS): Don't put $(check_PROGRAMS) on this list.
* testsuite/runtest: Remove file.
Nelson H.F. Beebe reported the Solaris 10 /bin/sh failure.
---
 testsuite/local.mk |  7 ++++---
 testsuite/runtest  | 26 --------------------------
 2 files changed, 4 insertions(+), 29 deletions(-)
 delete mode 100755 testsuite/runtest

diff --git a/testsuite/local.mk b/testsuite/local.mk
index eb535c9..72e2bfb 100644
--- a/testsuite/local.mk
+++ b/testsuite/local.mk
@@ -35,6 +35,9 @@ TESTSUITE_PERL_OPTIONS += -M"CuTmpdir qw($$f)"
 SH_LOG_COMPILER = $(SHELL)
 PL_LOG_COMPILER = $(TESTSUITE_PERL) $(TESTSUITE_PERL_OPTIONS)

+# Ensure that anything not covered by the above evokes failure.
+LOG_COMPILER = false
+
 # Put new, init.sh-using tests here, so that each name
 # is listed in only one place.

@@ -105,7 +108,7 @@ T += testsuite/8bit.sh			\
      testsuite/uniq.sh			\
      testsuite/xemacs.sh

-TESTS = $(check_PROGRAMS) $(SEDTESTS) $(T)
+TESTS = $(SEDTESTS) $(T)

 SEDTESTS =

@@ -166,8 +169,6 @@ TESTS_ENVIRONMENT =				\
   $(LOCALCHARSET_TESTS_ENVIRONMENT)		\
   ; 9>&2

-LOG_COMPILER = $(top_srcdir)/testsuite/runtest
-
 EXTRA_DIST += \
 	$(T) \
 	testsuite/Coreutils.pm					\
diff --git a/testsuite/runtest b/testsuite/runtest
deleted file mode 100755
index 4afec54..0000000
--- a/testsuite/runtest
+++ /dev/null
@@ -1,26 +0,0 @@
-#! /bin/sh
-
-# The test harness, used invoked through LOG_COMPILER
-# in testsuite/local.mk .
-# The two auxialiary programs (get-mb-cur-max and test-mbrtowc)
-# need to be compiled, but they are not stand-alone tests -
-# so they are skipped.
-
-. "${srcdir=.}/testsuite/init.sh"; path_prepend_ ./sed
-
-# Strip any leading directory names from the test name
-test=${1##*/}
-
-# Skip the utility programs, they are not standalone tests
-case "$test" in
-    get-mb-cur-max|test-mbrtowc)
-	# exit code 77 is automake's code for 'skip'.
-	exit 77
-	;;
-    *)
-	# should not happen. If it does - a sed developer
-	# made some mistake in 'testsuite/local.mk'.
-	echo "internal error: unknown test '$test' in $0" >&2 ;
-	exit 1
-	;;
-esac
-- 
2.17.0.rc1.35.g90bbd502d

