PageRenderTime 16ms CodeModel.GetById 9ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/red-system/tests/run-all.r

http://github.com/dockimbel/Red
R | 159 lines | 133 code | 26 blank | 0 comment | 6 complexity | 4a892737ff51fde14d1a4a9fb91b9187 MD5 | raw file
  1REBOL [
  2  Title:   "Builds and Runs the Red/System Tests"
  3	File: 	 %run-all.r
  4	Author:  "Peter W A Wood"
  5	Version: 0.7.0
  6	License: "BSD-3 - https://github.com/dockimbel/Red/blob/master/BSD-3-License.txt"
  7]
  8
  9make-if-needed?: func [
 10  auto-test-file [file!]
 11  make-file [file!]
 12  /lib-test
 13  /local
 14    stored-length   ; the length of the make... .r file used to build auto tests
 15    stored-file-length
 16    digit
 17    number
 18    rule
 19][
 20  stored-file-length: does [
 21    parse/all read auto-test-file rule
 22    stored-length
 23  ]
 24  digit: charset [#"0" - #"9"]
 25  number: [some digit]
 26  rule: [
 27    thru ";make-length:" 
 28    copy stored-length number (stored-length: to integer! stored-length)
 29    to end
 30  ]
 31  
 32  if not exists? make-file [return]
 33 
 34  if any [
 35    not exists? auto-test-file
 36    stored-file-length <> length? read make-file
 37    (modified? make-file) > (modified? auto-test-file)
 38  ][
 39    print ["Making" auto-test-file " - it will take a while"]
 40    do make-file
 41  ]
 42]
 43
 44;; supress script messages
 45store-quiet-mode: system/options/quiet
 46system/options/quiet: true
 47
 48do %../../quick-test/quick-test.r
 49qt/tests-dir: system/script/path
 50
 51;; make auto files if needed
 52make-if-needed? %source/units/auto-tests/byte-auto-test.reds
 53                %source/units/make-byte-auto-test.r
 54                      
 55make-if-needed? %source/units/auto-tests/integer-auto-test.reds
 56                %source/units/make-integer-auto-test.r
 57                
 58make-if-needed? %source/units/auto-tests/maths-auto-test.reds
 59                %source/units/make-maths-auto-test.r
 60
 61;; make lib-test file if needed
 62lib-test-len: length? read %source/units/lib-test-source.reds
 63save-len: either exists? %source/units/len-lib-test.dat [
 64  load %source/units/len-lib-test.dat
 65][
 66  -1
 67]
 68
 69if any [
 70  not exists? %source/units/auto-tests/lib-auto-test.reds
 71  lib-test-len <> save-len 
 72][
 73  save %source/units/len-lib-test.dat lib-test-len
 74  print "Making lib-test-auto.reds - shouldn't take long"
 75  do %source/units/make-lib-auto-test.r                         
 76]
 77
 78;; run the tests
 79print rejoin ["Quick-Test v" qt/version]
 80print rejoin ["REBOL " system/version]
 81
 82start-time: now/precise
 83
 84;; any .reds test with more than one space between --run-test-file-quiet and 
 85;;  the filename will be excluded from the ARM tests
 86
 87***start-run-quiet*** "Red/System Test Suite"
 88
 89===start-group=== "Datatype tests"
 90  --run-test-file-quiet %source/units/logic-test.reds
 91 ; --run-test-file-quiet  %source/units/integer-test.reds   ;; excluded from ARM tests       
 92  --run-test-file-quiet %source/units/byte-test.reds
 93  --run-test-file-quiet %source/units/c-string-test.reds
 94  --run-test-file-quiet %source/units/struct-test.reds
 95  --run-test-file-quiet %source/units/pointer-test.reds
 96  --run-test-file-quiet %source/units/cast-test.reds
 97  --run-test-file-quiet %source/units/alias-test.reds
 98  --run-test-file-quiet %source/units/length-test.reds
 99  --run-test-file-quiet %source/units/null-test.reds
100===end-group===
101
102===start-group=== "Native functions tests"
103  --run-test-file-quiet %source/units/not-test.reds
104  --run-test-file-quiet %source/units/size-test.reds
105  --run-test-file-quiet %source/units/function-test.reds
106  --run-test-file-quiet %source/units/case-test.reds
107  --run-test-file-quiet %source/units/switch-test.reds
108===end-group===
109
110===start-group=== "Special natives tests"
111  --run-test-file-quiet %source/units/exit-test.reds
112  --run-test-file-quiet %source/units/return-test.reds
113===end-group===
114
115===start-group=== "Math operators tests"
116  --run-test-file-quiet %source/units/modulo-test.reds
117  --run-test-file-quiet %source/units/math-mixed-test.reds
118===end-group===
119
120===start-group=== "Infix syntax for functions"
121  --run-test-file-quiet %source/units/infix-test.reds
122===end-group===
123
124===start-group=== "Conditional tests"
125  --run-test-file-quiet %source/units/conditional-test.reds
126===end-group===
127
128===start-group=== "Auto-tests"
129  --run-test-file-quiet %source/units/auto-tests/byte-auto-test.reds
130  --run-test-file-quiet %source/units/auto-tests/integer-auto-test.reds
131  --run-test-file-quiet %source/units/auto-tests/maths-auto-test.reds
132  --run-test-file-quiet  %source/units/auto-tests/lib-auto-test.reds ;; excluded from ARM tests
133===end-group===
134
135===start-group=== "Compiler Tests"
136  --run-script-quiet %source/compiler/alias-test.r
137  --run-script-quiet %source/compiler/cast-test.r
138  --run-script-quiet %source/compiler/comp-err-test.r
139  --run-script-quiet %source/compiler/exit-test.r
140  --run-script-quiet %source/compiler/int-literals-test.r
141  --run-script-quiet %source/compiler/output-test.r
142  --run-script-quiet %source/compiler/return-test.r
143  --run-script-quiet %source/compiler/cond-expr-test.r
144  --run-script-quiet %source/compiler/inference-test.r
145  --run-script-quiet %source/compiler/callback-test.r
146  --run-script-quiet %source/compiler/infix-test.r
147  --run-script-quiet %source/compiler/not-test.r
148  --run-script-quiet %source/compiler/print-test.r
149===end-group===
150
151***end-run-quiet***
152
153end-time: now/precise
154print ["       in" difference end-time start-time newline]
155system/options/quiet: store-quiet-mode
156ask "hit enter to finish"
157print ""
158
159