From 22ced06229064c48845c4409cdd897e19c0774a4 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Sun, 18 Nov 2007 18:01:24 +0100 Subject: [PATCH] * lib/autotest/general.m4 (at_func_test): Use cached line numbers to extract test scripts. (AT_INIT): Extract and cache test script line numbers. --- ChangeLog | 7 +++++++ lib/autotest/general.m4 | 16 ++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c8aa3777..409ee36b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-11-18 Paolo Bonzini + and Ralf Wildenhues + + * 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 * lib/autotest/general.m4: Revert 2007-11-15 patch and diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index 6855f319..53b00607 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -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="" } +/^@%:@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 -- 2.47.2