Author: jkeenan
Date: Thu Jan 17 19:15:32 2008
New Revision: 24959

Added:
   branches/revision/t/tools/revision/02-print_src.t   (contents, props changed)
Modified:
   branches/revision/MANIFEST
   branches/revision/t/tools/revision/01-get_revision_numbers.t

Log:
Add file to hold tests of Parrot::Revision::Utils::print_src_revision_c().

Modified: branches/revision/MANIFEST
==============================================================================
--- branches/revision/MANIFEST  (original)
+++ branches/revision/MANIFEST  Thu Jan 17 19:15:32 2008
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Fri Jan 18 01:28:24 2008 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Fri Jan 18 03:14:44 2008 UT
 #
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
@@ -3623,6 +3623,7 @@
 t/tools/pmc2cutils/08-pmc-pm.t                              []
 t/tools/pmc2cutils/README                                   []
 t/tools/revision/01-get_revision_numbers.t                  []
+t/tools/revision/02-print_src.t                             []
 t/tools/smartlinks.t                                        []
 tools/build/addopstags.pl                                   []
 tools/build/c2str.pl                                        []

Modified: branches/revision/t/tools/revision/01-get_revision_numbers.t
==============================================================================
--- branches/revision/t/tools/revision/01-get_revision_numbers.t        
(original)
+++ branches/revision/t/tools/revision/01-get_revision_numbers.t        Thu Jan 
17 19:15:32 2008
@@ -14,7 +14,6 @@
 use lib qw( lib );
 use Parrot::Revision::Utils qw(
     get_revision_numbers
-    print_src_revision_c
 );
 
 my $cwd = cwd();

Added: branches/revision/t/tools/revision/02-print_src.t
==============================================================================
--- (empty file)
+++ branches/revision/t/tools/revision/02-print_src.t   Thu Jan 17 19:15:32 2008
@@ -0,0 +1,75 @@
+#! perl
+# Copyright (C) 2007, The Perl Foundation.
+# $Id$
+# 02-print_src.t
+
+use strict;
+use warnings;
+
+use Test::More tests =>  4;
+use Carp;
+use Cwd;
+use File::Path ();
+use File::Temp qw( tempdir );
+use lib qw( lib );
+use Parrot::Revision::Utils qw(
+    print_src_revision_c
+);
+use IO::CaptureOutput qw| capture |;
+
+{
+    my ($current, $config, $script);
+    my ($stdout, $rv);
+    $current = 7399;
+    $config  = 7390;
+    $script  = $0;
+
+    capture (
+        sub { $rv = print_src_revision_c($current, $config, $script); },
+        \$stdout,
+    );
+    ok($rv, "print_src_revision_c() returned true value");
+    like($stdout,
+        qr/This file is generated automatically by $script/,
+        "Got expected text"
+    );
+    like($stdout,
+        qr/return $current.*return $config/s,
+        "Got expected text"
+    );
+}
+
+pass("Completed all tests in $0");
+
+################### DOCUMENTATION ###################
+
+=head1 NAME
+
+02-print_src.t - Test subroutines exported by Parrot::Revision::Utils.
+
+=head1 SYNOPSIS
+
+    % prove t/tools/revision/02-print_src.t
+
+=head1 DESCRIPTION
+
+The files in this directory test functionality used by
+F<tools/build/revision_c.pl>, a program invoked by Parrot's F<make>.
+
+=head1 AUTHOR
+
+James E Keenan
+
+=head1 SEE ALSO
+
+Parrot::Configure, F<Configure.pl>.
+
+=cut
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:
+

Reply via email to