petdance/scratch — Issue #709: Parrot::Test with --run-exec assumes "." is in $PATH
Author: petdance
Created: 2011-11-14 06:12:22+00:00
State: open
Labels: bug, Pri-normal, Sev-medium, testing

This ticket moves into the Trac system discussion of an issue previously found in the RT system as [http://rt.perl.org/rt3/Ticket/Display.html?id=49258 RT #49258]. In that ticket, Bob Rogers provided test file ''pbc.t'' which is here attached.
Running that test file in the original RT, Bob posted this output:
```
The attached test case will illustrate the problem (but be sure to
check that $PATH does not contain "." first):

rogers@rgrjr> perl pbc.t
1..1
not ok 1 - .const of null string
# Failed test (pbc.t at line 18)
# got: ''
# expected: 'ok
# '
# Looks like you failed 1 test of 1.
rogers@rgrjr> PATH=".:$PATH" perl pbc.t
1..1
ok 1 - .const of null string
rogers@rgrjr>

I think the right thing would be to mangle $exe_f to start with
"./", but I don't know how to do that portably.
```
Re-running it today, I got a failure -- but different output:
```
prove -v pbc.t
pbc.t ..
1..1
not ok 1 - .const of null string

# Failed test '.const of null string'
# at pbc.t line 18.
# got: 'error:imcc:syntax error, unexpected DOT,
expecting INTV or FLOATV or STRINGV or PMCV ('.')
# in file '/topdir/work/parrot/pbc_1.pir' line 3
# error:imcc:syntax error, unexpected IDENTIFIER,
expecting '(' ('empty')
# in file '/topdir/work/parrot/pbc_1.pir' line 4
# error:imcc:syntax error, unexpected STRINGC,
expecting '(' ('"ok\n"')
# in file '/topdir/work/parrot/pbc_1.pir' line 5
# '
# expected: 'ok
# '
# Looks like you failed 1 test of 1.
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests

Test Summary Report
-------------------
pbc.t (Wstat: 256 Tests: 1 Failed: 1)
Failed test: 1
Non-zero exit status: 1
Files=1, Tests=1, 0 wallclock secs
( 0.02 usr 0.01 sys + 0.05 cusr 0.00 csys = 0.08 CPU)
Result: FAIL
```
gdb had this to say:
```
(gdb) run pbc_1.pir
Starting program: /topdir/work/parrot/parrot pbc_1.pir
[Thread debugging using libthread_db enabled]
warning: Lowest section in /usr/lib/libicudata.so.36 is .hash at 000000b4
error:imcc:syntax error, unexpected DOT, expecting INTV or
FLOATV or STRINGV or PMCV ('.')
in file 'pbc_1.pir' line 3
error:imcc:syntax error, unexpected IDENTIFIER, expecting '(' ('empty')
in file 'pbc_1.pir' line 4
error:imcc:syntax error, unexpected STRINGC, expecting '(' ('"ok\n"')
in file 'pbc_1.pir' line 5

Program exited with code 01.
(gdb) bt
No stack.
```

Originally http://trac.parrot.org/parrot/ticket/1243 by jkeenan (@jkeenan)