]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autotest/general.m4 (at_func_test): Use cached line numbers
authorPaolo Bonzini <bonzini@gnu.org>
Sun, 18 Nov 2007 17:01:24 +0000 (18:01 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 19 Nov 2007 20:19:15 +0000 (21:19 +0100)
to extract test scripts.
(AT_INIT): Extract and cache test script line numbers.

ChangeLog
lib/autotest/general.m4

index c8aa3777e0e3d04654fbbf2ffcaf2995c1c6695a..409ee36b9d1db45ba3defdcff6ae2a23376ded81 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-11-18  Paolo Bonzini  <bonzini@gnu.org>
+       and Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * lib/autotest/general.m4 (at_func_test): Use cached line numbers
+       to extract test scripts.
+       (AT_INIT): Extract and cache test script line numbers.
+
 2007-11-19  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * lib/autotest/general.m4: Revert 2007-11-15 patch and
index 6855f3195a0f01f9bb2c66f913a4ccdf6dfb0df6..53b0060744bf2143554df96e66c4268c88abb781 100644 (file)
@@ -316,8 +316,8 @@ at_func_diff_devnull ()
 # Parse out test NUMBER from the tail of this file.
 at_func_test ()
 {
-  sed -n '/^@%:@AT_START_'$[1]'$/,/^@%:@AT_STOP_'$[1]'$/p' "$at_myself" \
-       > "$at_test_source"
+  eval at_sed=\$at_sed$[1]
+  sed "$at_sed" "$at_myself" > "$at_test_source"
 }
 
 # at_func_create_debugging_script
@@ -872,6 +872,18 @@ else
   at_diff=diff
 fi
 
+# Extract the start and end lines of each test group at the tail
+# of this file
+awk '
+BEGIN { FS="\a" }
+/^@%:@AT_START_/ {
+  start = NR
+}
+/^@%:@AT_STOP_/ {
+  print "at_sed" substr ($ 0, 10) "=\"1," start "d;" NR "q\""
+}' "$at_myself" > "$at_test_source"
+. "$at_test_source"
+
 
 m4_text_box([Driver loop.])
 for at_group in $at_groups