When shUnitPlus and the tests are in different directories, shUnitPlus
write an error message.
For example, with the following structure :
errorInShUnitPlus
lib/
|-Shunit/
|-shUnit
|-shUnitPlus
and test file containing :
#!/bin/bash
export SHUNIT_HOME=lib/ShUnit
. $SHUNIT_HOME/shUnit
. $SHUNIT_HOME/shUnitPlus
the output begin with
lib/ShUnit/shUnitPlus: line 11: ./shUnit: no such file or directory
It's very confusing because when test is a success, there is an error
message. I have attached a unit test for this issue :
#!/bin/bash
export SHUNIT_HOME=lib/ShUnit
. $SHUNIT_HOME/shUnit
TestNoErrorMessage() {
errorOutput=`. $SHUNIT_HOME/shUnitPlus 2>&1`
shuStringEqual "" $errorOutput
}
shuStringEqual() {
[ x"${1}" = x"${2}" ]
shuAssert "StringEquals: ${1} vs. ${2}" $?
}
shuStart
Nobody/Anonymous ( nobody ) - 2008-08-15 09:59
5
Closed
None
Nobody/Anonymous
None
None
Public
|
Date: 2008-11-02 18:07 Fixed in release 1.5. |
|
Date: 2008-08-17 13:31
|
| Filename | Description | Download |
|---|---|---|
| testSourcingShUnitPlus.sh | unit test for the error message when sourcing shUnitPlus | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| status_id | Open | 2008-11-02 18:07 | lacton |
| close_date | - | 2008-11-02 18:07 | lacton |
| File Added | 288780: testSourcingShUnitPlus.sh | 2008-08-15 09:59 | nobody |