Skip to content

Commit 0de55d5

Browse files
committed
tests: re-enable integration test suite
1 parent 5c77636 commit 0de55d5

File tree

3 files changed

+50
-58
lines changed

3 files changed

+50
-58
lines changed

check_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
// We count the number of suites run at least to get a vague hint that the
1818
// test suite is behaving as it should. Otherwise a bug introduced at the
1919
// very core of the system could go unperceived.
20-
const suitesRunExpected = 4
20+
const suitesRunExpected = 5
2121

2222
var suitesRun int = 0
2323

integration_test.go

Lines changed: 47 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//+build nowhere
2-
31
// Integration tests
42

53
package check_test
@@ -37,60 +35,52 @@ func (s *integrationTestHelper) TestStructEqualFails(c *C) {
3735
c.Check(complexStruct{1, 2}, Equals, complexStruct{3, 4})
3836
}
3937

40-
func (s *integrationS) TestOutput(c *C) {
41-
helper := integrationTestHelper{}
42-
output := String{}
43-
Run(&helper, &RunConf{Output: &output})
44-
c.Assert(output.value, Equals, `
45-
----------------------------------------------------------------------
46-
FAIL: integration_test.go:26: integrationTestHelper.TestIntEqualFails
47-
48-
integration_test.go:27:
49-
c.Check(42, Equals, 43)
50-
... obtained int = 42
51-
... expected int = 43
52-
53-
54-
----------------------------------------------------------------------
55-
FAIL: integration_test.go:18: integrationTestHelper.TestMultiLineStringEqualFails
56-
57-
integration_test.go:19:
58-
c.Check("foo\nbar\nbaz\nboom\n", Equals, "foo\nbaar\nbaz\nboom\n")
59-
... obtained string = "" +
60-
... "foo\n" +
61-
... "bar\n" +
62-
... "baz\n" +
63-
... "boom\n"
64-
... expected string = "" +
65-
... "foo\n" +
66-
... "baar\n" +
67-
... "baz\n" +
68-
... "boom\n"
69-
... String difference:
70-
... [1]: "bar" != "baar"
71-
72-
73-
74-
----------------------------------------------------------------------
75-
FAIL: integration_test.go:22: integrationTestHelper.TestStringEqualFails
76-
77-
integration_test.go:23:
78-
c.Check("foo", Equals, "bar")
79-
... obtained string = "foo"
80-
... expected string = "bar"
81-
82-
83-
----------------------------------------------------------------------
84-
FAIL: integration_test.go:34: integrationTestHelper.TestStructEqualFails
85-
86-
integration_test.go:35:
87-
c.Check(complexStruct{1, 2}, Equals, complexStruct{3, 4})
88-
... obtained check_test.complexStruct = check_test.complexStruct{r:1, i:2}
89-
... expected check_test.complexStruct = check_test.complexStruct{r:3, i:4}
90-
... Difference:
91-
... r: 1 != 3
92-
... i: 2 != 4
93-
38+
func (s *integrationS) TestCountSuite(c *C) {
39+
suitesRun += 1
40+
}
9441

95-
`)
42+
func (s *integrationS) TestOutput(c *C) {
43+
exitCode, output := runHelperSuite("integrationTestHelper")
44+
c.Check(exitCode, Equals, 1)
45+
46+
c.Check(output.Status("integrationTestHelper/TestIntEqualFails"), Equals, "FAIL")
47+
c.Check(output.Logs("integrationTestHelper/TestIntEqualFails"), Equals,
48+
` integration_test.go:27:
49+
c.Check(42, Equals, 43)
50+
... obtained int = 42
51+
... expected int = 43`)
52+
53+
c.Check(output.Status("integrationTestHelper/TestMultiLineStringEqualFails"), Equals, "FAIL")
54+
c.Check(output.Logs("integrationTestHelper/TestMultiLineStringEqualFails"), Equals,
55+
` integration_test.go:19:
56+
c.Check("foo\nbar\nbaz\nboom\n", Equals, "foo\nbaar\nbaz\nboom\n")
57+
... obtained string = "" +
58+
... "foo\n" +
59+
... "bar\n" +
60+
... "baz\n" +
61+
... "boom\n"
62+
... expected string = "" +
63+
... "foo\n" +
64+
... "baar\n" +
65+
... "baz\n" +
66+
... "boom\n"
67+
... String difference:
68+
... [1]: "bar" != "baar"`)
69+
70+
c.Check(output.Status("integrationTestHelper/TestStringEqualFails"), Equals, "FAIL")
71+
c.Check(output.Logs("integrationTestHelper/TestStringEqualFails"), Equals,
72+
` integration_test.go:23:
73+
c.Check("foo", Equals, "bar")
74+
... obtained string = "foo"
75+
... expected string = "bar"`)
76+
77+
c.Check(output.Status("integrationTestHelper/TestStructEqualFails"), Equals, "FAIL")
78+
c.Check(output.Logs("integrationTestHelper/TestStructEqualFails"), Equals,
79+
` integration_test.go:35:
80+
c.Check(complexStruct{1, 2}, Equals, complexStruct{3, 4})
81+
... obtained check_test.complexStruct = check_test.complexStruct{r:1, i:2}
82+
... expected check_test.complexStruct = check_test.complexStruct{r:3, i:4}
83+
... Difference:
84+
... r: 1 != 3
85+
... i: 2 != 4`)
9686
}

testhelper_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ func TestHelperSuite(t *testing.T) {
3131
suite.panicOn = *helperPanicFlag
3232
}
3333
check.Run(t, suite)
34+
case "integrationTestHelper":
35+
check.Run(t, &integrationTestHelper{})
3436
default:
3537
t.Skip()
3638
}

0 commit comments

Comments
 (0)