Hash :
1d77ab5e
Author :
Date :
2010-11-05T15:51:56
tests: optimize `instspc-*.test' for speed After the split of `instspc.test' into various generated tests, the running time of the testsuite has noticeably increased, since all these new generated tests must run aclocal, autoconf and automake, whereas previously they were run only once (at the beginning of `instspc.test'). But luckily, since the new tests share the same input files for the autotools, this situation can be easily worked around (at the expenses of a slight increase of complexity for the testsuite scaffolding). * tests/instspc-data.test: New helper test, properly calling the `instspc-tests.sh' script to generate input data for the others `instspc-*.test' tests. * tests/Makefile.am (TESTS): Add `instspc-data.test'. ($(instspc_tests:.test=.log)): Depend on its log file. (instspc-data.log): Depend on `instspc-tests.sh'. * tests/instspc-tests.sh: Recognize new action `generate-data', and use it to create hand-written and autotools-generated static files shared by all the `instspc-*.test' tests. When sourced by the `instspc-*.test' tests, use those previously created files instead of recreating them from scratch. (unindent, create_input_data): New subroutines. Some other related changes and refactorings. From a suggestion by Ralf Wildenhues.
#! /bin/sh
# Copyright (C) 2011 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Helper testcase which generate input data for the other test
# `instspc-*.test'. It basically delegates the work to the helper
# script `instspc-test.sh'.
# Ensure proper definition of $testsrcdir.
. ./defs-static || exit 99
test -n "$testsrcdir" || exit 99 # sanity check
instspc_action=generate-data
. $testsrcdir/instspc-tests.sh