html.mk

static html creation framework using make(1) and cpp(1)
git clone git://0x30.net/html.mk
Log | Files | Refs | README | LICENSE

cp_nodest.t (689B)


      1 #
      2 # CP file when not building into obj/.
      3 #
      4 use Modern::Perl;
      5 use Test::Cmd;
      6 use Test::File;
      7 use Test::More tests => 5;
      8 
      9 
     10 my $cmd = Test::Cmd->new( prog => '/usr/bin/make', workdir => '' );
     11 my $html_mk = $cmd->here . "/bsd.html.mk";
     12 
     13 $cmd->write( 'cp_file.txt', 'some file contents' );
     14 $cmd->write( 'Makefile', <<EOF );
     15 CP_OBJ = cp_file.txt
     16 SRCS =
     17 
     18 .include "$html_mk"
     19 EOF
     20 
     21 #
     22 # Silence is OK here I think.
     23 #
     24 $cmd->run( chdir => $cmd->curdir );
     25 is( $cmd->stdout,	'',	'make stdout' );
     26 is( $cmd->stderr,	'',	'make stderr' );
     27 is( $? >> 8,		0,	'make exit status' );
     28 
     29 file_exists_ok( $cmd->workdir . '/cp_file.txt' );
     30 file_contains_like( $cmd->workdir . '/cp_file.txt', qr/some file contents/ );