6 use Test::More tests => 5;
11 my $input = File::Spec->catfile(qw( t local ptr_cast_test.c ));
12 my $output = File::Spec->catfile(qw( t local ptr_cast_test ));
20 push(@extraargs, '/nologo') if $^O eq 'MSWin32' && $Config{cc} eq 'cl';
21 my $cmd = "$Config{cc} -o $output $input " . join(' ', @extraargs);
22 diag( "compiling test program with: $cmd" );
23 my $pid = open3(undef, $out, $err, $cmd);
26 is( $?, 0, 'compiling ptr_cast_test.c' );
28 is( do { local $/ = undef; <$err>}, '', 'STDERR empty after compiling' );
30 $pid = open3(undef, $out, $err, "./$output");
33 is( $?, 0, './ptr_cast_test exited with 0' );
35 like( do { local $/ = undef; <$out> }, qr/ptr_cast_test:\s+ok\s+/, 'casting pointer integer and back worked' );
36 ok( !do { local $/ = undef; <$err> }, 'STDERR empty after running' );