]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] check: minor refactoring (reorder code)
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 7 May 2012 18:12:17 +0000 (20:12 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 16 May 2012 08:04:58 +0000 (10:04 +0200)
This is just movement and minor reorganization of code; no semantic
change is intended.

* lib/am/check.am (am__sh_e_setup): Moved ...
* lib/am/header-vars.am (am__sh_e_setup): ... here.
* lib/am/check.am (am__check_pre, am__common_driver_flags): Removed,
their contents merged ...
* lib/am/check2.am [%?FIRTS%] (am__runtest): ... into this.  Other
related whitespace and indentation changes since we are at it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
lib/am/check.am
lib/am/check2.am
lib/am/header-vars.am

index 46015cdeb2f1e4fcee8ef6222e824d770c8360b9..23eaef1248bf8cc044f91d50fca7530614995e37 100644 (file)
@@ -195,46 +195,6 @@ END { \
 # Restructured Text title.
 am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
 
-# Solaris 10 'make', and several other traditional 'make' implementations,
-# pass "-e" to $(SHELL), and POSIX 2008 even requires this.  Work around it
-# by disabling -e (using the XSI extension "set +e") if it's set.
-am__sh_e_setup = case $$- in *e*) set +e;; esac
-
-# Default flags passed to test drivers.
-am__common_driver_flags = \
-  --color-tests "$$am__color_tests" \
-  --enable-hard-errors "$$am__enable_hard_errors" \
-  --expect-failure "$$am__expect_failure"
-
-# To be inserted before the command running the test.  Creates the
-# directory for the log if needed.  Executes the developer-defined
-# test setup AM_TESTS_ENVIRONMENT (if any), and passes TESTS_ENVIRONMENT.
-# Set up options for the wrapper that will run the test scripts (or their
-# associated LOG_COMPILER, if they have one).
-am__check_pre =                                                \
-$(am__sh_e_setup);                                     \
-$(am__tty_colors);                                     \
-srcdir=$(srcdir); export srcdir;                       \
-test x$(@D) = x. || test -d $(@D) || $(MKDIR_P) $(@D) || exit $$?; \
-f='$(patsubst $(srcdir)/%,%,$<)';                      \
-## We need to invoke the test in way that won't cause a PATH search.
-## Quotes around '$<' are required to avoid extra errors when a circular
-## dependency is detected (e.g., because $(TEST_SUITE_LOG) is in
-## $(am__test_logs)), because in that case '$<' expands to empty and an
-## unquote usage of it could cause syntax errors in the shell.
-case '$<' in */*) tst='$<';; *) tst=./'$<';; esac;     \
-if test -n '$(DISABLE_HARD_ERRORS)'; then              \
-  am__enable_hard_errors=no;                           \
-else                                                   \
-  am__enable_hard_errors=yes;                          \
-fi;                                                    \
-f2='$(patsubst $(srcdir)/%,%,$*)';                     \
-case " $(am__xfail_test_bases) " in                    \
-  *" $$f2 "*) am__expect_failure=yes;;                 \
-           *) am__expect_failure=no;;                  \
-esac;                                                  \
-$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
-
 # This supports runtime overriding of $(TESTS) and $(XFAIL_TESTS).
 am__test_bases       = $(call am__get_test_bases, $(TESTS))
 am__xfail_test_bases = $(call am__get_test_bases, $(XFAIL_TESTS))
index a9a4a477f42775343700ad3ca770e57300b56050..b0f5b33eeb71eb01ed55019b610bbf239b58bf53 100644 (file)
 
 if %?FIRST%
 am__runtest = \
-  $(am__check_pre) \
-  $($(1)LOG_DRIVER) \
-  --test-name "$$f" \
-  --log-file $*.log \
-  --trs-file $*.trs \
-  $(am__common_driver_flags) \
-  $(AM_$(1)LOG_DRIVER_FLAGS) \
-  $($(1)LOG_DRIVER_FLAGS) \
-  -- \
-  $($(1)LOG_COMPILER) \
-  $(AM_$(1)LOG_FLAGS) \
-  $($(1)LOG_FLAGS) \
-  "$$tst" \
+  $(am__sh_e_setup);                                                   \
+  $(am__tty_colors);                                                   \
+  srcdir=$(srcdir); export srcdir;                                     \
+## Creates the directory for the log if needed.
+  test x$(@D) = x. || test -d $(@D) || $(MKDIR_P) $(@D) || exit $$?;   \
+  f='$(patsubst $(srcdir)/%,%,$<)';                                    \
+## We need to invoke the test in way that won't cause a PATH search.
+## Quotes around '$<' are required to avoid extra errors when a circular
+## dependency is detected (e.g., because $(TEST_SUITE_LOG) is in
+## $(am__test_logs)), because in that case '$<' expands to empty and an
+## unquote usage of it could cause syntax errors in the shell.
+  case '$<' in */*) tst='$<';; *) tst=./'$<';; esac;                   \
+  if test -n '$(DISABLE_HARD_ERRORS)'; then                            \
+    am__enable_hard_errors=no;                                                 \
+  else                                                                 \
+    am__enable_hard_errors=yes;                                        \
+  fi;                                                                  \
+  f2='$(patsubst $(srcdir)/%,%,$*)';                                   \
+  case " $(am__xfail_test_bases) " in                                  \
+    *" $$f2 "*) am__expect_failure=yes;;                               \
+             *) am__expect_failure=no;;                                        \
+  esac;                                                                \
+## Executes the developer-defined and user-defined test
+## setups (if any), in that order.
+  $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)                         \
+  $($(1)LOG_DRIVER)                                                    \
+  --test-name "$$f"                                                    \
+  --log-file $*.log                                                    \
+  --trs-file $*.trs                                                    \
+  --color-tests "$$am__color_tests"                                    \
+  --enable-hard-errors "$$am__enable_hard_errors"                      \
+  --expect-failure "$$am__expect_failure"                              \
+  $(AM_$(1)LOG_DRIVER_FLAGS)                                           \
+  $($(1)LOG_DRIVER_FLAGS)                                              \
+  --                                                                   \
+  $($(1)LOG_COMPILER)                                                  \
+  $(AM_$(1)LOG_FLAGS)                                                  \
+  $($(1)LOG_FLAGS)                                                     \
+  "$$tst"                                                              \
   $(AM_TESTS_FD_REDIRECT)
 endif %?FIRST%
 
index f6cb4370805e7838a7cca760b2a576647d656c72..386df1f8199c64c3991b3fba78b860adfe945264 100644 (file)
@@ -20,6 +20,11 @@ VPATH = @srcdir@
 ## position it is declared in the output Makefile.
 .DEFAULT_GOAL := all
 
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this.  Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+
 ## Emulate VPATH rewrites.  This uses only GNU make primitives, which
 ## allows us to avoid extra forks.
 am__vpath_rewrite = \