gl_basic.t (1074B)
1 # 2 # Check that opening the viewer after an instrumented program has exited gives 3 # an identical output to known good. 4 # 5 use Modern::Perl; 6 use Test::More skip_all => 'not yet'; 7 8 use lib 't'; 9 require gl_utils; 10 require utils; 11 12 13 my $dir = setup_projdir(); 14 $ENV{CITRUN_PROCDIR} = $dir->workdir . "/procdir/"; 15 16 # Run instrumented program. 17 $dir->run( prog => $dir->workdir . "/program", args => '1', chdir => $dir->curdir ); 18 is( $dir->stdout, '1', 'is instrumented program stdout correct' ); 19 is( $dir->stderr, '', 'is instrumented program stderr silent' ); 20 is( $? >> 8, 0, 'is instrumented program exit code zero' ); 21 22 my $output_file = File::Spec->catdir( $dir->workdir, 'test.tga' ); 23 my $output_good = File::Spec->catfile( 't', 'gl', 'basic.tga' ); 24 25 my $gl = Test::Cmd->new( prog => 'bin/citrun_gl', workdir => '' ); 26 $gl->run( args => "$output_file 800 600" ); 27 isnt( $gl->stdout, '', 'is citrun_gl stdout not silent' ); 28 is( $gl->stderr, '', 'is citrun_gl stderr silent' ); 29 is( $? >> 8, 0, 'is citrun_gl exit code zero' ); 30 31 ok_image( $output_file, $output_good, $gl->workdir );