On Fri Aug 01 06:44:05 2008, coke wrote: > On Thu, Jul 31, 2008 at 7:35 PM, James Keenan via RT > <[EMAIL PROTECTED]> wrote: > > Coke: Given the points Leo made and the fact that there has been > > nothing from the OP in 4 years, can we close this ticket? > > > > Thanks. > > > > kid51 > > > > Just because there's no activity or followups on a ticket doesn't mean > the bug isn't still there. In this case, though, I can't reproduce the > poster's original complaint about an absolute include path not > working, ignoring the quality or state of his patch. > > We can close this ticket by adding a test that > - creates a temporary PIR file with a simple one line :main that > outputs something. > - gets the absolute path of that file > - uses another file to .include that temporary file via the absolute path. > - verifies the output > - removes the temporary file. >
This patch adds test of this functionality to t/compilers/imcc/syn/file.t . It passes on Linux/x86. I'll try it on a windows machine tomorrow and apply it over the weekend unless there any objections. Christoph
Index: t/compilers/imcc/syn/file.t =================================================================== --- t/compilers/imcc/syn/file.t (revision 30772) +++ t/compilers/imcc/syn/file.t (working copy) @@ -7,6 +7,7 @@ use lib qw( . lib ../lib ../../lib ); use File::Spec; use Test::More; +use Cwd qw(cwd); use Parrot::Config; use Parrot::Test tests => 13; @@ -52,6 +53,29 @@ unlink 'temp.pasm'; ############################## +open $FOO, '>', "temp.pasm" or die "Can't write temp.pasm\n"; +print $FOO <<'ENDF'; + .macro_const BAR 42 +ENDF +close $FOO; +my $temp_abs_path = cwd()."/temp.pasm"; + +pir_output_is( <<"CODE", <<'OUT', 'include pasm (absolute path)' ); +.sub test :main + say "before" + .include '$temp_abs_path' + say .BAR + say "after" + end +.end +CODE +before +42 +after +OUT +unlink 'temp.pasm'; + +############################## open $FOO, '>', 'temp.pir' or die "Can't write temp.pir: $!\n"; print $FOO <<'ENDF'; .const int BAR = 42