4 use warnings FATAL => 'all';
13 Cwd::abs_path( File::Spec->catdir( File::Basename::dirname($0), File::Spec->updir() ) );
15 my $lib_pl = File::Spec->catfile( $dist_basedir, "t", "lib.pl" );
18 my $test_dir = test_dir();
19 my $test_data = test_data();
21 use_ok('ExtUtils::XBuilder');
23 my $builder = ExtUtils::XBuilder->new( output_dir => $test_dir );
26 $builder->has_compiler( TAG => 'C' ) or skip "No C Compiler", 2;
28 my @csources = map { File::Spec->catfile( $test_data, $_ ) } qw(hello_world.c);
29 my @objects = $builder->compile( source => [ @sources ], TAG => 'C' );
30 cmp_ok( scalar(@sources), '==', scalar(@objects), 'compiling hello_world.c' );
31 like( $objects[0], qr/^$test_dir/, 'object directory prefix correct' );
32 my @executables = $builder->link( source => [ @objects ], TAG => 'C', target => 'hello_world' );
37 $builder->has_compiler( TAG => 'CXX' ) or skip "No C++ Compiler", 2;
39 my @csources = map { File::Spec->catfile( $test_data, $_ ) } qw(hello_world.cc);
40 my @objects = $builder->compile( source => [ @sources ], TAG => 'CXX' );
41 cmp_ok( scalar(@sources), '==', scalar(@objects), 'compiling hello_world.cc' );
42 like( $objects[0], qr/^$test_dir/, 'object directory prefix correct' );
43 my @executables = $builder->link( source => [ @objects ], TAG => 'CXX', target => 'hello_world' );