Getting LNT to work with non-bash shell

I followed the LNT quickstart guide (http://llvm.org/docs/lnt/quickstart.html) on my debian machine, and it seems to have a problem running. When I consult test.log, every single test has a section like this

Pretend that the reference output was produced instantaneously.

cp /home/jeremy/hardware/llvm/test-suite/instant.txt Output/sse.expandfft.out-nat.time
/home/jeremy/hardware/llvm/test-suite/DiffOutput.sh “/home/jeremy/hardware/llvm/mysandbox/test-2014-06-24_20-20-59/tools/fpcmp -r 0.016” simple sse.expandfft
rm -f Output/sse.expandfft.exe-simple
cp Output/sse.expandfft.diff-simple Output/sse.expandfft.exe-simple
/bin/sh: 7: test: 0: unexpected operator
if test -f Output/sse.expandfft.extra-results.txt; then
/home/jeremy/hardware/llvm/test-suite/ParseMultipleResults /home/jeremy/hardware/llvm/mysandbox/test-2014-06-24_20-20-59/SingleSource/UnitTests/Vector/SSE/sse.expandfft Output/sse.expandfft.extra-results.txt >> Output/sse.expandfft.simple.exec.report.txt;
fi
cat Output/sse.expandfft.simple.compile.report.txt Output/sse.expandfft.simple.exec.report.txt >> Output/sse.expandfft.simple.report.txt

Notice the line “/bin/sh: 7: test: 0: unexpected operator”.

Although I don’t understand how the LNT infrastructure works exactly, I’m pretty sure that this is an error due to the difference between bash and dash, the default /bin/sh on debian. When I tried running one of the make commands that LNT runs with the additional option SHELL=/bin/bash I got similar output, but without the error. I’m not sure what bash specific features are being used.

I’d want LNT to use bash as a workaround, but I’m not sure how to change which shell LNT uses (export SHELL=/bin/bash doesn’t work).

Any help with this would be appreciated.

Jeremy

Jeremy Salwen <jeremysalwen@gmail.com> writes:

I followed the LNT quickstart guide
(http://llvm.org/docs/lnt/quickstart.html) on my debian machine, and
it seems to have a problem running. When I consult test.log, every
single test has a section like this

    # Pretend that the reference output was produced instantaneously.
    cp /home/jeremy/hardware/llvm/test-suite/instant.txt Output/
    sse.expandfft.out-nat.time
    /home/jeremy/hardware/llvm/test-suite/DiffOutput.sh "/home/jeremy/hardware
    /llvm/mysandbox/test-2014-06-24_20-20-59/tools/fpcmp -r 0.016" simple
    sse.expandfft
    rm -f Output/sse.expandfft.exe-simple
    cp Output/sse.expandfft.diff-simple Output/sse.expandfft.exe-simple
    /bin/sh: 7: test: 0: unexpected operator
    if test -f Output/sse.expandfft.extra-results.txt; then \
     /home/jeremy/hardware/llvm/test-suite/ParseMultipleResults /home/
    jeremy/hardware/llvm/mysandbox/test-2014-06-24_20-20-59/SingleSource/
    UnitTests/Vector/SSE/sse.expandfft Output/sse.expandfft.extra-results.txt
    >> Output/sse.expandfft.simple.exec.report.txt; \
     fi
    cat Output/sse.expandfft.simple.compile.report.txt Output/
    sse.expandfft.simple.exec.report.txt >> Output/
    sse.expandfft.simple.report.txt

Notice the line "/bin/sh: 7: test: 0: unexpected operator".

Although I don't understand how the LNT infrastructure works exactly, I'm
pretty sure that this is an error due to the difference between bash and dash,
the default /bin/sh on debian. When I tried running one of the make commands
that LNT runs with the additional option SHELL=/bin/bash I got similar output,
but without the error. I'm not sure what bash specific features are being
used.

Looks like TEST.simple.Makefile is using the == operator, which isn't
POSIX. Does the attached patch to the test-suite help?

test-suite-posix.patch (382 Bytes)

The attached patch didn’t fix it, but when I also changed another == to = a few lines further down it seemed to work.

Jeremy

It seems that TEST.dbg.Makefile also uses the == operator.

I've updated both TEST.simple.Makefile and TEST.dbg.Makefile in
r211729. Hopefully that should clear things up.

Jeremy Salwen <jeremysalwen@gmail.com> writes: