From dad5b2c52d5d8341585e39579068756e2ac7d931 Mon Sep 17 00:00:00 2001 From: Matthias Paulmier Date: Tue, 26 Jun 2018 15:35:17 +0200 Subject: t/pm: Regroup tests by module Since we don't have to worry anymore about the tests "fataling" out we can put the then separated tests into the appropriate files. --- t/list-of-tests.mk | 9 +-------- t/pm/Cond2.pl | 27 --------------------------- t/pm/Cond3.pl | 27 --------------------------- t/pm/Condition.pl | 26 +++++++++++++++++++++++++- t/pm/DisjCon2.pl | 30 ------------------------------ t/pm/DisjCon3.pl | 29 ----------------------------- t/pm/DisjConditions.pl | 26 +++++++++++++++++++++++++- t/pm/Version.pl | 15 +++++++++++++++ t/pm/Version2.pl | 25 ------------------------- t/pm/Version3.pl | 25 ------------------------- 10 files changed, 66 insertions(+), 173 deletions(-) delete mode 100644 t/pm/Cond2.pl delete mode 100644 t/pm/Cond3.pl delete mode 100644 t/pm/DisjCon2.pl delete mode 100644 t/pm/DisjCon3.pl delete mode 100644 t/pm/Version2.pl delete mode 100644 t/pm/Version3.pl diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 0b360b339..5442a3b4c 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -31,25 +31,18 @@ t/objext-pr10128.sh \ t/remake-timing-bug-pr8365.sh \ t/lex-subobj-nodep.sh \ t/remake-am-pr10111.sh \ -t/remake-m4-pr10111.sh \ -$(perl_fake_XFAIL_TESTS) +t/remake-m4-pr10111.sh perl_TESTS = \ t/pm/Channels.pl \ -t/pm/Cond2.pl \ -t/pm/Cond3.pl \ t/pm/Condition.pl \ t/pm/Condition-t.pl \ t/pm/CondStack.pl \ -t/pm/DisjCon2.pl \ -t/pm/DisjCon3.pl \ t/pm/DisjConditions.pl \ t/pm/DisjConditions-t.pl \ t/pm/General.pl \ t/pm/Utils.pl \ t/pm/Version.pl \ -t/pm/Version2.pl \ -t/pm/Version3.pl \ t/pm/Wrap.pl perf_TESTS = \ diff --git a/t/pm/Cond2.pl b/t/pm/Cond2.pl deleted file mode 100644 index 882daa99f..000000000 --- a/t/pm/Cond2.pl +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (C) 2011-2018 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 . - -# Catch common programming error: -# A Condition passed as a string to 'new'. - -use Automake::Condition; - -my $cond = new Automake::Condition ('TRUE'); -eval { new Automake::Condition ($cond) }; - -warn $@ if $@; - -exit 0 if $@; -exit 1; diff --git a/t/pm/Cond3.pl b/t/pm/Cond3.pl deleted file mode 100644 index 0294d74b6..000000000 --- a/t/pm/Cond3.pl +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (C) 2011-2018 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 . - -# Catch common programming error: -# A Condition passed as a string to 'new'. - -use Automake::Condition; - -my $cond = new Automake::Condition ("COND1_TRUE"); -eval { new Automake::Condition ("$cond") }; - -warn $@ if $@; - -exit 0 if $@; -exit 1; diff --git a/t/pm/Condition.pl b/t/pm/Condition.pl index 21021b555..58f89b3ae 100644 --- a/t/pm/Condition.pl +++ b/t/pm/Condition.pl @@ -253,8 +253,32 @@ sub test_merge () return 0; } +sub test_bad_declarations () +{ + my $failed = 0; + + # Catch error: + # A condition object passed to 'new' + my $cond1 = new Automake::Condition ('TRUE'); + eval { new Automake::Condition ($cond1) }; + + warn $@ if $@; + $failed = 1 unless $@; + $@ = ''; + + # Catch common programming error: + # A Condition passed as a string to 'new'. + my $cond2 = new Automake::Condition ("COND1_TRUE"); + eval { new Automake::Condition ("$cond2") }; + + warn $@ if $@; + $failed = 1 unless $@; + return $failed; +} + exit (test_basics || test_true_when || test_reduce_and || test_reduce_or - || test_merge); + || test_merge + || test_bad_declarations); diff --git a/t/pm/DisjCon2.pl b/t/pm/DisjCon2.pl deleted file mode 100644 index 2bfd51ab0..000000000 --- a/t/pm/DisjCon2.pl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (C) 2011-2018 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 . - -# Catch common programming error: -# A non-Condition reference passed to new. - -use Automake::Condition; -use Automake::DisjConditions; - -my $cond = new Automake::Condition ('TRUE'); -my $cond2 = new Automake::DisjConditions ($cond); - -eval { new Automake::DisjConditions ($cond2) }; - -warn $@ if $@; - -exit 0 if $@; -exit 1; diff --git a/t/pm/DisjCon3.pl b/t/pm/DisjCon3.pl deleted file mode 100644 index 6ccd734f7..000000000 --- a/t/pm/DisjCon3.pl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (C) 2011-2018 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 . - -# Catch common programming error: -# A non-reference passed to new. - -use Automake::Condition qw/TRUE FALSE/; -use Automake::DisjConditions; - -my $cond = new Automake::Condition ("COND1_TRUE"); - -eval { new Automake::DisjConditions ("$cond") }; - -warn $@ if $@; - -exit 0 if $@; -exit 1; diff --git a/t/pm/DisjConditions.pl b/t/pm/DisjConditions.pl index f4075b0be..bdcafd2bb 100644 --- a/t/pm/DisjConditions.pl +++ b/t/pm/DisjConditions.pl @@ -380,8 +380,32 @@ sub test_ambig () return 0; } +sub test_bad_declarations +{ + my $failed; + my $cond = new Automake::Condition ('TRUE'); + my $cond2 = new Automake::DisjConditions ($cond); + + eval { new Automake::DisjConditions ($cond2) }; + + warn $@ if $@; + $failed = 1 unless $@; + + $@ = ''; + + my $cond3 = new Automake::Condition ("COND1_TRUE"); + + eval { new Automake::DisjConditions ("$cond3") }; + + warn $@ if $@; + $failed = 1 unless $@; + + return $failed; +} + exit (test_basics || test_invert || test_simplify || test_sub_conditions - || test_ambig); + || test_ambig + || test_bad_declarations); diff --git a/t/pm/Version.pl b/t/pm/Version.pl index 3177c0361..e4372fffb 100644 --- a/t/pm/Version.pl +++ b/t/pm/Version.pl @@ -65,6 +65,21 @@ sub test_bad_versions } } +sub test_bad_declarations +{ + eval { Automake::Version::check ('', '1.2.3') }; + + warn $@ if $@; + $failed = 1 unless $@; + + $@ = ''; + + eval { Automake::Version::check ('1.2.3', '') }; + + warn $@ if $@; + $failed = 1 unless $@; +} + my @tests = ( # basics ['1.0', '2.0', -1], diff --git a/t/pm/Version2.pl b/t/pm/Version2.pl deleted file mode 100644 index 808e6cfd0..000000000 --- a/t/pm/Version2.pl +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2011-2018 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 . - -# prog_error due to invalid $VERSION. - -use Automake::Version; - -eval { Automake::Version::check ('', '1.2.3') }; - -warn $@ if $@; - -exit 0 if $@; -exit 1; diff --git a/t/pm/Version3.pl b/t/pm/Version3.pl deleted file mode 100644 index ded43c26b..000000000 --- a/t/pm/Version3.pl +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2011-2018 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 . - -# prog_error due to invalid $REQUIRED. - -use Automake::Version; - -eval { Automake::Version::check ('1.2.3', '') }; - -warn $@ if $@; - -exit 0 if $@; -exit 1; -- cgit v1.2.1