]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
t/pm: Regroup tests by module
authorMatthias Paulmier <matthias.paulmier@etu.u-bordeaux.fr>
Tue, 26 Jun 2018 13:35:17 +0000 (15:35 +0200)
committerMatthias Paulmier <matthias.paulmier@etu.u-bordeaux.fr>
Tue, 26 Jun 2018 13:35:17 +0000 (15:35 +0200)
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
t/pm/Cond2.pl [deleted file]
t/pm/Cond3.pl [deleted file]
t/pm/Condition.pl
t/pm/DisjCon2.pl [deleted file]
t/pm/DisjCon3.pl [deleted file]
t/pm/DisjConditions.pl
t/pm/Version.pl
t/pm/Version2.pl [deleted file]
t/pm/Version3.pl [deleted file]

index 0b360b33908db6eb93dacac9b383cb1be0f29591..5442a3b4ce7b78b02272b946f42c2ad7e61be0c1 100644 (file)
@@ -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 (file)
index 882daa9..0000000
+++ /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 (file)
index 0294d74..0000000
+++ /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;
index 21021b555c441d51d10d5da3e3c5037114996fe8..58f89b3ae7f5f8da5df6d4af69e9aa3ebd22146d 100644 (file)
@@ -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 (file)
index 2bfd51a..0000000
+++ /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 (file)
index 6ccd734..0000000
+++ /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;
index f4075b0bea000b792ca6bfbfadda50ef43cfa977..bdcafd2bb2c7a27ead5fa5de44d54da95fd7f98f 100644 (file)
@@ -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);
index 3177c0361c8a2062e898a4e2761b24dd2525a073..e4372fffb802cb1ed496bb34acc751b2b388945f 100644 (file)
@@ -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 (file)
index 808e6cf..0000000
+++ /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 (file)
index ded43c2..0000000
+++ /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;