1
- # InlineTest
1
+ # ReTest
2
2
3
3
This package allows:
4
4
@@ -21,11 +21,11 @@ This package allows:
21
21
exists in the Julia repository to implement regex-filtering for
22
22
` Test.@testset ` .
23
23
24
- The exported ` InlineTest .@testset` macro can be used as a direct replacement for
24
+ The exported ` ReTest .@testset` macro can be used as a direct replacement for
25
25
` Test.@testset ` , and ` runtests() ` has to be called for the tests to be executed.
26
- See the docstrings (reproduced below) for more details. Moreover, ` InlineTest `
26
+ See the docstrings (reproduced below) for more details. Moreover, ` ReTest `
27
27
re-exports (almost) all exported symbols from ` Test ` , so there should not be any
28
- need to import ` Test ` together with ` InlineTest ` .
28
+ need to import ` Test ` together with ` ReTest ` .
29
29
30
30
### ` runtests ` docstring
31
31
@@ -68,7 +68,7 @@ module in which it was written (e.g. `m`, when specified).
68
68
69
69
### Caveats
70
70
71
- ` InlineTest .@testset` comes with a couple of caveats/limitations:
71
+ ` ReTest .@testset` comes with a couple of caveats/limitations:
72
72
73
73
* Toplevel testsets (which are not nested within other testsets), when run, are
74
74
` eval ` ed at the toplevel of their parent module, which means that they can't
@@ -87,16 +87,16 @@ module in which it was written (e.g. `m`, when specified).
87
87
* Testsets can not be "custom testsets" (cf. ` Test ` documentation; this should
88
88
be easy to support).
89
89
90
- * Nested testsets can't be "qualified" (i.e. written as ` InlineTest .@testset` ).
90
+ * Nested testsets can't be "qualified" (i.e. written as ` ReTest .@testset` ).
91
91
92
92
* Regex filtering logic might improve in future versions, which means that with
93
93
the same regex, less tests might be run (or more!). See ` runtests ` 's docstring
94
94
to know what testsets are guaranteed to run.
95
95
96
- ### Switching from ` Test ` to ` InlineTest `
96
+ ### Switching from ` Test ` to ` ReTest `
97
97
98
98
When used in a package ` MyPackage ` , the test code can be organized as follows:
99
- 1 . replace ` using Test ` by ` using InlineTest ` in the "runtests.jl" file
99
+ 1 . replace ` using Test ` by ` using ReTest ` in the "runtests.jl" file
100
100
2 . wrap the whole content of "runtests.jl" within a module named ` MyPackageTests `
101
101
3 . rename "runtests.jl" to "tests.jl"
102
102
4 . create "runtests.jl" with the following content:
@@ -105,7 +105,7 @@ When used in a package `MyPackage`, the test code can be organized as follows:
105
105
This means that running "runtests.jl" will have the same net effect as before.
106
106
The "tests.jl" file can now be ` include ` d in your REPL session (` include("tests.jl") ` ),
107
107
and you can run all or some of its tests
108
- (e.g. ` using InlineTest ; runtests(MyPackageTests, "addition") ` ).
108
+ (e.g. ` using ReTest ; runtests(MyPackageTests, "addition") ` ).
109
109
Wrapping the tests in ` MyPackageTests ` allows to not pollute ` Main ` , it keeps the tests
110
110
of different packages separated, but more importantly, you can modify "tests.jl" and
111
111
re-include it to have the corresponding tests updated (otherwise, without
@@ -114,12 +114,12 @@ without removing the old ones).
114
114
115
115
### Toplevel testsets
116
116
117
- In ` InlineTest ` , toplevel testsets are special, as already mentioned. The fact
117
+ In ` ReTest ` , toplevel testsets are special, as already mentioned. The fact
118
118
that they are ` eval ` ed at the module's toplevel also means that we can actually
119
119
filter them out (if a filtering pattern is given to ` runtests ` ) "statically",
120
120
i.e. by introspection, we can figure out whether they should be run before
121
121
having to ` eval ` the corresponding code. This is a big win, in particular for
122
- ` testsets-for ` , which are expensive to compile. This allows ` InlineTest ` to
122
+ ` testsets-for ` , which are expensive to compile. This allows ` ReTest ` to
123
123
compete with the good-old manual way of copy-pasting the wanted ` @testset ` into
124
124
the REPL (without this trick, all the testsets would have to be ` eval ` ed, even
125
125
when they don't run any code, and this can take some time for large test
0 commit comments