summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Paulmier <matthias.paulmier@etu.u-bordeaux.fr>2018-06-26 15:35:17 +0200
committerMatthias Paulmier <matthias.paulmier@etu.u-bordeaux.fr>2018-06-26 15:35:17 +0200
commitdad5b2c52d5d8341585e39579068756e2ac7d931 (patch)
tree38b8915da0e45a7c4f67aff9d2ec40d22b70c2f3
parent45e7e85f0bc4798ef6ff7cbd3443c55aa642774b (diff)
downloadautomake-dad5b2c52d5d8341585e39579068756e2ac7d931.tar.gz
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.
-rw-r--r--t/list-of-tests.mk9
-rw-r--r--t/pm/Cond2.pl27
-rw-r--r--t/pm/Cond3.pl27
-rw-r--r--t/pm/Condition.pl26
-rw-r--r--t/pm/DisjCon2.pl30
-rw-r--r--t/pm/DisjCon3.pl29
-rw-r--r--t/pm/DisjConditions.pl26
-rw-r--r--t/pm/Version.pl15
-rw-r--r--t/pm/Version2.pl25
-rw-r--r--t/pm/Version3.pl25
10 files changed, 66 insertions, 173 deletions
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 <https://www.gnu.org/licenses/>.
-
-# 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 <https://www.gnu.org/licenses/>.
-
-# 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 <https://www.gnu.org/licenses/>.
-
-# 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 <https://www.gnu.org/licenses/>.
-
-# 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 <https://www.gnu.org/licenses/>.
-
-# 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 <https://www.gnu.org/licenses/>.
-
-# prog_error due to invalid $REQUIRED.
-
-use Automake::Version;
-
-eval { Automake::Version::check ('1.2.3', '') };
-
-warn $@ if $@;
-
-exit 0 if $@;
-exit 1;