Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

TESTS: added quick-test/run-all.r which runs all Red and Red-System t…

…ests
  • Loading branch information...
commit 827ccb84c9c04764c5daf72d459031fccc83f803 1 parent d6aabe5
@PeterWAWood PeterWAWood authored
View
13 docs/red-system-quick-test.txt
@@ -35,12 +35,10 @@ Quick-Test consists of the following:
run-all.r - a script(s) which runs a set of Red/System tests.
- run-all.r in Red/red-system/tests/ runs the Red/System test suite
- run-all.r in Red/red/tests/ runs the Red test suite
- - run-all.r in Red/ will run all the tests*
+ - run-all.r in Red/ will run all the tests
run-test.r - a script which will run an individual test.
- stored in Red/quick-test/
-* to be written
-
===Directory Structure
Quick-Test uses the following directory structure:
@@ -49,6 +47,7 @@ Quick-Test uses the following directory structure:
quick-test.r
quick-test.reds
quick-unit-test.r
+ run-all.r ;; runs combined Red & Red/System tests
run-test.r ;; runs an individual test
red/
tests/
@@ -73,6 +72,14 @@ The tests are designed to be run from the command line or a REBOL console sessio
The following examples assume that they have been run from the Red dir
+To run all Red & Red/System tests from the console:
+
+ rebol -s quick-test/run-all.r
+
+To run all Red tests from the REBOL console:
+
+ do %quick-test/run-all.r
+
To run all Red tests from the console:
rebol -s red/tests/run-all.r
View
6 quick-test/quick-test.r
@@ -2,7 +2,7 @@ REBOL [
Title: "Simple testing framework for Red/System programs"
Author: "Peter W A Wood"
File: %quick-test.r
- Version: 0.8.1
+ Version: 0.8.2
Rights: "Copyright (C) 2011 Peter W A Wood. All rights reserved."
License: "BSD-3 - https://github.com/dockimbel/Red/blob/master/BSD-3-License.txt"
]
@@ -274,13 +274,14 @@ qt: make object! [
reds-file?: false
test-name: find/last/tail src "/"
test-name: copy/part test-name find test-name "."
- print [ "running " test-name #"^(0D)"]
+ prin [ "running " test-name #"^(0D)"]
clear output
cmd: join to-local-file system/options/boot [" -sc " tests-dir src]
call/output/wait cmd output
add-to-run-totals
write/append log-file output
file/title: test-name
+ replace file/title "-test" ""
_print-summary file
]
@@ -296,7 +297,6 @@ qt: make object! [
do script
]
- ;; This is for quick-unit-test.r (in REBOL)
run-script-quiet: func [src [file!]][
prin [ "running " find/last/tail src "/" #"^(0D)"]
print: :_quiet-print
View
46 quick-test/run-all.r
@@ -0,0 +1,46 @@
+REBOL [
+ Title: "Builds and Runs All Red and Red/System Tests"
+ File: %run-all.r
+ Author: "Peter W A Wood"
+ Version: 0.1.0
+ License: "BSD-3 - https://github.com/dockimbel/Red/blob/master/BSD-3-License.txt"
+]
+;; function to find and run-tests
+run: func [dir [file!]][
+ qt/tests-dir: dir
+ foreach line read/lines dir/run-all.r [
+ if any [
+ find line "===start-group"
+ find line "--run-"
+ ][
+ do line
+ ]
+ ]
+]
+
+;; supress script messages
+store-quiet-mode: system/options/quiet
+system/options/quiet: true
+
+do %quick-test.r
+
+;; run the tests
+print rejoin ["Quick-Test v" system/script/header/version]
+print rejoin ["REBOL " system/version]
+
+start-time: now/precise
+
+***start-run-quiet*** "Complete Red Test Suite"
+
+run %../red/tests/
+run %../red-system/tests/
+
+***end-run-quiet***
+
+end-time: now/precise
+print [" in" difference end-time start-time newline]
+system/options/quiet: store-quiet-mode
+ask "hit enter to finish"
+print ""
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.