21571335 Enable system-test target for ggrep
authorApril Chin <april.chin@oracle.com>
Tue, 18 Aug 2015 23:37:58 -0700
changeset 4795 17cca748f778
parent 4794 be62c55aa235
child 4796 df74c4f80d70
21571335 Enable system-test target for ggrep
components/ggrep/Makefile
components/ggrep/system-test-patches/systest.patch
components/ggrep/test/results-64.master
--- a/components/ggrep/Makefile	Tue Aug 18 15:07:30 2015 -0700
+++ b/components/ggrep/Makefile	Tue Aug 18 23:37:58 2015 -0700
@@ -58,11 +58,37 @@
 # other than "test." 
 unexport SHELLOPTS
 
-# Test transforms to cut out compile lines
-COMPONENT_TEST_TRANSFORMS += '-e "/^  CC .*/d" ' \
-			     '-e "/^  CCLD .*/d" ' \
-			     '-e "/^  GEN .*/d" ' \
-                             '-e "/^  AR .*/d" '
+# Test transforms retain only relevant results output.
+COMPONENT_TEST_TRANSFORMS += \
+        '-n ' \
+        '-e "/TOTAL/p" ' \
+        '-e "/SKIP/p" ' \
+        '-e "/PASS/p" ' \
+        '-e "/FAIL/p" ' \
+        '-e "/ERROR/p" '
+
+# Putting GNU on path first prevents some tests from being skipped,
+# which also  keeps the test and system-test results consistent.
+# With the test target, the path to the just-built commands is
+# prepended to PATH.  With the system-test target, we patch
+# to prevent the PATH from being prepended.
+COMPONENT_TEST_ENV += "PATH=$(GNUBIN):$(PATH)"
+COMPONENT_SYSTEM_TEST_ENV += "PATH=$(GNUBIN):$(PATH)"
+
+# Patch to change test path so it tests grep commands from /usr/gnu/bin
+# installed on the test system. If we patch, we must re-configure the
+# tests.
+$(SOURCE_DIR)/.system-test-patched: $(SOURCE_DIR)/.prep
+	$(GPATCH) -d $(@D) $(GPATCH_FLAGS) < $(COMPONENT_DIR)/system-test-patches/systest.patch
+	$(TOUCH) $(@)
+
+# if we previously patched the source for the system-test target,
+# ensure we rebuild without that patch
+test-check:
+	if [ -e $(SOURCE_DIR)/.system-test-patched ]; then \
+	   cd $(COMPONENT_DIR); \
+	   $(GMAKE) clean build; \
+	fi
 
 # common targets
 configure:	$(CONFIGURE_64)
@@ -71,9 +97,9 @@
 
 install:	$(INSTALL_64)
 
-test:		$(TEST_64)
+test:		test-check $(TEST_64)
 
