/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
- REBOL [
- Title: "Generates Red/System lib tests"
- Author: "Peter W A Wood"
- File: %make-lib-auto-test.r
- Version: 0.1.1
- Rights: "Copyright (C) 2011 Peter W A Wood. All rights reserved."
- License: "BSD-3 - https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt"
- ]
- ;; initialisations
- make-dir %auto-tests/
- file-out: %auto-tests/lib-auto-test.reds
- file-in: %lib-test-source.reds
- ;; get base dir address
- base-dir: to-local-file system/script/path
- ;; work out prefix and extension based on version
- switch/default fourth system/version [
- 2 [
- abs-path: join "" [base-dir "/libs/"]
- prefix: "lib"
- ext: ".dylib"
- ]
- 3 [
- abs-path: join "" [base-dir "\libs\"]
- prefix: ""
- ext: ".dll"
- ]
- ][ ;; default to libxxx.so
- abs-path: join "" [base-dir "/libs/"]
- prefix: "lib"
- ext: ".so"
- ]
- ;; read the file, insert the absolute path and file prefix and extension
- src: read file-in
- replace/all src "***abs-path***" abs-path
- replace/all src "###prefix###" prefix
- replace/all src "@@@extension@@@" ext
- write file-out src