forked from red/red
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-all.r
57 lines (47 loc) · 1.3 KB
/
run-all.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
REBOL [
Title: "Builds and Runs All Red and Red/System Tests"
File: %run-all.r
Author: "Peter W A Wood"
Version: 0.2.1
License: "BSD-3 - https://github.com/dockimbel/Red/blob/master/BSD-3-License.txt"
]
;; function to find and run-tests
run-all-script: func [dir [file!]][
qt/tests-dir: system/script/path/:dir
foreach line read/lines dir/run-all.r [
if any [
find line "===start-group"
find line "--run-"
find line "qt/make-if-needed?"
][
do line
]
]
]
;; should we run non-interactively?
batch-mode: all [system/options/args find system/options/args "--batch"]
;; supress script messages
store-quiet-mode: system/options/quiet
system/options/quiet: true
store-current-dir: what-dir
change-dir %quick-test/
do %quick-test.r
;; run the tests
print rejoin ["Quick-Test v" qt/version]
print rejoin ["REBOL " system/version]
start-time: now/precise
***start-run-quiet*** "Complete Red Test Suite"
run-all-script %../red/tests/
run-all-script %../red-system/tests/
***end-run-quiet***
end-time: now/precise
print [" in" difference end-time start-time newline]
system/options/quiet: store-quiet-mode
change-dir store-current-dir
either batch-mode [
quit/return either qt/test-run/failures > 0 [1] [0]
] [
ask "hit enter to finish"
print ""
qt/test-run/failures
]