[libtest-unit-perl] 03/03: Move Andreas Fester's examples from patch to files under debian/

Axel Beckert abe at deuxchevaux.org
Thu Dec 26 00:10:33 UTC 2013


This is an automated email from the git hooks/post-receive script.

abe pushed a commit to branch master
in repository libtest-unit-perl.

commit 657573d038e4ecdb198018744b05142cca72d5f6
Author: Axel Beckert <abe at deuxchevaux.org>
Date:   Thu Dec 26 01:08:05 2013 +0100

    Move Andreas Fester's examples from patch to files under debian/
    
    debian/patches/10_examples.patch previously installed them into
    upstream's examples directory, but the examples in there are also part
    of upstream's test suite and hence the new files cause the test suite
    to fail due to unexpected input files.
    
    These debian-specific example files now live under
    debian/test-case-examples/ and get installed into the binary package
    via debian/examples and dh_installexamples.
---
 debian/changelog                                   |   3 +
 debian/examples                                    |   1 +
 debian/patches/10_examples.patch                   | 173 ---------------------
 debian/patches/series                              |   1 -
 .../procedural-adding-suites-example.pl            |  72 +++++++++
 .../procedural-another-package-example.pl          |  31 ++++
 .../test-case-examples/procedural-fail-example.pl  |  28 ++++
 debian/test-case-examples/procedural-ok-example.pl |  28 ++++
 8 files changed, 163 insertions(+), 174 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 73a3f00..9e9a2d3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -29,6 +29,9 @@ libtest-unit-perl (0.25-2) UNRELEASED; urgency=low
   * Add patch to fix defined(@array) warnings
     (https://rt.cpan.org/Public/Bug/Display.html?id=77779).
     + Also fixes many test suite failures.
+  * Remove ancient 10_examples.patch as it causes many test suite
+    failures. Move contained files to debian/test-case-examples and
+    install them via debian/examples and dh_installexamples.
 
  -- gregor herrmann <gregoa at debian.org>  Tue, 09 Oct 2007 22:32:29 +0200
 
diff --git a/debian/examples b/debian/examples
new file mode 100644
index 0000000..7521493
--- /dev/null
+++ b/debian/examples
@@ -0,0 +1 @@
+debian/test-case-examples/*
diff --git a/debian/patches/10_examples.patch b/debian/patches/10_examples.patch
deleted file mode 100644
index 662faee..0000000
--- a/debian/patches/10_examples.patch
+++ /dev/null
@@ -1,173 +0,0 @@
-Author: <Andreas Fester <Andreas.Fester at gmx.de>>
-Description: Add some simple examples how to write test cases.
---- /dev/null
-+++ b/examples/procedural-adding-suites-example.pl
-@@ -0,0 +1,72 @@
-+# --------------------------------------------------
-+package Foo;
-+
-+use Test::Unit;
-+
-+use constant DEBUG => 0;
-+
-+# code to be tested will be somewhere around here
-+
-+# define tests, set_up and tear_down
-+
-+sub test_foo_ok_1 {
-+	assert(23 == 23);
-+}
-+
-+sub test_foo_ok_2 {
-+	assert(42 == 42);
-+}
-+
-+sub set_up {
-+	print "hello world\n" if DEBUG;
-+}
-+
-+sub tear_down {
-+	print "leaving world again\n" if DEBUG;
-+}
-+
-+# --------------------------------------------------
-+package Bar;
-+
-+use Test::Unit;
-+
-+use constant DEBUG => 0;
-+
-+# code to be tested will be somewhere around here
-+
-+# define tests, set_up and tear_down
-+
-+sub test_bar_ok_1 {
-+	assert(23 == 23);
-+}
-+
-+sub test_bar_ok_2 {
-+	assert(42 == 42);
-+}
-+
-+sub set_up {
-+	print "hello world\n" if DEBUG;
-+}
-+
-+sub tear_down {
-+	print "leaving world again\n" if DEBUG;
-+}
-+
-+# --------------------------------------------------
-+package FooBar;
-+
-+use Test::Unit;
-+
-+create_suite();
-+create_suite("Foo");
-+create_suite("Bar");
-+
-+add_suite("Foo"); # add Foo to this package
-+add_suite("Bar"); # add Bar to this package
-+
-+print "\n--- Testing FooBar ---\n";
-+run_suite();
-+
-+add_suite("Foo", "Bar"); # add Foo to Bar
-+print "\n--- Testing Bar with Foo added to it ---\n";
-+run_suite("Bar");
---- /dev/null
-+++ b/examples/procedural-another-package-example.pl
-@@ -0,0 +1,31 @@
-+package Foo;
-+use Test::Unit;
-+
-+use constant DEBUG => 0;
-+
-+# code to be tested will be somewhere around here
-+
-+# define tests, set_up and tear_down
-+
-+sub test_ok_1 {
-+	assert(23 == 23);
-+}
-+
-+sub test_ok_2 {
-+	assert(42 == 42);
-+}
-+
-+sub set_up {
-+	print "hello world\n" if DEBUG;
-+}
-+
-+sub tear_down {
-+	print "leaving world again\n" if DEBUG;
-+}
-+
-+# and run them
-+
-+package Bar;
-+use Test::Unit;
-+create_suite("Foo");
-+run_suite("Foo");
---- /dev/null
-+++ b/examples/procedural-fail-example.pl
-@@ -0,0 +1,28 @@
-+use Test::Unit;
-+
-+use constant DEBUG => 0;
-+
-+# code to be tested will be somewhere around here
-+
-+# define tests, set_up and tear_down
-+
-+sub test_ok {
-+	assert(23 == 23);
-+}
-+
-+sub test_fail {
-+	assert("born" =~ /loose/, "Born to lose ...");
-+}
-+
-+sub set_up {
-+	print "hello world\n" if DEBUG;
-+}
-+
-+sub tear_down {
-+	print "leaving world again\n" if DEBUG;
-+}
-+
-+# and run them
-+
-+create_suite();
-+run_suite();
---- /dev/null
-+++ b/examples/procedural-ok-example.pl
-@@ -0,0 +1,28 @@
-+use Test::Unit;
-+
-+use constant DEBUG => 0;
-+
-+# code to be tested will be somewhere around here
-+
-+# define tests, set_up and tear_down
-+
-+sub test_ok_1 {
-+	assert(23 == 23);
-+}
-+
-+sub test_ok_2 {
-+	assert(42 == 42);
-+}
-+
-+sub set_up {
-+	print "hello world\n" if DEBUG;
-+}
-+
-+sub tear_down {
-+	print "leaving world again\n" if DEBUG;
-+}
-+
-+# and run them
-+
-+create_suite();
-+run_suite();
diff --git a/debian/patches/series b/debian/patches/series
index a96e93f..b1b32c4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1 @@
-10_examples.patch
 20_fix-defined-array-warnings.patch
diff --git a/debian/test-case-examples/procedural-adding-suites-example.pl b/debian/test-case-examples/procedural-adding-suites-example.pl
new file mode 100644
index 0000000..50aedd7
--- /dev/null
+++ b/debian/test-case-examples/procedural-adding-suites-example.pl
@@ -0,0 +1,72 @@
+# --------------------------------------------------
+package Foo;
+
+use Test::Unit;
+
+use constant DEBUG => 0;
+
+# code to be tested will be somewhere around here
+
+# define tests, set_up and tear_down
+
+sub test_foo_ok_1 {
+	assert(23 == 23);
+}
+
+sub test_foo_ok_2 {
+	assert(42 == 42);
+}
+
+sub set_up {
+	print "hello world\n" if DEBUG;
+}
+
+sub tear_down {
+	print "leaving world again\n" if DEBUG;
+}
+
+# --------------------------------------------------
+package Bar;
+
+use Test::Unit;
+
+use constant DEBUG => 0;
+
+# code to be tested will be somewhere around here
+
+# define tests, set_up and tear_down
+
+sub test_bar_ok_1 {
+	assert(23 == 23);
+}
+
+sub test_bar_ok_2 {
+	assert(42 == 42);
+}
+
+sub set_up {
+	print "hello world\n" if DEBUG;
+}
+
+sub tear_down {
+	print "leaving world again\n" if DEBUG;
+}
+
+# --------------------------------------------------
+package FooBar;
+
+use Test::Unit;
+
+create_suite();
+create_suite("Foo");
+create_suite("Bar");
+
+add_suite("Foo"); # add Foo to this package
+add_suite("Bar"); # add Bar to this package
+
+print "\n--- Testing FooBar ---\n";
+run_suite();
+
+add_suite("Foo", "Bar"); # add Foo to Bar
+print "\n--- Testing Bar with Foo added to it ---\n";
+run_suite("Bar");
diff --git a/debian/test-case-examples/procedural-another-package-example.pl b/debian/test-case-examples/procedural-another-package-example.pl
new file mode 100644
index 0000000..ee8dfc7
--- /dev/null
+++ b/debian/test-case-examples/procedural-another-package-example.pl
@@ -0,0 +1,31 @@
+package Foo;
+use Test::Unit;
+
+use constant DEBUG => 0;
+
+# code to be tested will be somewhere around here
+
+# define tests, set_up and tear_down
+
+sub test_ok_1 {
+	assert(23 == 23);
+}
+
+sub test_ok_2 {
+	assert(42 == 42);
+}
+
+sub set_up {
+	print "hello world\n" if DEBUG;
+}
+
+sub tear_down {
+	print "leaving world again\n" if DEBUG;
+}
+
+# and run them
+
+package Bar;
+use Test::Unit;
+create_suite("Foo");
+run_suite("Foo");
diff --git a/debian/test-case-examples/procedural-fail-example.pl b/debian/test-case-examples/procedural-fail-example.pl
new file mode 100644
index 0000000..0cf96b4
--- /dev/null
+++ b/debian/test-case-examples/procedural-fail-example.pl
@@ -0,0 +1,28 @@
+use Test::Unit;
+
+use constant DEBUG => 0;
+
+# code to be tested will be somewhere around here
+
+# define tests, set_up and tear_down
+
+sub test_ok {
+	assert(23 == 23);
+}
+
+sub test_fail {
+	assert("born" =~ /loose/, "Born to lose ...");
+}
+
+sub set_up {
+	print "hello world\n" if DEBUG;
+}
+
+sub tear_down {
+	print "leaving world again\n" if DEBUG;
+}
+
+# and run them
+
+create_suite();
+run_suite();
diff --git a/debian/test-case-examples/procedural-ok-example.pl b/debian/test-case-examples/procedural-ok-example.pl
new file mode 100644
index 0000000..655ed21
--- /dev/null
+++ b/debian/test-case-examples/procedural-ok-example.pl
@@ -0,0 +1,28 @@
+use Test::Unit;
+
+use constant DEBUG => 0;
+
+# code to be tested will be somewhere around here
+
+# define tests, set_up and tear_down
+
+sub test_ok_1 {
+	assert(23 == 23);
+}
+
+sub test_ok_2 {
+	assert(42 == 42);
+}
+
+sub set_up {
+	print "hello world\n" if DEBUG;
+}
+
+sub tear_down {
+	print "leaving world again\n" if DEBUG;
+}
+
+# and run them
+
+create_suite();
+run_suite();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libtest-unit-perl.git



More information about the Pkg-perl-cvs-commits mailing list