Author: coke
Date: Fri Jan  2 06:41:49 2009
New Revision: 34809

Added:
   trunk/t/examples/catchall.t   (contents, props changed)
Modified:
   trunk/MANIFEST

Log:
Add a (failing) test to help us keep our examples functioning.

Should be executed during "make examples_tests"



Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST      (original)
+++ trunk/MANIFEST      Fri Jan  2 06:41:49 2009
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Fri Jan  2 06:21:09 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Fri Jan  2 14:28:02 2009 UT
 #
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
@@ -3367,6 +3367,7 @@
 t/dynpmc/rotest.t                                           []
 t/dynpmc/subclass_with_pir_method.t                         []
 t/dynpmc/subproxy.t                                         []
+t/examples/catchall.t                                       []
 t/examples/japh.t                                           []
 t/examples/library.t                                        []
 t/examples/namespace.t                                      []

Added: trunk/t/examples/catchall.t
==============================================================================
--- (empty file)
+++ trunk/t/examples/catchall.t Fri Jan  2 06:41:49 2009
@@ -0,0 +1,53 @@
+#!perl
+# Copyright (C) 2007-2008 The Perl Foundation.
+# $Id$
+
+use strict;
+use warnings;
+use lib qw( . lib ../lib ../../lib );
+
+use ExtUtils::Manifest qw(maniread);
+use File::Spec qw();
+use Test::More;
+use Parrot::Config qw(%PConfig);
+
+=head1 NAME
+
+t/examples/catchall.t - Verify all example code at least compiles
+
+=head1 SYNOPSIS
+
+    % prove t/examples/catchall.t
+
+=head1 DESCRIPTION
+
+Verify compilation of all examples that aren't explicitly tested by other
+tests. No guarantee is made that these examples I<work>, just that they
+compile.
+
+=cut
+
+my $manifest = maniread('MANIFEST');
+my %files;
+foreach my $file (keys %$manifest) {
+  next unless $file =~ m{^examples/.*(pir|pasm)$}; 
+  next if $file =~ m{^examples/tutorial}; # all are tested in tutorial.t
+  $files{$file}=undef;
+}
+
+plan tests => scalar keys %files;
+
+foreach my $file (sort keys %files) {
+    my $cmd = File::Spec->curdir() . $PConfig{slash} . 
+              $PConfig{test_prog} . " -o " . File::Spec->devnull() . " " .
+              $file;
+
+    is(system($cmd), 0 , $file);
+}
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:

Reply via email to