-system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
+system-test:    $(SOURCE_DIR)/.system-test-patched configure $(SYSTEM_TEST_64)
 
 
 REQUIRED_PACKAGES += library/pcre
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ggrep/system-test-patches/systest.patch	Tue Aug 18 23:37:58 2015 -0700
@@ -0,0 +1,33 @@
+Patch for system-test target is not appropriate for upstream
+
+--- grep-2.20-orig/tests/init.sh	2014-02-08 10:04:29.000000000 -0800
++++ grep-2.20/tests/init.sh	2015-08-17 14:04:07.099166503 -0700
[email protected]@ -406,11 +406,16 @@ create_exe_shims_ ()
+ 
+ # Use this function to prepend to PATH an absolute name for each
+ # specified, possibly-$initial_cwd_-relative, directory.
++
++# For system-test, we want to test the installed commands, not
++# the ones built in the src directory, so don't prepend src
+ path_prepend_ ()
+ {
+   while test $# != 0; do
+     path_dir_=$1
+     case $path_dir_ in
++      */src) shift 
++             continue;;
+       '') fail_ "invalid path dir: '$1'";;
+       /*) abs_path_dir_=$path_dir_;;
+       *) abs_path_dir_=$initial_cwd_/$path_dir_;;
+
+--- grep-2.20-orig/tests/Makefile.in	2015-08-04 15:02:58.000000000 -0700
++++ grep-2.20/tests/Makefile.in	2015-08-17 14:41:15.351985280 -0700
[email protected]@ -1470,7 +1470,7 @@ TESTS_ENVIRONMENT = \
+   PACKAGE_VERSION=$(PACKAGE_VERSION)		\
+   PERL='$(PERL)'				\
+   SHELL='$(SHELL)'				\
+-  PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH" \
++  PATH="$$PATH" \
+   ; 9>&2
+ 
+ LOG_COMPILER = $(SHELL)
--- a/components/ggrep/test/results-64.master	Tue Aug 18 15:07:30 2015 -0700
+++ b/components/ggrep/test/results-64.master	Tue Aug 18 23:37:58 2015 -0700
@@ -1,40 +1,9 @@
-make[1]: Entering directory `$(@D)'
-Making check in po
-make[2]: Entering directory `$(@D)/po'
-make[2]: Nothing to be done for `check'.
-make[2]: Leaving directory `$(@D)/po'
-Making check in lib
-make[2]: Entering directory `$(@D)/lib'
-/usr/gnu/bin/make  check-am
-make[3]: Entering directory `$(@D)/lib'
-make[3]: Nothing to be done for `check-am'.
-make[3]: Leaving directory `$(@D)/lib'
-make[2]: Leaving directory `$(@D)/lib'
-Making check in doc
-make[2]: Entering directory `$(@D)/doc'
-make[2]: Nothing to be done for `check'.
-make[2]: Leaving directory `$(@D)/doc'
-Making check in src
-make[2]: Entering directory `$(@D)/src'
-make[2]: Nothing to be done for `check'.
-make[2]: Leaving directory `$(@D)/src'
-Making check in tests
-make[2]: Entering directory `$(@D)/tests'
-/usr/gnu/bin/make  get-mb-cur-max
-make[3]: Entering directory `$(@D)/tests'
-make[3]: Leaving directory `$(@D)/tests'
-/usr/gnu/bin/make  check-TESTS
-make[3]: Entering directory `$(@D)/tests'
-make[4]: Entering directory `$(@D)/tests'
 PASS: backref
-backref-multibyte-slow: skipped test: your system has a non-GNU timeout program
-SKIP: backref-multibyte-slow
+PASS: backref-multibyte-slow
 PASS: backref-word
 PASS: backslash-s-and-repetition-operators
 PASS: backslash-s-vs-invalid-multitype
-big-hole: skipped test: expensive: disabled by default
 SKIP: big-hole
-big-match: skipped test: expensive: disabled by default
 SKIP: big-match
 PASS: bogus-wctob
 PASS: bre
@@ -51,37 +20,29 @@
 PASS: dfa-coverage
 PASS: dfa-heap-overrun
 PASS: dfaexec-multibyte
-empty: skipped test: your system has a non-GNU timeout program
-SKIP: empty
+PASS: empty
 PASS: empty-line
 PASS: epipe
 XFAIL: equiv-classes
 PASS: ere
 PASS: euc-mb
 PASS: fedora
-fgrep-infloop: skipped test: your system has a non-GNU timeout program
-SKIP: fgrep-infloop
+PASS: fgrep-infloop
 PASS: file
-fmbtest: skipped test: this system lacks the cs_CZ.UTF-8 locale
 SKIP: fmbtest
 PASS: foad1
 PASS: grep-dev-null
 PASS: grep-dir
 PASS: help-version
-in-eq-out-infloop: skipped test: your system has a non-GNU timeout program
-SKIP: in-eq-out-infloop
+PASS: in-eq-out-infloop
 PASS: include-exclude
 PASS: inconsistent-range
-invalid-multibyte-infloop: skipped test: your system has a non-GNU timeout program
-SKIP: invalid-multibyte-infloop
+PASS: invalid-multibyte-infloop
 PASS: khadafy
-long-line-vs-2GiB-read: skipped test: expensive: disabled by default
 SKIP: long-line-vs-2GiB-read
-max-count-overread: skipped test: your system has a non-GNU timeout program
-SKIP: max-count-overread
+PASS: max-count-overread
 PASS: max-count-vs-context
-mb-non-UTF8-performance: skipped test: your system has a non-GNU timeout program
-SKIP: mb-non-UTF8-performance
+PASS: mb-non-UTF8-performance
 PASS: multibyte-white-space
 PASS: multiple-begin-or-end-line
 PASS: null-byte
@@ -92,8 +53,7 @@
 PASS: options
 PASS: pcre
 PASS: pcre-abort
-pcre-infloop: skipped test: your system has a non-GNU timeout program
-SKIP: pcre-infloop
+PASS: pcre-infloop
 PASS: pcre-invalid-utf8-input
 PASS: pcre-utf8
 PASS: pcre-w
@@ -105,14 +65,12 @@
 PASS: repetition-overflow
 PASS: reversed-range-endpoints
 PASS: skip-device
-sjis-mb: skipped test: your system has a non-GNU timeout program
 SKIP: sjis-mb
 PASS: spencer1
 PASS: spencer1-locale
 PASS: status
 PASS: surrogate-pair
 PASS: symlink
-turkish-eyes: skipped test: your tr_TR.UTF-8 locale appears to be broken
 SKIP: turkish-eyes
 PASS: turkish-I
 PASS: turkish-I-without-dot
@@ -120,33 +78,13 @@
 PASS: word-delim-multibyte
 PASS: word-multi-file
 PASS: yesno
-============================================================================
-Testsuite summary for GNU grep 2.20
-============================================================================
 # TOTAL: 80
-# PASS:  65
-# SKIP:  14
+# PASS:  73
+# SKIP:  6
 # XFAIL: 1
 # FAIL:  0
 # XPASS: 0
 # ERROR: 0
-============================================================================
-make[4]: Leaving directory `$(@D)/tests'
-make[3]: Leaving directory `$(@D)/tests'
-make[2]: Leaving directory `$(@D)/tests'
-Making check in gnulib-tests
-make[2]: Entering directory `$(@D)/gnulib-tests'
-/usr/gnu/bin/make  check-recursive
-make[3]: Entering directory `$(@D)/gnulib-tests'
-Making check in .
-make[4]: Entering directory `$(@D)/gnulib-tests'
-/usr/gnu/bin/make  libtests.a test-alloca-opt test-argmatch test-binary-io test-bitrotate test-btowc test-c-ctype test-c-strcasecmp test-c-strncasecmp test-chdir test-cloexec test-close test-ctype test-dirent-safer test-dirent test-dup test-dup2 test-environ test-errno test-exclude test-fchdir test-fcntl-h test-fcntl-safer test-fcntl test-fdopen test-fdopendir test-fgetc test-float test-fnmatch test-fpending test-fputc test-fread test-fstat test-fstatat test-fwrite test-getcwd-lgpl test-getdtablesize test-getopt test-gettimeofday test-hash test-i-ring test-iconv-h test-iconv test-ignore-value test-intprops test-inttostr test-inttypes test-isatty test-isblank test-iswblank test-langinfo test-locale test-localeconv test-localename test-lseek test-lstat test-malloc-gnu test-malloca test-mbrtowc test-mbrtowc-w32 test-mbscasecmp test-mbsinit test-mbsrtowcs test-mbsstr1 test-mbsstr2 test-mbsstr3 test-memchr test-memchr2 test-memrchr test-nl_langinfo test-open test-openat-safer test-openat test-pathmax test-pipe test-quotearg-simple test-read test-realloc-gnu test-regex test-setenv test-setlocale1 test-setlocale2 test-snprintf test-stat test-stdbool test-stddef test-stdint test-stdio test-stdlib test-strerror test-striconv test-string test-strnlen test-strtoimax test-strtoll test-strtoull test-strtoumax test-symlink test-sys_stat test-sys_time test-sys_types test-time test-dup-safer test-unistd test-u8-mbtoucr test-u8-uctomb test-uc_width test-uc_width2 test-unsetenv test-vasnprintf test-verify test-version-etc test-wchar test-wcrtomb test-wcrtomb-w32 test-wctype-h test-wcwidth test-xalloc-die test-xstrtoimax test-xstrtol test-xstrtoul
-make[5]: Entering directory `$(@D)/gnulib-tests'
-"$(SOURCE_DIR)/gnulib-tests/test-xalloc-die.c", line 29: warning: statement not reached
-make[5]: Leaving directory `$(@D)/gnulib-tests'
-/usr/gnu/bin/make  check-TESTS
-make[5]: Entering directory `$(@D)/gnulib-tests'
-make[6]: Entering directory `$(@D)/gnulib-tests'
 PASS: test-alloca-opt
 PASS: test-argmatch
 PASS: test-binary-io.sh
@@ -292,9 +230,6 @@
 PASS: test-xalloc-die.sh
 PASS: test-xstrtoimax.sh
 PASS: test-xstrtol.sh
-============================================================================
-Testsuite summary for GNU grep 2.20
-============================================================================
 # TOTAL: 145
 # PASS:  134
 # SKIP:  11
@@ -302,12 +237,3 @@
 # FAIL:  0
 # XPASS: 0
 # ERROR: 0
-============================================================================
-make[6]: Leaving directory `$(@D)/gnulib-tests'
-make[5]: Leaving directory `$(@D)/gnulib-tests'
-make[4]: Leaving directory `$(@D)/gnulib-tests'
-make[3]: Leaving directory `$(@D)/gnulib-tests'
-make[2]: Leaving directory `$(@D)/gnulib-tests'
-make[2]: Entering directory `$(@D)'
-make[2]: Leaving directory `$(@D)'
-make[1]: Leaving directory `$(@D)'