summaryrefslogtreecommitdiff
path: root/t/pm
diff options
context:
space:
mode:
Diffstat (limited to 't/pm')
-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
9 files changed, 65 insertions, 165 deletions
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;