Merge branch 'parallel-tests-performance' into maint
[platform/upstream/automake.git] / lib / am / check.am
index a65fef9..9cda82a 100644 (file)
@@ -18,23 +18,27 @@ am__tty_colors_dummy = \
   mgn= red= grn= lgn= blu= brg= std=; \
   am__color_tests=no
 if %?COLOR%
-# If stdout is a non-dumb tty, use colors.  If test -t is not supported,
-# then this fails; a conservative approach.  Of course do not redirect
-# stdout here, just stderr.
-am__tty_colors = \
-$(am__tty_colors_dummy); \
-test "X$(AM_COLOR_TESTS)" != Xno \
-&& test "X$$TERM" != Xdumb \
-&& { test "X$(AM_COLOR_TESTS)" = Xalways || test -t 1 2>/dev/null; } \
-&& { \
-  am__color_tests=yes; \
-  red='\e[0;31m'; \
-  grn='\e[0;32m'; \
-  lgn='\e[1;32m'; \
-  blu='\e[1;34m'; \
-  mgn='\e[0;35m'; \
-  brg='\e[1m'; \
-  std='\e[m'; \
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+## If stdout is a non-dumb tty, use colors.  If test -t is not supported,
+## then this check fails; a conservative approach.  Of course do not
+## redirect stdout here, just stderr.
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red='\e[0;31m'; \
+    grn='\e[0;32m'; \
+    lgn='\e[1;32m'; \
+    blu='\e[1;34m'; \
+    mgn='\e[0;35m'; \
+    brg='\e[1m'; \
+    std='\e[m'; \
+  fi; \
 }
 else !%?COLOR%
 am__tty_colors = $(am__tty_colors_dummy)
@@ -152,6 +156,7 @@ function rst_section(header) \
           fatal("failed to read from " $$0 ".log"); \
         print line; \
       }; \
+      printf "\n"; \
     }; \
 ## Don't leak open file descriptors, as this could cause serious
 ## problems when there are many tests (yes, even on Linux).
@@ -185,8 +190,12 @@ $(am__sh_e_setup);                                 \
 $(am__vpath_adj_setup) $(am__vpath_adj)                        \
 $(am__tty_colors);                                     \
 srcdir=$(srcdir); export srcdir;                       \
-am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;           \
-test "x$$am__odir" = x. || $(MKDIR_P) "$$am__odir" || exit $$?;        \
+case "$@" in                                           \
+  */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;;   \
+    *) am__odir=.;;                                    \
+esac;                                                  \
+test "x$$am__odir" = x"." || test -d "$$am__odir"      \
+  || $(MKDIR_P) "$$am__odir" || exit $$?;              \
 if test -f "./$$f"; then dir=./;                       \
 elif test -f "$$f"; then dir=;                         \
 else dir="$(srcdir)/"; fi;                             \