[svn:parrot] r40246 - in trunk: . t/tools

dukeleto at svn.parrot.org dukeleto at svn.parrot.org
Fri Jul 24 04:22:15 UTC 2009


Author: dukeleto
Date: Fri Jul 24 04:22:14 2009
New Revision: 40246
URL: https://trac.parrot.org/parrot/changeset/40246

Log:
Add some basic testing for pgegrep

Added:
   trunk/t/tools/pgegrep.t
Modified:
   trunk/MANIFEST

Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST	Fri Jul 24 00:39:10 2009	(r40245)
+++ trunk/MANIFEST	Fri Jul 24 04:22:14 2009	(r40246)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Tue Jul 21 23:39:25 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Fri Jul 24 04:08:50 2009 UT
 #
 # See below for documentation on the format of this file.
 #
@@ -2083,6 +2083,7 @@
 t/tools/ops2pm/samples/pic_ops.original                     [test]
 t/tools/parrot_debugger.t                                   [test]
 t/tools/pbc_merge.t                                         [test]
+t/tools/pgegrep.t                                           [test]
 t/tools/pmc2c.t                                             [test]
 t/tools/pmc2cutils/00-qualify.t                             [test]
 t/tools/pmc2cutils/01-pmc2cutils.t                          [test]

Added: trunk/t/tools/pgegrep.t
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/t/tools/pgegrep.t	Fri Jul 24 04:22:14 2009	(r40246)
@@ -0,0 +1,50 @@
+#! perl
+# Copyright (C) 2009, Parrot Foundation.
+=head1 NAME
+
+t/tools/pgegrep.t - test the script tools/utils/pgegrep
+
+=head1 SYNOPSIS
+
+    % prove t/tools/pgegrep.t
+
+=head1 DESCRIPTION
+
+Tests the features of of the C<pgegrep> utility.
+
+=cut
+
+use strict;
+use warnings;
+use lib qw( . lib ../lib ../../lib );
+
+use Fatal qw{open close};
+use Test::More;
+use Parrot::Test tests => 1;
+use Parrot::Config;
+use File::Spec   ();
+
+sub pgegrep_output_like {
+    my ($options, $snippet, $desc)  = @_;
+
+    my $PARROT  = ".$PConfig{slash}$PConfig{test_prog}";
+    my $pgegrep = File::Spec->catfile( qw{. tools util pgegrep} );
+    my $out     = `$PARROT $pgegrep $options`;
+
+    like( $out, $snippet, $desc );
+
+    return;
+}
+
+pgegrep_output_like(
+    '-V',
+    qr!\Qpgegrep v0.0.1\E!,
+    'pge reports correct version'
+);
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:


More information about the parrot-commits mailing list