@@ -15,17 +15,6 @@ use libc::size_t;
15
15
use task:: TaskBuilder ;
16
16
use comm = core:: comm;
17
17
18
- export TestName ;
19
- export TestFn ;
20
- export TestDesc ;
21
- export test_main;
22
- export TestResult ;
23
- export TestOpts ;
24
- export TrOk ;
25
- export TrFailed ;
26
- export TrIgnored ;
27
- export run_tests_console;
28
-
29
18
#[ abi = "cdecl" ]
30
19
extern mod rustrt {
31
20
#[ legacy_exports] ;
@@ -36,17 +25,17 @@ extern mod rustrt {
36
25
// paths; i.e. it should be a series of identifiers seperated by double
37
26
// colons. This way if some test runner wants to arrange the tests
38
27
// hierarchically it may.
39
- type TestName = ~str ;
28
+ pub type TestName = ~str ;
40
29
41
30
// A function that runs a test. If the function returns successfully,
42
31
// the test succeeds; if the function fails then the test fails. We
43
32
// may need to come up with a more clever definition of test in order
44
33
// to support isolation of tests into tasks.
45
- type TestFn = fn ~( ) ;
34
+ pub type TestFn = fn ~( ) ;
46
35
47
36
// The definition of a single test. A test runner will run a list of
48
37
// these.
49
- type TestDesc = {
38
+ pub type TestDesc = {
50
39
name : TestName ,
51
40
testfn : TestFn ,
52
41
ignore : bool ,
@@ -55,7 +44,7 @@ type TestDesc = {
55
44
56
45
// The default console test runner. It accepts the command line
57
46
// arguments and a vector of test_descs (generated at compile time).
58
- fn test_main ( args : & [ ~str ] , tests : & [ TestDesc ] ) {
47
+ pub fn test_main ( args : & [ ~str ] , tests : & [ TestDesc ] ) {
59
48
let opts =
60
49
match parse_opts ( args) {
61
50
either:: Left ( move o) => o,
@@ -64,7 +53,7 @@ fn test_main(args: &[~str], tests: &[TestDesc]) {
64
53
if !run_tests_console ( & opts, tests) { fail ~"Some tests failed"; }
65
54
}
66
55
67
- type TestOpts = { filter : Option < ~str > , run_ignored : bool ,
56
+ pub type TestOpts = { filter : Option < ~str > , run_ignored : bool ,
68
57
logfile : Option < ~str > } ;
69
58
70
59
type OptRes = Either < TestOpts , ~str > ;
@@ -93,7 +82,7 @@ fn parse_opts(args: &[~str]) -> OptRes {
93
82
return either:: Left ( test_opts) ;
94
83
}
95
84
96
- enum TestResult { TrOk , TrFailed , TrIgnored , }
85
+ pub enum TestResult { TrOk , TrFailed , TrIgnored , }
97
86
98
87
impl TestResult : Eq {
99
88
pure fn eq ( other : & TestResult ) -> bool {
@@ -113,7 +102,7 @@ type ConsoleTestState =
113
102
mut failures : ~[ TestDesc ] } ;
114
103
115
104
// A simple console test runner
116
- fn run_tests_console( opts : & TestOpts ,
105
+ pub fn run_tests_console( opts : & TestOpts ,
117
106
tests : & [ TestDesc ] ) -> bool {
118
107
119
108
fn callback ( event : & TestEvent , st : ConsoleTestState ) {
0 commit comments