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

/red-system/tests/source/units/make-lib-auto-test.r

http://github.com/dockimbel/Red
R | 51 lines | 37 code | 14 blank | 0 comment | 0 complexity | 8e2ae08a3ae8858b7bdc052eff6bba04 MD5 | raw file
 1REBOL [
 2  Title:   "Generates Red/System lib tests"
 3	Author:  "Peter W A Wood"
 4	File: 	 %make-lib-auto-test.r
 5	Version: 0.1.1
 6	Rights:  "Copyright (C) 2011 Peter W A Wood. All rights reserved."
 7	License: "BSD-3 - https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt"
 8]
 9
10;; initialisations 
11make-dir %auto-tests/
12file-out: %auto-tests/lib-auto-test.reds
13file-in: %lib-test-source.reds
14
15;; get base dir address 
16base-dir: to-local-file system/script/path  
17
18;; work out prefix and extension based on version
19switch/default fourth system/version [
20  2 [
21    abs-path: join "" [base-dir "/libs/"]
22    prefix: "lib"
23    ext: ".dylib"
24  ]
25  3 [
26    abs-path: join "" [base-dir "\libs\"]
27    prefix: ""
28    ext: ".dll"
29  ]
30][                                    ;; default to libxxx.so
31    abs-path: join "" [base-dir "/libs/"]
32    prefix: "lib"
33    ext: ".so"
34]
35
36;; read the file, insert the absolute path and file prefix and extension
37src: read file-in
38replace/all src "***abs-path***" abs-path
39replace/all src "###prefix###" prefix
40replace/all src "@@@extension@@@" ext
41
42write file-out src
43
44
45
46
47
48
49
50
51