-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathrun-tests.r
43 lines (37 loc) · 986 Bytes
/
run-tests.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
Rebol [
Title: "Run-tests"
File: %run-tests.r
Copyright: [2014 "Saphirion AG"]
Author: "Ladislav Mecir"
License: {
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
}
Author: "Ladislav Mecir"
Purpose: {Click and run tests in a file or directory.}
]
do %test-framework.r
run-tests: func [
tests
/local
result log-file summary log-file-prefix suffix
] [
if dir? tests [
tests: dirize tests
change-dir tests
foreach file read tests [
; check if it is a test file
if %.tst = find/last file %. [run-tests file]
]
exit
]
; having an individual file
suffix: find/last tests %.
log-file-prefix: copy/part tests suffix
print "Testing ..."
change-dir first split-path tests
set [log-file summary] do-recover tests [] none log-file-prefix
]
run-tests to-rebol-file system/script/args