summaryrefslogtreecommitdiff
path: root/lib/Automake/tests/Version.pl
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-01-18 12:17:11 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2012-01-18 13:31:55 +0100
commitfbeda3da9d12736b3dcc6d1e11e9f2f09cf4ce96 (patch)
tree948997a0e5488f32f6cfb1aa7bc7244d670488e9 /lib/Automake/tests/Version.pl
parent2a9862a89875f9060f95547b6fd4274c86738617 (diff)
downloadautomake-fbeda3da9d12736b3dcc6d1e11e9f2f09cf4ce96.tar.gz
tests: move all under the same hierarchy ('tests/' directory)
This simplifies the organization of the Automake source tree and reduces the (lamentably high) number of Makefiles in the Automake build system by one. It also makes the maintainer check that verifies the consistency of list of tests more self-contained and simpler. Finally, it might be a first step forward the transition to a non-recursive build system for automake (if we ever decide to go down that road fully some day). * lib/Automake/tests: All the '*.pl' tests in here moved ... * tests/pm: ... into this new directory. * lib/Automake/tests/Makefile.am: Remove, its meaningful contents moved ... * tests/Makefile.am: ... here, with obvious adjustments. (test_subdirs): New variable, for the sake of the recipe of 'maintainer-check-list-of-tests'. * CheckListOfTests (maintainer-check-list-of-tests): Enhance its recipe to make it able to deal with test script residing in subdirectories. * Makefile.am (maintainer-check-list-of-tests): Simplified. (TEST_SUBDIRS): Remove, no more needed. * tests/list-of-tests.mk (perl_TESTS): New variable, lists the '.pl' tests just moved into 'tests/pm'. (handwritten_TESTS): Add the contents of '$(perl_TESTS)'. * lib/Automake/Makefile.am (SUBDIRS): Remove. * configure.ac (AC_CONFIG_FILES): Update. * .gitignore: Adjust.
Diffstat (limited to 'lib/Automake/tests/Version.pl')
-rw-r--r--lib/Automake/tests/Version.pl99
1 files changed, 0 insertions, 99 deletions
diff --git a/lib/Automake/tests/Version.pl b/lib/Automake/tests/Version.pl
deleted file mode 100644
index e49643519..000000000
--- a/lib/Automake/tests/Version.pl
+++ /dev/null
@@ -1,99 +0,0 @@
-# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
-#
-# This file is part of GNU Automake.
-#
-# GNU Automake 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.
-#
-# GNU Automake 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/>.
-
-use Automake::Version;
-
-my $failed = 0;
-
-sub test_version_compare
-{
- my ($left, $right, $result) = @_;
- my @leftver = Automake::Version::split ($left);
- my @rightver = Automake::Version::split ($right);
- if ($#leftver == -1)
- {
- print "can't grok \"$left\"\n";
- $failed = 1;
- return;
- }
- if ($#rightver == -1)
- {
- print "can't grok \"$right\"\n";
- $failed = 1;
- return;
- }
- my $res = Automake::Version::compare (@leftver, @rightver);
- if ($res != $result)
- {
- print "compare (\"$left\", \"$right\") = $res! (not $result?)\n";
- $failed = 1;
- }
-}
-
-my @tests = (
-# basics
- ['1.0', '2.0', -1],
- ['2.0', '1.0', 1],
- ['1.2', '1.2', 0],
- ['1.1', '1.2', -1],
- ['1.2', '1.1', 1],
-# alphas
- ['1.4', '1.4g', -1],
- ['1.4g', '1.5', -1],
- ['1.4g', '1.4', 1],
- ['1.5', '1.4g', 1],
- ['1.4a', '1.4g', -1],
- ['1.5a', '1.3g', 1],
- ['1.6a', '1.6a', 0],
-# micros
- ['1.5.1', '1.5', 1],
- ['1.5.0', '1.5', 0],
- ['1.5.4', '1.6.1', -1],
-# micros and alphas
- ['1.5a', '1.5.1', 1],
- ['1.5a', '1.5.1a', 1],
- ['1.5a', '1.5.1f', 1],
- ['1.5', '1.5.1a', -1],
- ['1.5.1a', '1.5.1f', -1],
-# special exceptions
- ['1.6-p5a', '1.6.5a', 0],
- ['1.6', '1.6-p5a', -1],
- ['1.6-p4b', '1.6-p5a', -1],
- ['1.6-p4b', '1.6-foo', 1],
- ['1.6-p4b', '1.6a-foo', -1]
-);
-
-test_version_compare (@{$_}) foreach @tests;
-
-exit $failed;
-
-### Setup "GNU" style for perl-mode and cperl-mode.
-## Local Variables:
-## perl-indent-level: 2
-## perl-continued-statement-offset: 2
-## perl-continued-brace-offset: 0
-## perl-brace-offset: 0
-## perl-brace-imaginary-offset: 0
-## perl-label-offset: -2
-## cperl-indent-level: 2
-## cperl-brace-offset: 0
-## cperl-continued-brace-offset: 0
-## cperl-label-offset: -2
-## cperl-extra-newline-before-brace: t
-## cperl-merge-trailing-else: nil
-## cperl-continued-statement-offset: 2
-## End: