ccoVeille
85d8bb6eea
fix typos in comments, tests and github templates
2024-02-24 23:48:24 +01:00
Arjun Mahishi
c41592ba5f
suite: fix deadlock in suite.Require()/Assert()
...
As pointed out in issue #1520 , if the suite is not initialised properly
(buy calling the Run function), then calling suite.Require() or
suite.Assert() will result in a deadlock.
This commit fixes that by panicking if the suite is not initialised
properly. This is justified because, the suite is intended to be
triggered in the right way. If the user does not do that, this panic will
nudge them in the right direction.
It has to be a panic because, at this point, we don't have access to any
testing.T context to gracefully call a t.Fail(). Also, these two
functions are not expected to return an error.
Fixes #1520
2024-02-18 23:55:01 +05:30
Olivier Mengué
db8608ed63
suite: fix subtest names ( fix #1501 ) ( #1504 )
...
* suite: fix TestSubtestPanic failure (#1501 )
The subtest of TestSubtestPanic is expected to fail, but that must not
make the testuite of package 'suite' to fail. So call Skip to make 'go
test' to ignore that expected failure.
* suite: fix subtests names
We are doing dirty things with testing.InternalTest. It looks like test
names should have the same prefix as the parent test, like if they were
true subtests (testing.T.Run).
So until we drop our usage of testing.InternamTest, let's rename the
tests.
Also added a few checks of the testing.RunTests result.
2023-11-09 10:44:27 +10:00
Linus Barth
7df1a82a31
test: add suite tests for panicking of subtests
2023-10-30 22:51:08 +01:00
Linus Barth
65318c364a
improve: tests for asserting test names in subtests
2023-10-30 22:51:08 +01:00
Linus Barth
130d340262
improve: move comment to msgAndArgs-param in test
2023-10-30 22:51:08 +01:00
Linus Barth
855d1c6784
test: testing.T correctness in subtests setup/teardown
2023-10-30 22:51:08 +01:00
Linus Barth
82022eeb0d
test: call order of setup/teardown for subtests
2023-10-30 22:51:08 +01:00
Oleksandr Redko
351d2776c6
Revert some changes
2023-10-30 22:41:11 +01:00
Oleksandr Redko
375474cd3c
suite: refactor test assertions
2023-10-30 22:41:11 +01:00
Vadym Tishchenko
1333b5d3bd
Add sub-tests to Suite ( #1246 )
...
Co-authored-by: Vadym Tishchenko <v.tishchenko@evopay.com.ua>
2022-11-02 21:46:59 +10:00
nicoche
1b73601ae8
suite: correctly set stats on test panic ( #1195 )
2022-06-23 19:40:15 +10:00
ariley
d76ac5e41f
Fix comment
2020-05-05 08:16:34 +10:00
ariley
1bbde5e52a
Change Require to Error
2020-05-05 08:16:34 +10:00
ariley
f96052c82a
Remove 1.8 and 1.9 tests. Updated failfast test
2020-05-05 08:16:34 +10:00
ariley
93bea66f75
Added TestSuiteWithFailfast
2020-05-05 08:16:34 +10:00
Esdras Beleza de Noronha
961bfee4b1
Add function to return if all tests in a suite passed
2020-03-11 19:42:32 +11:00
Esdras Beleza
e8910bb335
Add stats to suites and tests
2020-03-11 19:42:32 +11:00
Boyan
3ebf1ddaeb
Revert PR #867
2020-02-20 07:56:11 +11:00
Boyan Soubachov
55d8b5740c
Add interface tests for suite.T
2020-02-06 07:41:25 +11:00
devdinu
3c60a0e014
Merging suite_order_test in suite test, removing anonymous defer func call
2020-01-16 14:06:22 +11:00
Leigh McCulloch
3b0d317f67
Fix code not gofmtd
2019-12-09 10:12:49 -07:00
Tigran Saluev
943c6e8f43
Add test on suite setup skipping
2019-02-14 09:28:04 -07:00
Tigran Saluev
af4cbaf11d
Rerun build
2019-02-14 09:28:04 -07:00
Tigran Saluev
2696ec2b70
Fix tests
2019-02-14 09:28:04 -07:00
Kyl Wellman
865fb2c8f5
Add support for subtests (go 1.7)
2019-01-02 10:25:22 -07:00
Iaroslav Ciupin
660f15d67d
Recover panic in suite
2018-12-24 10:37:47 -07:00
Ben Blount
3104bf5483
Use Go 1.7 subtests so suites can properly nest
...
This removes dependencies on Go Testing Internals and
also enables test methods within a suite to have subtests.
Fixes #346
2017-05-29 12:27:49 +01:00
Esdras Beleza
5e72f93a89
Remove timestamp from callback
2016-09-26 13:48:19 -03:00
Esdras Beleza
bf7a93e70c
Add timestamp
2016-06-26 18:36:07 -03:00
Esdras Beleza
fcedfe2aad
Add callbacks to run before and after each test
2016-06-26 18:35:37 -03:00
Ernesto Jiménez
95644cab17
Fixes issue #149
2015-11-01 15:12:29 +00:00
Samuel Nelson
354307edce
Add getters for *assert.Assertions and *require.Assertions
2015-01-19 12:15:53 -07:00
Jon Gjengset
576f6382c0
Add test for suite Setup/TearDown with Skip
2014-11-25 19:57:20 -05:00
Jon Gjengset
c1b496c5c9
Ensure TearDownTest is called after Skip
2014-11-03 17:46:03 -05:00
Oliver Beattie
8fb35d6c24
Fix up TestSuiteLogging in verbose mode
2014-08-17 17:34:01 +01:00
Tyler Bunnell
459056d303
Merge forward assertions.
2014-06-30 11:34:00 -06:00
Sean Talts
c469b75615
Change NoError formatting.
2014-04-04 11:36:55 -04:00
taichi
52f556e421
Simplify the API by using the new assertion.
2014-03-11 16:39:56 +09:00
Sean Talts
ec1a3f179c
Remove debug print, go fmt my lines
2014-03-07 14:57:40 -05:00
Sean Talts
814eb1589b
Add test for logging capture.
2014-03-07 14:51:52 -05:00
Samuel Nelson
c737e6cc4e
Some clarification for the documentation in the example test suite.
2013-10-15 11:56:36 -06:00
Samuel Nelson
2d29e774c7
Updated documentation with some information about testing suites
2013-10-15 11:35:37 -06:00
Samuel Nelson
11dce72087
Renamed before/after methods and interfaces to setup/teardown
2013-10-15 10:32:35 -06:00
Sam Nelson
a4c24896e3
Initial buildup/teardown functionality for issue 19
2013-10-14 15:13:28 -06:00