Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

TESTS: Use std libs for lib-test.reds, remove previous pre-compiled l…

…ib tests
  • Loading branch information...
commit c215564c6ee086a787c09b818c8c43157a2b344c 1 parent d8ff07a
@PeterWAWood PeterWAWood authored
Showing with 182 additions and 660 deletions.
  1. +3 −55 red-system/tests/run-all.r
  2. +24 −0 red-system/tests/source/units/lib-osx-test.reds
  3. +0 −96 red-system/tests/source/units/lib-test-source.reds
  4. +121 −0 red-system/tests/source/units/lib-test.reds
  5. +34 −0 red-system/tests/source/units/lib-win32-test.reds
  6. BIN  red-system/tests/source/units/libs/f32testlib1.dll
  7. +0 −45 red-system/tests/source/units/libs/f32testlib1.pas
  8. BIN  red-system/tests/source/units/libs/f32testlib2.dll
  9. +0 −38 red-system/tests/source/units/libs/f32testlib2.pas
  10. BIN  red-system/tests/source/units/libs/f32testlib3.dll
  11. +0 −38 red-system/tests/source/units/libs/f32testlib3.pas
  12. BIN  red-system/tests/source/units/libs/ftestlib1.dll
  13. +0 −45 red-system/tests/source/units/libs/ftestlib1.pas
  14. BIN  red-system/tests/source/units/libs/ftestlib2.dll
  15. +0 −38 red-system/tests/source/units/libs/ftestlib2.pas
  16. BIN  red-system/tests/source/units/libs/ftestlib3.dll
  17. +0 −38 red-system/tests/source/units/libs/ftestlib3.pas
  18. BIN  red-system/tests/source/units/libs/libf32testlib1.dylib
  19. BIN  red-system/tests/source/units/libs/libf32testlib1.so
  20. BIN  red-system/tests/source/units/libs/libf32testlib2.dylib
  21. BIN  red-system/tests/source/units/libs/libf32testlib2.so
  22. BIN  red-system/tests/source/units/libs/libf32testlib3.dylib
  23. BIN  red-system/tests/source/units/libs/libf32testlib3.so
  24. BIN  red-system/tests/source/units/libs/libftestlib1.dylib
  25. BIN  red-system/tests/source/units/libs/libftestlib1.so
  26. BIN  red-system/tests/source/units/libs/libftestlib2.dylib
  27. BIN  red-system/tests/source/units/libs/libftestlib2.so
  28. BIN  red-system/tests/source/units/libs/libftestlib3.dylib
  29. BIN  red-system/tests/source/units/libs/libftestlib3.so
  30. BIN  red-system/tests/source/units/libs/libtestlib1.dylib
  31. BIN  red-system/tests/source/units/libs/libtestlib1.so
  32. BIN  red-system/tests/source/units/libs/libtestlib2.dylib
  33. BIN  red-system/tests/source/units/libs/libtestlib2.so
  34. BIN  red-system/tests/source/units/libs/libtestlib3.dylib
  35. BIN  red-system/tests/source/units/libs/libtestlib3.so
  36. BIN  red-system/tests/source/units/libs/libtestlib4.dylib
  37. BIN  red-system/tests/source/units/libs/libtestlib4.so
  38. BIN  red-system/tests/source/units/libs/testlib1.dll
  39. +0 −45 red-system/tests/source/units/libs/testlib1.pas
  40. BIN  red-system/tests/source/units/libs/testlib2.dll
  41. +0 −38 red-system/tests/source/units/libs/testlib2.pas
  42. BIN  red-system/tests/source/units/libs/testlib3.dll
  43. +0 −38 red-system/tests/source/units/libs/testlib3.pas
  44. BIN  red-system/tests/source/units/libs/testlib4.dll
  45. +0 −44 red-system/tests/source/units/libs/testlib4.pas
  46. +0 −51 red-system/tests/source/units/make-float-lib-auto-test.r
  47. +0 −51 red-system/tests/source/units/make-lib-auto-test.r
