Skip to content

Commit af9870c

Browse files
committed
tests: re-enable integration test suite
1 parent bbdc9c6 commit af9870c

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
@@ -14,7 +14,7 @@ import (
1414
// We count the number of suites run at least to get a vague hint that the
1515
// test suite is behaving as it should. Otherwise a bug introduced at the
1616
// very core of the system could go unperceived.
17-
const suitesRunExpected = 6
17+
const suitesRunExpected = 7
1818

1919
var suitesRun int = 0
2020

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(c, "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: \n"+
49+
" c.Check(42, Equals, 43)\n"+
50+
" ... obtained int = 42\n"+
51+
" ... expected int = 43\n")
52+
53+
c.Check(output.Status("integrationTestHelper/TestMultiLineStringEqualFails"), Equals, "fail")
54+
c.Check(output.Logs("integrationTestHelper/TestMultiLineStringEqualFails"), Equals, ""+
55+
" integration_test.go:19: \n"+
56+
" c.Check(\"foo\\nbar\\nbaz\\nboom\\n\", Equals, \"foo\\nbaar\\nbaz\\nboom\\n\")\n"+
57+
" ... obtained string = \"\" +\n"+
58+
" ... \"foo\\n\" +\n"+
59+
" ... \"bar\\n\" +\n"+
60+
" ... \"baz\\n\" +\n"+
61+
" ... \"boom\\n\"\n"+
62+
" ... expected string = \"\" +\n"+
63+
" ... \"foo\\n\" +\n"+
64+
" ... \"baar\\n\" +\n"+
65+
" ... \"baz\\n\" +\n"+
66+
" ... \"boom\\n\"\n"+
67+
" ... String difference:\n"+
68+
" ... [1]: \"bar\" != \"baar\"\n")
69+
70+
c.Check(output.Status("integrationTestHelper/TestStringEqualFails"), Equals, "fail")
71+
c.Check(output.Logs("integrationTestHelper/TestStringEqualFails"), Equals, ""+
72+
" integration_test.go:23: \n"+
73+
" c.Check(\"foo\", Equals, \"bar\")\n"+
74+
" ... obtained string = \"foo\"\n"+
75+
" ... expected string = \"bar\"\n")
76+
77+
c.Check(output.Status("integrationTestHelper/TestStructEqualFails"), Equals, "fail")
78+
c.Check(output.Logs("integrationTestHelper/TestStructEqualFails"), Equals, ""+
79+
" integration_test.go:35: \n"+
80+
" c.Check(complexStruct{1, 2}, Equals, complexStruct{3, 4})\n"+
81+
" ... obtained check_test.complexStruct = check_test.complexStruct{r:1, i:2}\n"+
82+
" ... expected check_test.complexStruct = check_test.complexStruct{r:3, i:4}\n"+
83+
" ... Difference:\n"+
84+
" ... r: 1 != 3\n"+
85+
" ... i: 2 != 4\n")
9686
}

testhelper_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ func TestHelperSuite(t *testing.T) {
3333
suite.panicOn = *helperPanicFlag
3434
}
3535
check.Run(t, suite)
36+
case "integrationTestHelper":
37+
check.Run(t, &integrationTestHelper{})
3638
default:
3739
t.Skip()
3840
}

0 commit comments

Comments
 (0)