[MLton-commit] r6910
Wesley Terpstra
wesley at mlton.org
Sat Oct 4 07:44:20 PDT 2008
Test also clean library termination.
Check output against check.ok.
----------------------------------------------------------------------
A mlton/trunk/regression/library/check.ok
U mlton/trunk/regression/library/check.sml
U mlton/trunk/regression/library/libm1.sml
U mlton/trunk/regression/library/libm2.sml
U mlton/trunk/regression/library/libm3.sml
U mlton/trunk/regression/library/libm4.sml
U mlton/trunk/regression/library/libm5.sml
U mlton/trunk/regression/library/library-test
----------------------------------------------------------------------
Added: mlton/trunk/regression/library/check.ok
===================================================================
--- mlton/trunk/regression/library/check.ok 2008-10-04 13:04:03 UTC (rev 6909)
+++ mlton/trunk/regression/library/check.ok 2008-10-04 14:44:17 UTC (rev 6910)
@@ -0,0 +1,18 @@
+check starting up
+libm5 starting up
+libm4 starting up
+libm3 starting up
+libm2 starting up
+libm1 starting up
+m1 pointer test complete.
+m2 pointer test complete.
+m3 pointer test complete.
+m4 pointer test complete.
+m5 pointer test complete.
+check pointer test complete.
+libm1 exits
+libm2 exits
+libm3 exits
+libm4 exits
+libm5 exits
+check exits
Modified: mlton/trunk/regression/library/check.sml
===================================================================
--- mlton/trunk/regression/library/check.sml 2008-10-04 13:04:03 UTC (rev 6909)
+++ mlton/trunk/regression/library/check.sml 2008-10-04 14:44:17 UTC (rev 6910)
@@ -1,3 +1,8 @@
+val () = print "check starting up\n"
+val () = OS.Process.atExit
+ (fn () => (_import "m5_close" public : unit -> unit; ()
+ ; print "check exits\n"))
+
(* Prepare lib5 *)
val () = _import "m5_open" public : int * string vector -> unit;
(1, Vector.fromList ["libm5"])
Modified: mlton/trunk/regression/library/libm1.sml
===================================================================
--- mlton/trunk/regression/library/libm1.sml 2008-10-04 13:04:03 UTC (rev 6909)
+++ mlton/trunk/regression/library/libm1.sml 2008-10-04 14:44:17 UTC (rev 6910)
@@ -1,3 +1,6 @@
+val () = print "libm1 starting up\n"
+val () = OS.Process.atExit (fn () => print "libm1 exits\n")
+
type p = MLton.Pointer.t
type 'a s = (unit -> 'a) * ('a -> unit)
Modified: mlton/trunk/regression/library/libm2.sml
===================================================================
--- mlton/trunk/regression/library/libm2.sml 2008-10-04 13:04:03 UTC (rev 6909)
+++ mlton/trunk/regression/library/libm2.sml 2008-10-04 14:44:17 UTC (rev 6910)
@@ -1,3 +1,8 @@
+val () = print "libm2 starting up\n"
+val () = OS.Process.atExit
+ (fn () => (_import "m1_close" public : unit -> unit; ()
+ ; print "libm2 exits\n"))
+
(* Prepare libm1 *)
val () = _import "m1_open" public : int * string vector -> unit;
(1, Vector.fromList ["libm1"])
Modified: mlton/trunk/regression/library/libm3.sml
===================================================================
--- mlton/trunk/regression/library/libm3.sml 2008-10-04 13:04:03 UTC (rev 6909)
+++ mlton/trunk/regression/library/libm3.sml 2008-10-04 14:44:17 UTC (rev 6910)
@@ -1,3 +1,8 @@
+val () = print "libm3 starting up\n"
+val () = OS.Process.atExit
+ (fn () => (_import "m2_close" public : unit -> unit; ()
+ ; print "libm3 exits\n"))
+
(* Prepare libm2 *)
val () = _import "m2_open" external : int * string vector -> unit;
(1, Vector.fromList ["libm2"])
Modified: mlton/trunk/regression/library/libm4.sml
===================================================================
--- mlton/trunk/regression/library/libm4.sml 2008-10-04 13:04:03 UTC (rev 6909)
+++ mlton/trunk/regression/library/libm4.sml 2008-10-04 14:44:17 UTC (rev 6910)
@@ -1,3 +1,8 @@
+val () = print "libm4 starting up\n"
+val () = OS.Process.atExit
+ (fn () => (_import "m3_close" public : unit -> unit; ()
+ ; print "libm4 exits\n"))
+
(* Prepare libm3 *)
val () = _import "m3_open" public : int * string vector -> unit;
(1, Vector.fromList ["libm3"])
Modified: mlton/trunk/regression/library/libm5.sml
===================================================================
--- mlton/trunk/regression/library/libm5.sml 2008-10-04 13:04:03 UTC (rev 6909)
+++ mlton/trunk/regression/library/libm5.sml 2008-10-04 14:44:17 UTC (rev 6910)
@@ -1,3 +1,8 @@
+val () = print "libm5 starting up\n"
+val () = OS.Process.atExit
+ (fn () => (_import "m4_close" public : unit -> unit; ()
+ ; print "libm5 exits\n"))
+
(* Prepare libm4 *)
val () = _import "m4_open" external : int * string vector -> unit;
(1, Vector.fromList ["libm4"])
Modified: mlton/trunk/regression/library/library-test
===================================================================
--- mlton/trunk/regression/library/library-test 2008-10-04 13:04:03 UTC (rev 6909)
+++ mlton/trunk/regression/library/library-test 2008-10-04 14:44:17 UTC (rev 6910)
@@ -28,4 +28,10 @@
-default-ann 'allowFFI true' -export-header check.h check.sml check.c
# Check that symbols resolved correctly
-./check
+./check > check.log
+
+# Confirm expected output
+set +x
+diff -u check.ok check.log
+echo '********** PASS:' "$@" '**********'
+rm -f check.log
More information about the MLton-commit
mailing list