# New Ticket Created by François PERRAD # Please include the string: [perl #36843] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=36843 >
svn diff Index: build_tools/parrotdef.pl =================================================================== --- build_tools/parrotdef.pl (revision 8868) +++ build_tools/parrotdef.pl (working copy) @@ -31,6 +31,7 @@ Parrot_debug Parrot_disassemble Parrot_load_bytecode + Parrot_load_lib pmc_new pmc_reuse pmc_new_noinit @@ -268,6 +269,8 @@ Parrot_call_method string_replace Parrot_make_COW_reference + Parrot_switch_to_cs + PackFile_Segment_new_seg ); push @funcnames, "PMCNULL DATA"; push @funcnames, "Parrot_base_vtables DATA"; Index: config/init/data.pl =================================================================== --- config/init/data.pl (revision 8868) +++ config/init/data.pl (working copy) @@ -137,6 +137,8 @@ cp => 'cp', lns => $Config{lns}, # soft link + # On all platform slash == slash_exec, except with MinGW + # slash_exec is needed by pathname of executable in test or makefile slash => '/', slash_exec => '/', Index: config/gen/makefiles/m4.in =================================================================== --- config/gen/makefiles/m4.in (revision 8868) +++ config/gen/makefiles/m4.in (working copy) @@ -19,6 +19,8 @@ LD = ${ld} LDFLAGS = ${ldflags} LD_SHARE_FLAGS = ${ld_share_flags} # e.g. -shared +#CONDITIONED_LINE(parrot_exe_def):LIBPARROT = ${build_dir}/parrot${a} +#INVERSE_CONDITIONED_LINE(parrot_exe_def):LIBPARROT = # some constants M4_EVAL_COMPILER_SO = ..${slash}..${slash}runtime${slash}parrot${slash}dynext${slash}m4_eval_compiler${share_ext} @@ -56,7 +58,7 @@ $(M4_EVAL_COMPILER_SO): src/eval.c $(CC) $(CFLAGS) $(CC_SHARED) $(DEBUG) $(WARN) -c src/eval.c - $(LD) $(LD_SHARE_FLAGS) $(LDFLAGS) ${ld_out}$@ eval$(O) + $(LD) $(LD_SHARE_FLAGS) $(LDFLAGS) ${ld_out}$@ eval$(O) $(LIBPARROT) src/m4.pir: src/builtin.pir src/freeze.pir src/input.pir src/macro.pir src/output.pir touch $@ Index: languages/m4/t/basic/003_getopt.t =================================================================== --- languages/m4/t/basic/003_getopt.t (revision 8868) +++ languages/m4/t/basic/003_getopt.t (working copy) @@ -4,10 +4,11 @@ use FindBin; use lib "$FindBin::Bin/../../lib", "$FindBin::Bin/../../../../lib"; +use Parrot::Config; use Test::More tests => 25; my $real_out; -my $parrot_m4 = 'cd .. && ./parrot languages/m4/m4.pbc'; +my $parrot_m4 = "cd .. && .$PConfig{slash_exec}parrot$PConfig{exe} languages/m4/m4.pbc"; my $examples_dir = 'languages/m4/examples'; Index: languages/m4/t/basic/012_eval.t =================================================================== --- languages/m4/t/basic/012_eval.t (revision 8868) +++ languages/m4/t/basic/012_eval.t (working copy) @@ -4,10 +4,11 @@ use FindBin; use lib "$FindBin::Bin/../../lib", "$FindBin::Bin/../../../../lib"; +use Parrot::Config; use Test::More tests => 1; my $real_out; -my $parrot = 'cd .. && ./parrot'; +my $parrot = "cd .. && .$PConfig{slash_exec}parrot$PConfig{exe}"; $real_out = `$parrot languages/m4/examples/eval.imc 2>&1`; is( $real_out, << 'END_OUT', 'single expression' ); Index: languages/m4/t/freezing/001_freeze.t =================================================================== --- languages/m4/t/freezing/001_freeze.t (revision 8868) +++ languages/m4/t/freezing/001_freeze.t (working copy) @@ -4,14 +4,15 @@ use FindBin; use lib "$FindBin::Bin/../../lib", "$FindBin::Bin/../../../../lib"; +use Parrot::Config; use Test::More tests => 1; my $real_out; -my $parrot_m4 = 'cd .. && ./parrot languages/m4/m4.pbc'; +my $parrot_m4 = "cd .. && .$PConfig{slash_exec}parrot$PConfig{exe} languages/m4/m4.pbc"; #-------------------------------------------- Index: languages/m4/t/freezing/002_many_files.t =================================================================== --- languages/m4/t/freezing/002_many_files.t (revision 8868) +++ languages/m4/t/freezing/002_many_files.t (working copy) @@ -4,10 +4,11 @@ use FindBin; use lib "$FindBin::Bin/../../lib", "$FindBin::Bin/../../../../lib"; +use Parrot::Config; use Test::More tests => 3; my $real_out; -my $parrot_m4 = 'cd .. && ./parrot languages/m4/m4.pbc'; +my $parrot_m4 = "cd .. && .$PConfig{slash_exec}parrot$PConfig{exe} languages/m4/m4.pbc"; #-------------------------------------------- Index: languages/m4/t/builtins/010_sysval.t =================================================================== --- languages/m4/t/builtins/010_sysval.t (revision 8868) +++ languages/m4/t/builtins/010_sysval.t (working copy) @@ -8,6 +8,7 @@ SKIP: { + skip( "`false' not available on $^O", 1 ) if ($^O =~ /MSWin32/); skip( "difference between running a process in a fork, or with system()", 1 ); language_output_is( 'm4', <<'CODE', <<'OUT', 'substring in middle of string' ); @@ -19,7 +20,10 @@ OUT } +SKIP: { + skip( "`true' not available on $^O", 1 ) if ($^O =~ /MSWin32/); + language_output_is( 'm4', <<'CODE', <<'OUT', 'substring in middle of string' ); syscmd(`true') sysval()
The attached patch allows to build m4 with MinGW32 (m4_eval_compiler.dll). 'make test' gives the following result : Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- m4\t\basic\003_getopt.t 3 768 25 3 12.00% 21 24-25 m4\t\builtins\015___file__.t 1 256 1 1 100.00% 1 m4\t\freezing\001_freeze.t 1 256 1 1 100.00% 1 8 subtests skipped. Failed 3/33 test scripts, 90.91% okay. 5/133 subtests failed, 96.24% okay. 003_getopt : # Failed test (m4\t\basic\003_getopt.t at line 168) # got: 'Found an unexpected character # '0' # Hello # ' # expected: 'Hello # ' m4\t\basic\003_getopt................ok 23/25 # Failed test (m4\t\basic\003_getopt.t at line 190) # got: 'Found an unexpected character # '8' # Hello # Hello # ' # expected: 'Hello # Hello # ' m4\t\basic\003_getopt................NOK 24 # Failed test (m4\t\basic\003_getopt.t at line 198) # got: 'Found an unexpected character # '8' # Hello # Hello # Hello # ' # expected: 'Hello # Hello # Hello # ' # Looks like you failed 3 tests of 25. 015___file__ : mixed / \ m4\t\builtins\015___file__...........NOK 1 # Failed test (m4\t\builtins\015___file__.t at line 10) # got: 'Currently the file 'languages/m4\t\builtins\015___file___1.m4' is being processed. # ' # expected: 'Currently the file 'languages/m4/t/builtins/015___file___1.m4' is being processed. # ' # Looks like you failed 1 test of 1. 001_freeze : needs cat & rm 010_sysval : tests skipped (need true & false) Skipped summary (8 subtests skipped) : m4\t\basic\011_recursion.............ok 1/2 skipped: problems with nested strings m4\t\builtins\007_decr...............ok 2/9 skipped: strange in Parrot and in GNU m4 m4\t\builtins\008_incr...............ok 2/9 skipped: strange in Parrot and in GNU m4 m4\t\builtins\010_sysval.............ok 2/2 skipped: various reasons m4\t\builtins\016___line__...........ok 1/1 skipped: builtin macro __line__ is not implemented yet Francois Perrad.