bash_unit
bash_unit copied to clipboard
TAP format not valid
The TAP plan is missing at the beginning of the output
See: http://testanything.org/tap-specification.html#the-plan
If you agree with that I can work on a PR.
I need this because the jenkins TAP plugin generate an exception and cant use the report
In the documentation you are refering to : "The plan is optional"
So I do not consider that bash unit TAP format is invalid. I suggest you open an issue on the jenkins plugin.
In the mean time, could you check if the jenkins plugin would accept TAP output with the plan at the end ?
If this is the case I will consider your PR. But be carefull that bash unit can not (at least not easily) display the plan at the beginning of the TAP output.
This is due to the fact that bash unit sources test file before running tests, hence executing all bash code present in the file before running the tests. This is the way one can perform global setup.
Suppose you run two test suites:
bash_unit test_a test_b
With test_a:
test_a() {
assert "test -f /tmp/a.tst"
}
rm /tmp/*.tst
touch /tmp/a.tst
And with test_b:
test_b() {
assert "test -f /tmp/b.tst"
}
rm /tmp/*.tst
touch /tmp/b.tst
bash_unit will first source test_a and run tests inside this file. Then, it will source test_b and run tests inside it. So at the moment bash_unit starts running tests in test_a, it does not know how many tests there are in test_b yet.
As you may guess, sourcing all the test files at first and, then running all the tests of all the file would not work in this exemple.
Hope this comment makes sence.
Regards,
I trust you're doing great @MichaelBitard.
It's been 8 years, I'm closing this issue.
I hope you are doing great too @pgrange!
Indeed I never worked on this, sorry ;)