summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testsuite/tests/callback/Makefile27
-rw-r--r--testsuite/tests/callback/callbackprim.c (renamed from test/Moretest/callbackprim.c)0
-rw-r--r--testsuite/tests/callback/reference8
-rw-r--r--testsuite/tests/callback/tcallback.ml (renamed from test/Moretest/tcallback.ml)0
4 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/tests/callback/Makefile b/testsuite/tests/callback/Makefile
new file mode 100644
index 000000000..bbbe08e51
--- /dev/null
+++ b/testsuite/tests/callback/Makefile
@@ -0,0 +1,27 @@
+CC=$(NATIVECC) -I $(TOPDIR)/byterun
+
+default: run-byte run-opt
+
+common:
+ @$(CC) -c callbackprim.c
+
+run-byte: common
+ @echo -n " ... testing 'bytecode':"
+ @$(OCAMLC) -c tcallback.ml
+ @$(OCAMLC) -o ./program -custom unix.cma callbackprim.$(O) tcallback.cmo
+ @./program > bytecode.result
+ @diff -q reference bytecode.result || (echo " => failed" && exit 1)
+ @echo " => passed"
+
+run-opt: common
+ @echo -n " ... testing 'native':"
+ @$(OCAMLOPT) -c tcallback.ml
+ @$(OCAMLOPT) -o ./program unix.cmxa callbackprim.$(O) tcallback.cmx
+ @./program > native.result
+ @diff -q reference native.result || (echo " => failed" && exit 1)
+ @echo " => passed"
+
+clean: defaultclean
+ @rm -f *.result ./program
+
+include ../../makefiles/Makefile.common
diff --git a/test/Moretest/callbackprim.c b/testsuite/tests/callback/callbackprim.c
index f1a4ccfa1..f1a4ccfa1 100644
--- a/test/Moretest/callbackprim.c
+++ b/testsuite/tests/callback/callbackprim.c
diff --git a/testsuite/tests/callback/reference b/testsuite/tests/callback/reference
new file mode 100644
index 000000000..b35993aa2
--- /dev/null
+++ b/testsuite/tests/callback/reference
@@ -0,0 +1,8 @@
+7
+7
+7
+7
+7
+aaaaa
+aaaaa
+bbbbb
diff --git a/test/Moretest/tcallback.ml b/testsuite/tests/callback/tcallback.ml
index 32914119b..32914119b 100644
--- a/test/Moretest/tcallback.ml
+++ b/testsuite/tests/callback/tcallback.ml