autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFA] autotest speedup


From: Paolo Bonzini
Subject: [RFA] autotest speedup
Date: Thu, 04 Oct 2007 18:08:42 +0200
User-agent: Thunderbird 2.0.0.6 (Macintosh/20070728)

This speeds up autotest generation by ~6% (15.9 to 15.1 seconds) by outlining detection of tracing into a shell function, and removing the at_trace_this variable

More interesting, is the reduction in the size of the testsuite itself:

$ wc testsuite testsuite.old
 109574  335354 3177765 testsuite
 126643  374169 3466958 testsuite.old

That's around 9% reduction.  Test 53 test its correctness.  Ok to commit?

Paolo
2007-10-04  Paolo Bonzini  <address@hidden>

        * general.m4 (AT_INIT): Add at_check_newline function.
        (_AT_DECIDE_TRACEABLE): Include at_traceon test, use shell function.
        (_AT_CHECK): Don't use at_trace_this.

diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
index dfd098c..22f4179 100644
--- a/lib/autotest/general.m4
+++ b/lib/autotest/general.m4
@@ -212,6 +212,19 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # How were we run?
 at_cli_args="address@hidden"
 
+#######################
+### Shell functions ###
+#######################
+
+at_check_newline ()
+{
+  case "$[1]" in
+ *'
+'*) echo 'Not enabling shell tracing (command contains an embedded newline)' ; 
return 1 ;;
+ *) return 0 ;;
+  esac
+}
+
 # Load the config file.
 for at_file in atconfig atlocal
 do
@@ -1427,20 +1440,15 @@ m4_pushdef([at_reason],
 ))dnl
 dnl
 m4_ifval(m4_defn([at_reason]),
-[echo 'Not enabling shell tracing (command contains ]m4_defn([at_reason])[)'],
-[m4_bmatch([$1], [\$],
-dnl COMMANDS may contain parameter expansions; expand them at runtime.
-[case "AS_ESCAPE([$1], [`\"])" in
- *'
-'*) echo 'Not enabling shell tracing (command contains an embedded newline)' ;;
- *) at_trace_this=yes ;;
-    esac],
+[{ echo 'Not enabling shell tracing (command contains 
]m4_defn([at_reason])[)'; false; }],
+[m4_if(m4_index([$1], [$]), [-1],
 dnl We know at build time that tracing COMMANDS is always safe.
-[at_trace_this=yes])])[]dnl
+[test -n "$at_traceon"],
+dnl COMMANDS may contain parameter expansions; expand them at runtime.
+[test -n "$at_traceon" && at_check_newline "AS_ESCAPE([$1], [`\"])"])])[]dnl
 m4_popdef([at_lf])[]dnl
 m4_popdef([at_reason])])
 
-
 # _AT_CHECK(COMMANDS, [STATUS = 0], STDOUT, STDERR,
 #           [RUN-IF-FAIL], [RUN-IF-PASS], SHELL_ESCAPE_IO)
 # ---------------------------------------------------------
@@ -1479,12 +1487,7 @@ m4_define([_AT_CHECK],
 AS_ECHO(["$at_srcdir/AT_LINE: AS_ESCAPE([$1])"])
 echo AT_LINE >"$at_check_line_file"
 
-at_trace_this=
-if test -n "$at_traceon"; then
-    _AT_DECIDE_TRACEABLE([$1])
-fi
-
-if test -n "$at_trace_this"; then
+if _AT_DECIDE_TRACEABLE([$1]); then
     ( $at_traceon; $1 ) >"$at_stdout" 2>"$at_stder1"
     at_status=$?
     grep '^ *+' "$at_stder1" >&2

reply via email to

[Prev in Thread] Current Thread [Next in Thread]