File tree Expand file tree Collapse file tree 4 files changed +35
-6
lines changed
Expand file tree Collapse file tree 4 files changed +35
-6
lines changed Original file line number Diff line number Diff line change 1- .PHONY : test
1+ TESTS = known auto
22
3- test :
4- go build main/test.go
5- prove -v -e ' ' ./test
3+ .PHONY : $(TESTS )
4+
5+ all : $(TESTS )
6+
7+ $(TESTS ) : % : test/% /main.go
8+ go build -o $@ test/$@ /main.go
9+ prove -v -e ' ' ./$@
Original file line number Diff line number Diff line change @@ -15,10 +15,14 @@ func New() *T {
1515}
1616
1717// Header displays a TAP header including version number and expected
18- // number of tests to run.
18+ // number of tests to run. For an unknown number of tests, set
19+ // testCount to zero (in which case the plan is not written); this is
20+ // useful with AutoPlan.
1921func (t * T ) Header (testCount int ) {
2022 fmt .Printf ("TAP version 13\n " )
21- fmt .Printf ("1..%d\n " , testCount )
23+ if testCount > 0 {
24+ fmt .Printf ("1..%d\n " , testCount )
25+ }
2226}
2327
2428// Ok generates TAP output indicating whether a test passed or failed.
Original file line number Diff line number Diff line change 1+ package main
2+
3+ import "github.com/mndrix/tap.go"
4+
5+ func main () {
6+ t := tap .New ()
7+ t .Header (0 )
8+ t .Ok (true , "first test" )
9+ t .Ok (true , "second test" )
10+ t .AutoPlan ()
11+ }
Original file line number Diff line number Diff line change 1+ package main
2+
3+ import "github.com/mndrix/tap.go"
4+
5+ func main () {
6+ t := tap .New ()
7+ t .Header (2 )
8+ t .Ok (true , "first test" )
9+ t .Ok (true , "second test" )
10+ }
You can’t perform that action at this time.
0 commit comments