8 # TODO we need to have some way to find one or more alternate versions
9 # of perl on the smoke machine so that we can verify that the installed
10 # perl can be used to test against the alternate perls without
11 # installing the harness in the alternate perls. Does that make sense?
14 # harness process (i.e. bin/prove) is perl 5.8.8.
15 # subprocesses (i.e. t/test.t) are perl 5.6.2.
20 my $perls_live_at = '/usr/local/stow/';
21 @perls = grep( { -e $_ }
22 map( {"$perls_live_at/perl-$_/bin/perl"} qw(5.5.4 5.6.2) ) );
24 plan( tests => scalar(@perls) * 4 );
27 plan( skip_all => "no perls found in '$perls_live_at'" );
35 mkdir('twib') or die "cannot create 'twib' $!";
38 open( my $fh, '>', 'twib/foo.pm' );
39 print $fh "package twib;\nsub foo {'bar';}\n1;\n";
43 File::Path::rmtree('twib');
47 xt/perls/sample-tests/perl_version
50 # TODO and something with taint
52 # make the tests check that the perl is indeed the $perl (thus they are
53 # just printed tests.)
54 foreach my $perl (@perls) {
56 # TODO make the API be *not* an environment variable!
57 local $ENV{HARNESS_PERL} = $perl;
59 my ( $in, $out, $err ) = ( undef, '', '' );
60 my $ret = IPC::Run::run(
63 'bin/prove', '-It/lib', '-Itwib', @tests
67 ok( $ret, 'no death' );
68 like( $out, qr/All tests successful/, 'success' );
69 like( $out, qr/Result: PASS/, 'passed' );
70 is($err, '', 'no error');
73 # vim:ts=4:sw=4:et:sta