Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#7 Confusing error message with shUnitPlus

closed
nobody
None
5
2008-11-02
2008-08-15
Anonymous
No

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

Discussion

  • unit test for the error message when sourcing shUnitPlus

     
  • Philippe Blayo
    Philippe Blayo
    2008-08-17

    Logged In: YES
    user_id=2181952
    Originator: NO

    I (Philippe Blayo) forgot to register when submitting the issue "Confusing error message with shUnitPlus".
    I apologize for this Anonymous entry. I would like to add another test to describe the behavior of shUnit as being the
    same as shUnitPlus :

    #!/bin/bash
    export SHUNIT_HOME=lib/ShUnit
    . $SHUNIT_HOME/shUnit

    TestNoErrorMessageInShUnitPlus() {
    errorOutput=`. $SHUNIT_HOME/shUnitPlus 2>&1`
    shuStringEqual "" $errorOutput
    }

    TestNoErrorMessageInShUnit() {
    errorOutput=`. $SHUNIT_HOME/shUnit 2>&1`
    shuStringEqual "" $errorOutput
    }

    shuStringEqual() {
    [ x"${1}" = x"${2}" ]
    shuAssert "StringEquals: ${1} vs. ${2}" $?
    }

    shuStart

    --
    Philippe

     
  • lacton
    lacton
    2008-11-02

    • status: open --> closed
     
  • lacton
    lacton
    2008-11-02

    Fixed in release 1.5.

    Enjoy!