View
58 red-system/tests/run-all.r
@@ -2,7 +2,7 @@ REBOL [
Title: "Builds and Runs the Red/System Tests"
File: %run-all.r
Author: "Peter W A Wood"
- Version: 0.8.0
+ Version: 0.8.1
License: "BSD-3 - https://github.com/dockimbel/Red/blob/master/BSD-3-License.txt"
]
@@ -64,55 +64,6 @@ make-if-needed? %source/units/auto-tests/float-auto-test.reds
make-if-needed? %source/units/auto-tests/float32-auto-test.reds
%source/units/make-float32-auto-test.r
-;; make lib-test files if needed
-lib-test-len: length? read %source/units/lib-test-source.reds
-save-len: either exists? %source/units/len-lib-test.dat [
- load %source/units/len-lib-test.dat
-][
- -1
-]
-
-if any [
- not exists? %source/units/auto-tests/lib-auto-test.reds
- lib-test-len <> save-len
-][
- save %source/units/len-lib-test.dat lib-test-len
- print "Making lib-test-auto.reds - shouldn't take long"
- do %source/units/make-lib-auto-test.r
-]
-
-flib-test-len: length? read %source/units/float-lib-test-source.reds
-save-len: either exists? %source/units/len-flib-test.dat [
- load %source/units/len-flib-test.dat
-][
- -1
-]
-
-f32lib-test-len: length? read %source/units/float32-lib-test-source.reds
-f32-save-len: either exists? %source/units/len-f32lib-test.dat [
- load %source/units/len-f32lib-test.dat
-][
- -1
-]
-
-if any [
- not exists? %source/units/auto-tests/float-lib-auto-test.reds
- flib-test-len <> save-len
-][
- save %source/units/len-flib-test.dat flib-test-len
- print "Making float-lib-test-auto.reds - shouldn't take long"
- do %source/units/make-float-lib-auto-test.r
-]
-
-if any [
- not exists? %source/units/auto-tests/float32-lib-auto-test.reds
- f32lib-test-len <> f32-save-len
-][
- save %source/units/len-f32lib-test.dat f32lib-test-len
- print "Making float32-lib-test-auto.reds - shouldn't take long"
- do %source/units/make-float32-lib-auto-test.r
-]
-
;; run the tests
print rejoin ["Run-All v" system/script/header/version]
print rejoin ["Quick-Test v" qt/version]
@@ -126,8 +77,7 @@ start-time: now/precise
***start-run-quiet*** "Red/System Test Suite"
===start-group=== "Datatype tests"
- --run-test-file-quiet %source/units/logic-test.reds
- ; --run-test-file-quiet %source/units/integer-test.reds ;; excluded from ARM tests
+ --run-test-file-quiet %source/units/logic-test.reds
--run-test-file-quiet %source/units/byte-test.reds
--run-test-file-quiet %source/units/c-string-test.reds
--run-test-file-quiet %source/units/struct-test.reds
@@ -139,6 +89,7 @@ start-time: now/precise
--run-test-file-quiet %source/units/enum-test.reds
--run-test-file-quiet %source/units/float-test.reds
--run-test-file-quiet %source/units/float32-test.reds
+ --run-test-file-quiet %source/units/lib-test.reds
===end-group===
===start-group=== "Native functions tests"
@@ -171,9 +122,6 @@ start-time: now/precise
--run-test-file-quiet %source/units/auto-tests/byte-auto-test.reds
--run-test-file-quiet %source/units/auto-tests/integer-auto-test.reds
--run-test-file-quiet %source/units/auto-tests/maths-auto-test.reds
- --run-test-file-quiet %source/units/auto-tests/lib-auto-test.reds ;; excluded from ARM tests
- --run-test-file-quiet %source/units/auto-tests/float-lib-auto-test.reds ; not in Arm tests
- --run-test-file-quiet %source/units/auto-tests/float32-lib-auto-test.reds ; not in Arm tests
--run-test-file-quiet %source/units/auto-tests/float-auto-test.reds
--run-test-file-quiet %source/units/auto-tests/float32-auto-test.reds
===end-group===
View
24 red-system/tests/source/units/lib-osx-test.reds
@@ -0,0 +1,24 @@
+Red/System [
+ Title: "Red/System lib osx test script"
+ Author: "Peter W A Wood"
+ File: %lib-test-source.reds
+ Rights: "Copyright (C) 2012 Peter W A Wood. All rights reserved."
+ License: "BSD-3 - https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt"
+]
+
+;; library declarations
+
+#import [
+ "/usr/lib/libsqlite3.dylib" cdecl [
+ sqlite3_libversion_number: "sqlite3_libversion_number" [
+ return: [integer!]
+ ]
+ ]
+]
+
+===start-group=== "OS X Core Foundation"
+
+ --test-- "libosx1"
+ --assert 0 < sqlite3_libversion_number
+
+===end-group===
View
96 red-system/tests/source/units/lib-test-source.reds
@@ -1,96 +0,0 @@
-Red/System [
- Title: "Red/System lib test script"
- Author: "Peter W A Wood"
- File: %lib-test-source.reds
- 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"
-]
-
-;; This script needs to be processed by make-lib-auto-test.r which sets the
-;; absolute path for the test libraries. It creates a file called
-;; lib-auto-test.reds in the auto-tests sub-directory. It also generates the
-;; correct name for the library under the os it is running
-
-#include %../../../../../quick-test/quick-test.reds
-
-;; library declarations
-#import [
- "***abs-path***###prefix###testlib1@@@extension@@@" cdecl [
- addone: "addone" [
- i [integer!]
- return: [integer!]
- ]
- subtractone: "subtractone" [
- i [integer!]
- return: [integer!]
- ]
- ]
-]
-
-#import [
- "***abs-path***###prefix###testlib2@@@extension@@@" cdecl [
- twice: "twice" [
- i [integer!]
- return: [integer!]
- ]
- ]
-]
-
-#import [
- "***abs-path***###prefix###testlib3@@@extension@@@" cdecl [
- halve: "halve" [
- i [integer!]
- return: [integer!]
- ]
- ]
-]
-
-#import [
- "***abs-path***###prefix###testlib4@@@extension@@@" cdecl [
- passitback: "passitback" [
- i [integer!]
- p-i-b [function! [
- i [integer!]
- return: [integer!]
- ]]
- return: [integer!]
- ]
- ]
-]
-
-
-~~~start-file~~~ "library"
-
-===start-group=== "calls"
- --test-- "lib1"
- --assert 2 = addone 1
- --assert 1 = subtractone 2
-
- --test-- "lib2"
- --assert 2 = twice 1
- --assert 4 = twice 2
-
- --test-- "lib3"
- --assert 1 = halve 2
- --assert 0 = halve 1
-===end-group===
-
-===start-group=== "callbacks"
- p-i-b: func [
- [cdecl]
- i [integer!]
- return: [integer!]
- ][
- i * 2
- ]
- --test-- "callback 1"
- --assert 2 = passitback 1 :p-i-b
- --test-- "callback 2"
- --assert 256 = passitback 128 :p-i-b
- --test-- "callback 3"
- --assert -2 = passitback -1 :p-i-b
-
-===end-group===
-
-~~~end-file~~~
-
View
121 red-system/tests/source/units/lib-test.reds
@@ -0,0 +1,121 @@
+Red/System [
+ Title: "Red/System lib test script"
+ Author: "Peter W A Wood"
+ File: %lib-test-source.reds
+ Rights: "Copyright (C) 2012 Peter W A Wood. All rights reserved."
+ License: "BSD-3 - https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt"
+]
+
+#include %../../../../quick-test/quick-test.reds
+
+;; library declarations
+#import [
+ LIBM-file cdecl [
+ abs-float: "fabs" [
+ f [float!]
+ return: [float!]
+ ]
+ abs-int: "abs" [
+ i [integer!]
+ return: [integer!]
+ ]
+ ]
+]
+
+lt-array!: alias struct! [
+ a [integer!]
+ b [integer!]
+ c [integer!]
+ d [integer!]
+]
+
+lt-int!: alias struct! [
+ i [integer!]
+ ]
+#import [
+ LIBC-file cdecl [
+ memcpy: "memcpy" [
+ to [c-string!]
+ from [c-string!]
+ len [integer!]
+ ]
+ qsort: "qsort" [
+ array [lt-array!]
+ count [integer!]
+ size [integer!]
+ compare [function! [
+ first [lt-int!]
+ second [lt-int!]
+ return: [integer!]
+ ]]
+ ]
+ strnlen: "strnlen" [
+ str [c-string!]
+ maxlen [integer!]
+ return: [integer!]
+ ]
+ ]
+]
+
+~~~start-file~~~ "library"
+
+===start-group=== "calls"
+ --test-- "lib1"
+ --assert 2 = abs-int 2
+
+ --test-- "lib2"
+ --assert 2.0 = abs-float -2.0
+
+ --test-- "lib3"
+ s: "hello, world"
+ --assert 12 = strnlen s 32
+ --assert 5 = strnlen s 5
+
+ --test-- "lib4"
+ new: "123456789012"
+ old: "HW"
+ memcpy new old 12
+ --assert new/1 = #"H"
+ --assert new/2 = #"W"
+ --assert 2 = length? new
+ --assert old/1 = #"H"
+ --assert old/2 = #"W"
+ --assert 2 = length? old
+
+===end-group===
+
+===start-group=== "callbacks"
+
+ --test-- "libcallback1"
+ lib-array: declare lt-array!
+ lib-array/a: 4
+ lib-array/b: 3
+ lib-array/c: 2
+ lib-array/d: 1
+ lib-compare: func [
+ [cdecl]
+ first [lt-int!]
+ second [lt-int!]
+ return: [integer!]
+ ][
+ first/i - second/i
+ ]
+ qsort lib-array 4 4 :lib-compare
+ --assert 1 = lib-array/a
+ --assert 2 = lib-array/b
+ --assert 3 = lib-array/c
+ --assert 4 = lib-array/d
+
+===end-group===
+
+#switch OS [
+ Windows [
+ #include %lib-win32-test.reds
+ ]
+ MacOSX [
+ #include %lib-osx-test.reds
+ ]
+]
+
+~~~end-file~~~
+
View
34 red-system/tests/source/units/lib-win32-test.reds
@@ -0,0 +1,34 @@
+Red/System [
+ Title: "Red/System lib win32 test script"
+ Author: "Peter W A Wood"
+ File: %lib-test-source.reds
+ Rights: "Copyright (C) 2012 Peter W A Wood. All rights reserved."
+ License: "BSD-3 - https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt"
+]
+
+lib-win-int-ptr!: alias struct! [
+ int [integer!]
+]
+
+;; library declarations
+
+#import [
+ "Kernel32.dll" stdcall [
+ get-computer-name: "GetComputerNameA" [
+ name [c-string!]
+ len [lib-win-int-ptr!]
+ return: [logic!]
+ ]
+ ]
+]
+
+===start-group=== "Win32"
+
+ --test-- "libWin32-1"
+ lw1-name: "****************"
+ lw1-len: declare lib-win-int-ptr!
+ lw1-len/int: 15
+ --assert get-computer-name lw1-name lw1-len
+ --assert lw1-name/1 <> #"*"
+
+===end-group===
View
BIN  red-system/tests/source/units/libs/f32testlib1.dll
Binary file not shown
View
45 red-system/tests/source/units/libs/f32testlib1.pas
@@ -1,45 +0,0 @@
-// f32testlib1 Adds or subtracts one to/from an integer
-//
-// Purpose: Testing library calls with float32 args in Red/System
-//
-// Author: Peter W A Wood
-//
-// Date: 21-Jan-2012
-//
-// Version: 0.0.1
-//
-// Rights: Copyright (C) 2012 Peter W A Wood.
-// All rights reserved.
-//
-// License: BSD-3
-// https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt
-//
-// Notes: Under Mac Xcode < 4.0 the library must be compiled with the
-// following option:
-// -k-no_order_inits
-// (This is due to a bug in the Xcode 3 linker
-
-library one;
-
-function addone(f: single):single;cdecl;
-begin
- addone := f + 1.0;
-end;
-
-function subtractone(f: single):single;cdecl;
-begin
- subtractone := f - 1.0;
-end;
-
-{$ifndef Darwin}
-exports
- addone name 'addone',
- subtractone name 'subtractone';
-{$else}
-exports
- addone name '_addone',
- subtractone name '_subtractone';
-{$endif}
-
-begin
-end.
View
BIN  red-system/tests/source/units/libs/f32testlib2.dll
Binary file not shown
View
38 red-system/tests/source/units/libs/f32testlib2.pas
@@ -1,38 +0,0 @@
-// f32testlib2 Multiplies a float by two
-//
-// Purpose: Testing library calls in Red/System
-//
-// Author: Peter W A Wood
-//
-// Date: 21-Jan-2012
-//
-// Version: 0.0.1
-//
-// Rights: Copyright (C) 2012 Peter W A Wood.
-// All rights reserved.
-//
-// License: BSD-3
-// https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt
-//
-// Notes: Under Mac Xcode < 4.0 the library must be compiled with the
-// following option:
-// -k-no_order_inits
-// (This is due to a bug in the Xcode 3 linker
-
-library two;
-
-function twice(f: single):single;cdecl;
-begin
- twice := f * 2.0;
-end;
-
-{$ifndef Darwin}
-exports
- twice name 'twice';
-{$else}
-exports
- twice name '_twice';
-{$endif}
-
-begin
-end.
View
BIN  red-system/tests/source/units/libs/f32testlib3.dll
Binary file not shown
View
38 red-system/tests/source/units/libs/f32testlib3.pas
@@ -1,38 +0,0 @@
-// f32testlib3 Divides a float32 by two
-//
-// Purpose: Testing library calls in Red/System
-//
-// Author: Peter W A Wood
-//
-// Date: 21-Jan-2012
-//
-// Version: 0.0.1
-//
-// Rights: Copyright (C) 2012 Peter W A Wood.
-// All rights reserved.
-//
-// License: BSD-3
-// https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt
-//
-// Notes: Under Mac Xcode < 4.0 the library must be compiled with the
-// following option:
-// -k-no_order_inits
-// (This is due to a bug in the Xcode 3 linker
-
-library three;
-
-function halve(f: single):single;cdecl;
-begin
- halve := f / 2.0;
-end;
-
-{$ifndef Darwin}
-exports
- halve name 'halve';
-{$else}
-exports
- halve name '_halve';
-{$endif}
-
-begin
-end.
View
BIN  red-system/tests/source/units/libs/ftestlib1.dll
Binary file not shown
View
45 red-system/tests/source/units/libs/ftestlib1.pas
@@ -1,45 +0,0 @@
-// ftestlib1 Adds or subtracts one to/from an integer
-//
-// Purpose: Testing library calls with float args in Red/System
-//
-// Author: Peter W A Wood
-//
-// Date: 9-Jan-2012
-//
-// Version: 0.0.1
-//
-// Rights: Copyright (C) 2012 Peter W A Wood.
-// All rights reserved.
-//
-// License: BSD-3
-// https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt
-//
-// Notes: Under Mac Xcode < 4.0 the library must be compiled with the
-// following option:
-// -k-no_order_inits
-// (This is due to a bug in the Xcode 3 linker
-
-library one;
-
-function addone(f: double):double;cdecl;
-begin
- addone := f + 1.0;
-end;
-
-function subtractone(f: double):double;cdecl;
-begin
- subtractone := f - 1.0;
-end;
-
-{$ifndef Darwin}
-exports
- addone name 'addone',
- subtractone name 'subtractone';
-{$else}
-exports
- addone name '_addone',
- subtractone name '_subtractone';
-{$endif}
-
-begin
-end.
View
BIN  red-system/tests/source/units/libs/ftestlib2.dll
Binary file not shown
View
38 red-system/tests/source/units/libs/ftestlib2.pas
@@ -1,38 +0,0 @@
-// ftestlib2 Multiplies a float by two
-//
-// Purpose: Testing library calls in Red/System
-//
-// Author: Peter W A Wood
-//
-// Date: 9-Jan-2012
-//
-// Version: 0.0.1
-//
-// Rights: Copyright (C) 2012 Peter W A Wood.
-// All rights reserved.
-//
-// License: BSD-3
-// https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt
-//
-// Notes: Under Mac Xcode < 4.0 the library must be compiled with the
-// following option:
-// -k-no_order_inits
-// (This is due to a bug in the Xcode 3 linker
-
-library two;
-
-function twice(f: double):double;cdecl;
-begin
- twice := f * 2.0;
-end;
-
-{$ifndef Darwin}
-exports
- twice name 'twice';
-{$else}
-exports
- twice name '_twice';
-{$endif}
-
-begin
-end.
View
BIN  red-system/tests/source/units/libs/ftestlib3.dll
Binary file not shown
View
38 red-system/tests/source/units/libs/ftestlib3.pas
@@ -1,38 +0,0 @@
-// ftestlib3 Divides a float by two
-//
-// Purpose: Testing library calls in Red/System
-//
-// Author: Peter W A Wood
-//
-// Date: 9-Jan-2012
-//
-// Version: 0.0.1
-//
-// Rights: Copyright (C) 2012 Peter W A Wood.
-// All rights reserved.
-//
-// License: BSD-3
-// https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt
-//
-// Notes: Under Mac Xcode < 4.0 the library must be compiled with the
-// following option:
-// -k-no_order_inits
-// (This is due to a bug in the Xcode 3 linker
-
-library three;
-
-function halve(f: double):double;cdecl;
-begin
- halve := f / 2.0;
-end;
-
-{$ifndef Darwin}
-exports
- halve name 'halve';
-{$else}
-exports
- halve name '_halve';
-{$endif}
-
-begin
-end.
View
BIN  red-system/tests/source/units/libs/libf32testlib1.dylib
Binary file not shown
View
BIN  red-system/tests/source/units/libs/libf32testlib1.so
Binary file not shown
View
BIN  red-system/tests/source/units/libs/libf32testlib2.dylib
Binary file not shown
View
BIN  red-system/tests/source/units/libs/libf32testlib2.so
Binary file not shown
View
BIN  red-system/tests/source/units/libs/libf32testlib3.dylib
Binary file not shown
View
BIN  red-system/tests/source/units/libs/libf32testlib3.so
Binary file not shown
View
BIN  red-system/tests/source/units/libs/libftestlib1.dylib
Binary file not shown
View
BIN  red-system/tests/source/units/libs/libftestlib1.so
Binary file not shown
View
BIN  red-system/tests/source/units/libs/libftestlib2.dylib
Binary file not shown
View
BIN  red-system/tests/source/units/libs/libftestlib2.so
Binary file not shown
View
BIN  red-system/tests/source/units/libs/libftestlib3.dylib
Binary file not shown
View
BIN  red-system/tests/source/units/libs/libftestlib3.so
Binary file not shown
View
BIN  red-system/tests/source/units/libs/libtestlib1.dylib
Binary file not shown
View
BIN  red-system/tests/source/units/libs/libtestlib1.so
Binary file not shown
View
BIN  red-system/tests/source/units/libs/libtestlib2.dylib
Binary file not shown
View
BIN  red-system/tests/source/units/libs/libtestlib2.so
Binary file not shown
View
BIN  red-system/tests/source/units/libs/libtestlib3.dylib
Binary file not shown
View
BIN  red-system/tests/source/units/libs/libtestlib3.so
Binary file not shown
View
BIN  red-system/tests/source/units/libs/libtestlib4.dylib
Binary file not shown
View
BIN  red-system/tests/source/units/libs/libtestlib4.so
Binary file not shown
View
BIN  red-system/tests/source/units/libs/testlib1.dll
Binary file not shown
View
45 red-system/tests/source/units/libs/testlib1.pas
@@ -1,45 +0,0 @@
-// testlib1 Adds or subtracts one to/from an integer
-//
-// Purpose: Testing library calls in Red/System
-//
-// Author: Peter W A Wood
-//
-// Date: 27-Jun-2011
-//
-// Version: 0.0.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
-//
-// Notes: Under Mac Xcode < 4.0 the library must be compiled with the
-// following option:
-// -k-no_order_inits
-// (This is due to a bug in the Xcode 3 linker
-
-library one;
-
-function addone(i: integer):integer;cdecl;
-begin
- addone := i + 1;
-end;
-
-function subtractone(i: integer):integer;cdecl;
-begin
- subtractone := i - 1;
-end;
-
-{$ifndef Darwin}
-exports
- addone name 'addone',
- subtractone name 'subtractone';
-{$else}
-exports
- addone name '_addone',
- subtractone name '_subtractone';
-{$endif}
-
-begin
-end.
View
BIN  red-system/tests/source/units/libs/testlib2.dll
Binary file not shown
View
38 red-system/tests/source/units/libs/testlib2.pas
@@ -1,38 +0,0 @@
-// testlib2 Multiplies an integer by two
-//
-// Purpose: Testing library calls in Red/System
-//
-// Author: Peter W A Wood
-//
-// Date: 10-Aug-2011
-//
-// Version: 0.0.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
-//
-// Notes: Under Mac Xcode < 4.0 the library must be compiled with the
-// following option:
-// -k-no_order_inits
-// (This is due to a bug in the Xcode 3 linker
-
-library two;
-
-function twice(i: integer):integer;cdecl;
-begin
- twice := i * 2;
-end;
-
-{$ifndef Darwin}
-exports
- twice name 'twice';
-{$else}
-exports
- twice name '_twice';
-{$endif}
-
-begin
-end.
View
BIN  red-system/tests/source/units/libs/testlib3.dll
Binary file not shown
View
38 red-system/tests/source/units/libs/testlib3.pas
@@ -1,38 +0,0 @@
-// testlib3 Divides an integer by two
-//
-// Purpose: Testing library calls in Red/System
-//
-// Author: Peter W A Wood
-//
-// Date: 10-Aug-2011
-//
-// Version: 0.0.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
-//
-// Notes: Under Mac Xcode < 4.0 the library must be compiled with the
-// following option:
-// -k-no_order_inits
-// (This is due to a bug in the Xcode 3 linker
-
-library three;
-
-function halve(i: integer):integer;cdecl;
-begin
- halve := i div 2;
-end;
-
-{$ifndef Darwin}
-exports
- halve name 'halve';
-{$else}
-exports
- halve name '_halve';
-{$endif}
-
-begin
-end.
View
BIN  red-system/tests/source/units/libs/testlib4.dll
Binary file not shown
View
44 red-system/tests/source/units/libs/testlib4.pas
@@ -1,44 +0,0 @@
-// testlib3 Passes an integer from Red/System to a lib and back to itself
-// via a callback
-//
-// Purpose: Testing library calls in Red/System
-//
-// Author: Peter W A Wood
-//
-// Date: 3-Feb-2011
-//
-// Version: 0.0.1
-//
-// Rights: Copyright (C) 2012 Peter W A Wood.
-// All rights reserved.
-//
-// License: BSD-3
-// https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt
-//
-// Notes: Under Mac Xcode < 4.0 the library must be compiled with the
-// following option:
-// -k-no_order_inits
-// (This is due to a bug in the Xcode 3 linker
-
-library four;
-{$mode objfpc}
-uses Classes;
-
-type
- TCallBack = function(i: integer): integer;cdecl;
-
-function passitback(i: integer; f: TCallBack):integer;cdecl;
-begin
- passitback := f(i);
-end;
-
-{$ifndef Darwin}
-exports
- passitback name 'passitback';
-{$else}
-exports
- passitback name '_passitback';
-{$endif}
-
-begin
-end.
View
51 red-system/tests/source/units/make-float-lib-auto-test.r
@@ -1,51 +0,0 @@
-REBOL [
- Title: "Generates Red/System lib tests (float version)"
- Author: "Peter W A Wood"
- File: %make-float-lib-auto-test.r
- Version: 0.2.0
- Rights: "Copyright (C) 2012 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/float-lib-auto-test.reds
-file-in: %float-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
-
-
-
-
-
-
-
-
-
View
51 red-system/tests/source/units/make-lib-auto-test.r
@@ -1,51 +0,0 @@
-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
-
-
-
-
-
-
-
-
-

0 comments on commit c215564

Please sign in to comment.
Something went wrong with that request. Please try again.