Bernhard Voelker wrote: ... > Here comes the full new patch. > > Have a nice day, > Berny > >>From b6a09d05d2794cc1df64a468e573729c92e37ad1 Mon Sep 17 00:00:00 2001 > From: Bernhard Voelker <[email protected]> > Date: Sat, 27 Oct 2012 13:24:18 +0200 > Subject: [PATCH] tests: shorten factor's inordinately-long test file names > > Besides what the subject says, this commit moves the test data > for the factor tests from tests/local.mk into the directory > tests/factor/ where it belongs. > > * tests/local.mk (EXTRA_DIST): Add new tests/factor/create-test.sh. > (p,q,t1,t2) Factor out the factor-related magic numbers. > (factor_tests): Rename the test names to t{00..36}.sh. Factor out > the triples of test data. > ($(factor_tests)): Add dependency to new > tests/factor/create-factor.sh. > Call that script to generate the test scripts. > * tests/factor/run.sh: Turn this script into a template, and > therefore remove it's executable permission bit. > Add template variables START, END and CKSUM, replacing the code > to split the test data from the test script's file name. > Use the new template variables in the call to seq and for > creating the exp file. > * tests/factor/create-test.sh: Add new script to create the > test scripts from the template tests/factor/run.sh. > Use test data and magic numbers factored out from the above > files. Let the script also change the __TEMPLATE__ line in > run.sh to make clear that the test scripts are generated. > * cfg.mk (sc_tests_list_consistency): Exempt the new test. > (exclude_file_name_regexp--sc_prohibit_test_backticks): > Likewise. > > Improved-by: Stefano Lattarini > Improved by: Jim Meyering > --- > cfg.mk | 4 +- > tests/factor/create-test.sh | 83 > +++++++++++++++++++++++++++++++++++++++++++ > tests/factor/run.sh | 22 ++++++----- > tests/local.mk | 70 ++++++++---------------------------- > 4 files changed, 112 insertions(+), 67 deletions(-) > create mode 100755 tests/factor/create-test.sh > mode change 100755 => 100644 tests/factor/run.sh > > diff --git a/cfg.mk b/cfg.mk > index 08f6c3d..ab0f0c6 100644 > --- a/cfg.mk > +++ b/cfg.mk > @@ -111,7 +111,7 @@ sc_tests_list_consistency: > for t in $(all_tests); do echo $$t; done; \ > cd $(top_srcdir); \ > $(SHELL) build-aux/vc-list-files tests \ > - | grep -Ev '^tests/(factor/run|init)\.sh$$' \ > + | grep -Ev '^tests/(factor/(run|create-test)|init)\.sh$$' \ > | $(EGREP) "$$test_extensions_rx\$$"; \ > } | sort | uniq -u | grep . && exit 1; : > > @@ -572,7 +572,7 @@ > exclude_file_name_regexp--sc_prohibit_continued_string_alpha_in_column_1 = \ > ^src/(system\.h|od\.c|printf\.c)$$ > > exclude_file_name_regexp--sc_prohibit_test_backticks = \ > - ^tests/(init\.sh|local.mk|misc/stdbuf\.sh)$$ > + ^tests/(init\.sh|local.mk|misc/stdbuf\.sh|factor/create-test.sh)$$
Thanks again. I noticed that there were two unescaped '.'s in that regexp, so I fixed the one in '.mk' and factored out the '\\.sh' suffix: - ^tests/(init\.sh|local.mk|misc/stdbuf\.sh|factor/create-test.sh)$$ + ^tests/(local\.mk|(init|misc/stdbuf|factor/create-test)\.sh)$$ With that, I pushed your change.
