[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/32] gen-tests: less hard-coding of 't' as the test directory
From: |
Stefano Lattarini |
Subject: |
[PATCH 06/32] gen-tests: less hard-coding of 't' as the test directory |
Date: |
Thu, 26 Jul 2012 14:04:32 +0200 |
This will make life easier for us in case we decide to rename the
testsuite directory in the future (perhaps to something like 'tests',
which is somewhat less cryptic than the current 't').
* gen-testsuite-part ($testdir): New variable, used throughout instead
of hard-coding the name of the test directory to 't'.
All the script adjusted to make proper use of '$testdir'.
($auxdir): Move its definition earlier, for consistency with the one
of '$testdir'.
Signed-off-by: Stefano Lattarini <address@hidden>
---
gen-testsuite-part | 33 ++++++++++++++++++---------------
1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/gen-testsuite-part b/gen-testsuite-part
index 25da45c..b968926 100755
--- a/gen-testsuite-part
+++ b/gen-testsuite-part
@@ -31,6 +31,13 @@ my $me = File::Basename::basename $0;
# For use in VPATH builds.
my $srcdir = ".";
+# The testsuite subdirectory, relative to the top-lever source directory.
+my $testdir = "t";
+
+# Where testsuite-related helper scripts, data files and shell libraries
+# are placed. Relative to the '$testdir' subdirectory.
+my $auxdir = "ax";
+
#--------------------------------------------------------------------------
sub unindent ($)
@@ -109,7 +116,7 @@ sub get_list_of_tests ()
my $make = defined $ENV{MAKE} ? $ENV{MAKE} : "make";
# Unset MAKEFLAGS, for when we are called from make itself.
my $cmd = "MAKEFLAGS= && unset MAKEFLAGS && cd '$srcdir' && "
- . "$make -s -f t/list-of-tests.mk print-list-of-tests";
+ . "$make -s -f $testdir/list-of-tests.mk print-list-of-tests";
my @tests_list = split /\s+/, `$cmd`;
die "$me: cannot get list of tests\n" unless $? == 0 && @tests_list;
my $ok = 1;
@@ -135,52 +142,48 @@ sub parse_options (@)
#--------------------------------------------------------------------------
-# Where testsuite-related helper scripts, data files and shell libraries
-# are placed. Relative to the 't/' subdirectory.
-my $auxdir = "ax";
-
my %deps_extractor =
(
libtool_macros =>
{
line_matcher => qr/^\s*required=.*\blibtool/,
- nodist_prereqs => "t/libtool-macros.log",
+ nodist_prereqs => "$testdir/libtool-macros.log",
},
gettext_macros =>
{
line_matcher => qr/^\s*required=.*\bgettext/,
- nodist_prereqs => "t/gettext-macros.log",
+ nodist_prereqs => "$testdir/gettext-macros.log",
},
use_trivial_test_driver =>
{
line_matcher => qr/\btrivial-test-driver\b/,
- dist_prereqs => "t/$auxdir/trivial-test-driver",
+ dist_prereqs => "$testdir/$auxdir/trivial-test-driver",
},
check_testsuite_summary =>
{
line_matcher => qr/\btestsuite-summary-checks\.sh\b/,
- dist_prereqs => "t/$auxdir/testsuite-summary-checks.sh",
+ dist_prereqs => "$testdir/$auxdir/testsuite-summary-checks.sh",
},
extract_testsuite_summary =>
{
line_matcher => qr/\bextract-testsuite-summary\.pl\b/,
- dist_prereqs => "t/$auxdir/extract-testsuite-summary.pl",
+ dist_prereqs => "$testdir/$auxdir/extract-testsuite-summary.pl",
},
check_tap_testsuite_summary =>
{
line_matcher => qr/\btap-summary-aux\.sh\b/,
- dist_prereqs => "t/$auxdir/tap-summary-aux.sh",
+ dist_prereqs => "$testdir/$auxdir/tap-summary-aux.sh",
},
on_tap_with_common_setup =>
{
line_matcher => qr/\btap-setup\.sh\b/,
- dist_prereqs => "t/$auxdir/tap-setup.sh",
- nodist_prereqs => "t/tap-common-setup.log",
+ dist_prereqs => "$testdir/$auxdir/tap-setup.sh",
+ nodist_prereqs => "$testdir/tap-common-setup.log",
},
depcomp =>
{
line_matcher => qr/\bdepcomp\.sh\b/,
- dist_prereqs => "t/$auxdir/depcomp.sh",
+ dist_prereqs => "$testdir/$auxdir/depcomp.sh",
},
);
@@ -344,7 +347,7 @@ foreach my $lt (TRUE, FALSE)
"depmode=$m",
"depcomp_with_libtool=" . ($lt ? "yes" : "no"),
);
- my $test = "t/depcomp" . ($lt ? "-lt-" : "-") . $m . ".tap";
+ my $test = "$testdir/depcomp" . ($lt ? "-lt-" : "-") . "$m.tap";
# Register wrapper test as "autogenerated" ...
push @generated_tests, $test;
# ... and create it.
--
1.7.12.rc0
- [PATCH 00/32] {maint} Several testsuite refactorings, Stefano Lattarini, 2012/07/26
- [PATCH 01/32] cosmetics: remove leftover comment fragment from runtest.in, Stefano Lattarini, 2012/07/26
- [PATCH 05/32] build: auxiliary testsuite files/scripts built by "make all", Stefano Lattarini, 2012/07/26
- [PATCH 03/32] runtest: pass *all* the given shell options to the test invocation, Stefano Lattarini, 2012/07/26
- [PATCH 07/32] gen-tests: $testdir/ax -> $testauxdir, Stefano Lattarini, 2012/07/26
- [PATCH 02/32] runtest: correctly pass shell option also for TAP tests, Stefano Lattarini, 2012/07/26
- [PATCH 04/32] perf tests: reorganize, Stefano Lattarini, 2012/07/26
- [PATCH 09/32] tests: update PATH early from AM_TESTS_ENVIRONMENT and runtest, Stefano Lattarini, 2012/07/26
- [PATCH 06/32] gen-tests: less hard-coding of 't' as the test directory,
Stefano Lattarini <=
- [PATCH 10/32] test defs: move in 't/ax/test-defs.sh', Stefano Lattarini, 2012/07/26
- [PATCH 08/32] runtest: export $srcdir for use by the test scripts, Stefano Lattarini, 2012/07/26
- [PATCH 12/32] test init: remove a couple of paranoid sanity checks, Stefano Lattarini, 2012/07/26
- [PATCH 15/32] test init: refactor: new function 'am_exit_trap', Stefano Lattarini, 2012/07/26
- [PATCH 14/32] test init: refactor: new function 'process_requirements', Stefano Lattarini, 2012/07/26
- [PATCH 18/32] test init: refactor: new function 'am_setup_testdir', Stefano Lattarini, 2012/07/26
- [PATCH 13/32] test init: refactor: new function 'require_tool', Stefano Lattarini, 2012/07/26
- [PATCH 17/32] test init: refactor: new function 'am_set_exit_traps', Stefano Lattarini, 2012/07/26
- [PATCH 11/32] tests: simplify sourcing of helper shell files, Stefano Lattarini, 2012/07/26
- [PATCH 19/32] test init: refactor: move displaying of debugging info later, Stefano Lattarini, 2012/07/26