Skip to content

Commit

Permalink
added test case for clib
Browse files Browse the repository at this point in the history
  • Loading branch information
tokuhirom committed Oct 23, 2009
1 parent 8cda8c8 commit e2f0126
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ t/120_disttest/t/01_simple
t/120_disttest/t/01_simple.o
inc/
t/130_write_header/test_config.h
t/140_clib/inst/auto/Clib/include/test/foo.h
1 change: 1 addition & 0 deletions MANIFEST.SKIP
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ t/.+/main$
^t/110_test/t/01_simple.t
^t/120_disttest/Clib-disttestsample-0.01/
^t/130_write_header/test_config.h$
^t/.+/inst/[^.]+
1 change: 1 addition & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ requires 'Module::Install';

tests 't/*.t t/*/*.t';
recursive_author_tests('xt');
test_requires 'Test::Requires';

if (-d '.git') { # author
`rm -rf t/*/Makefile t/*/inc t/*/main t/*/*.gz t/*/*.o t/*/local t/*/Makefile.bak t/*/*.bak t/*/*.a t/*/*.so`;
Expand Down
1 change: 1 addition & 0 deletions lib/Module/Install/ForC.pm
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ sub _gen_makefile {
{
NAME => $self->name,
VERSION => $self->version,
%{ $self->makemaker_args }
}
);
my $mm_params = join("\n", map { $_.'='.($mm->{$_} || '') } qw/FIRST_MAKEFILE MOD_INSTALL ABSPERL ABSPERLRUN VERBINST UNINST PERM_DIR PERL PREOP TRUE TAR RM_F RM_RF NOECHO NOOP INSTALLARCHLIB INSTALL_BASE DIST_CP DIST_DEFAULT POSTOP COMPRESS TARFLAGS TO_UNIX PERLRUN DISTVNAME VERSION NAME ECHO ECHO_N MAKE MV SUFFIX ZIP SHAR FULLPERLRUN FULLPERL USE_MAKEFILE FIXIN DOC_INSTALL UNINSTALL CP INST_LIB INST_ARCHLIB INST_LIBDIR DFSEP INST_AUTODIR INST_ARCHAUTODIR INST_BIN INST_SCRIPT INST_MAN1DIR INST_MAN3DIR MKPATH CHMOD TOUCH OBJ_EXT/);
Expand Down
13 changes: 13 additions & 0 deletions t/140_clib/Makefile.PL
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use inc::Module::Install;
name 'test';
version 0.01;
license 'perl';

clib_header 'foo.h';

makemaker_args(
INSTALLARCHLIB => './inst/',
);

WriteMakefileForC();

1 change: 1 addition & 0 deletions t/140_clib/foo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
foooo
16 changes: 16 additions & 0 deletions t/140_clib/test.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use strict;
use warnings;
use Test::More;
use t::Utils;
use Test::Requires 'Module::Install::Clib';

setup;
cleanup 'inst';

run_makefile_pl;
run_make();
ok -f './blib/arch/auto/Clib/include/test/foo.h', 'blib';
run_make('install');
ok -f './inst/auto/Clib/include/test/foo.h', 'inst';

done_testing;
2 changes: 1 addition & 1 deletion t/Utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ our $make = $Config{make};

sub setup {
chdir(dirname([caller(0)]->[1]));
cleanup(<*.so>, <*.dll>, <*.o>, 'inc', 'Makefile', 'main', 'a.out', <*.gz>, 'MANIFEST');
cleanup(<*.so>, <*.dll>, <*.o>, 'inc', 'Makefile', 'main', 'a.out', <*.gz>, 'MANIFEST', 'blib');
}

sub cleanup {
Expand Down

0 comments on commit e2f0126

Please sign in to comment.