Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#8 1.5 AcceptanceTests fail on Mac OS X when using sh

open
nobody
None
5
2012-12-11
2008-11-18
Matt Brozowski
No

When running the acceptence tests under sh on Mac OS X using /bin/sh the shUnitAcceptanceTest produces many failures

However the tests all run fine under bash on Mac OS X.

$ ./shUnitAcceptanceTest
Available shells: -n sh
-n bash

****** shUnitAcceptanceTest ******
9 tests to run:
Test 1: TestNoTest .E...E..
"Expected 'shUnit: No tests to run' with -n" failed.
"Expected 'shUnit: No tests to run' with -n" failed.
Test 2: Test1SuccessfulTest ./shUnitAcceptanceTest: line 183: -n: command not found
EEE..../shUnitAcceptanceTest: line 183: -n: command not found
EEE...
"Expected exit code 0 with -n" failed.
"Expected '1 test succeeded.' with -n" failed.
"Expected 'No tests failed.' with -n" failed.
"Expected exit code 0 with -n" failed.
"Expected '1 test succeeded.' with -n" failed.
"Expected 'No tests failed.' with -n" failed.
Test 3: Test1FailingTest ./shUnitAcceptanceTest: line 183: -n: command not found
EEE..../shUnitAcceptanceTest: line 183: -n: command not found
EEE...
"Expected exit code 1 with -n" failed.
"Expected 'No tests succeeded.' with -n" failed.
"Expected '1 test failed.' with -n" failed.
"Expected exit code 1 with -n" failed.
"Expected 'No tests succeeded.' with -n" failed.
"Expected '1 test failed.' with -n" failed.
Test 4: Test2SuccessfulTests ./shUnitAcceptanceTest: line 183: -n: command not found
EEE..../shUnitAcceptanceTest: line 183: -n: command not found
EEE...
"Expected exit code 0 with -n" failed.
"Expected '2 tests succeeded.' with -n" failed.
"Expected 'No tests failed.' with -n" failed.
"Expected exit code 0 with -n" failed.
"Expected '2 tests succeeded.' with -n" failed.
"Expected 'No tests failed.' with -n" failed.
Test 5: Test1SuccessAnd1FailureInTheSameTest ./shUnitAcceptanceTest: line 183: -n: command not found
EEE..../shUnitAcceptanceTest: line 183: -n: command not found
EEE...
"Expected exit code 1 with -n" failed.
"Expected 'No tests succeeded.' with -n" failed.
"Expected '1 test failed.' with -n" failed.
"Expected exit code 1 with -n" failed.
"Expected 'No tests succeeded.' with -n" failed.
"Expected '1 test failed.' with -n" failed.
Test 6: Test1SuccessAnd1FailureInDifferentTests ./shUnitAcceptanceTest: line 183: -n: command not found
EEE..../shUnitAcceptanceTest: line 183: -n: command not found
EEE...
"Expected exit code 1 with -n" failed.
"Expected '1 test succeeded.' with -n" failed.
"Expected '1 test failed.' with -n" failed.
"Expected exit code 1 with -n" failed.
"Expected '1 test succeeded.' with -n" failed.
"Expected '1 test failed.' with -n" failed.
Test 7: Test126FailingTests ./shUnitAcceptanceTest: line 183: -n: command not found
E../shUnitAcceptanceTest: line 183: -n: command not found
E.
"Expected exit code 126 with -n" failed.
"Expected exit code 126 with -n" failed.
Test 8: Test127FailingTests ./shUnitAcceptanceTest: line 183: -n: command not found
E../shUnitAcceptanceTest: line 183: -n: command not found
E.
"Expected exit code 126 with -n" failed.
"Expected exit code 126 with -n" failed.
Test 9: TestShuStartWith2Arguments ..E.....E...
"Error message for -n" failed.
"Error message for -n" failed.

9 tests run.
No tests succeeded.
9 tests failed.

Discussion

  • Matt Brozowski
    Matt Brozowski
    2008-11-18

    Looks like the problem is with echo -n

    on sh echo -n sh produces = '-n sh'

    changing the echo /bin/echo fixed the tests