Skip to content

Commit

Permalink
Add new test, ocaml give a strange error
Browse files Browse the repository at this point in the history
  • Loading branch information
bobot committed Sep 9, 2017
1 parent 1c136c4 commit f397109
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
9 changes: 7 additions & 2 deletions test/jbuild
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,10 @@
(deps ((files_recursively_in workspaces/output_obj)))
(action
(chdir workspaces/output_obj
(run ${exe:run.exe} --
${bin:jbuilder} build -j1 --root . @all )))))
(progn
(run ${exe:run.exe} -log log1 -- ${bin:jbuilder} build -j1 --root . --only stub )
(run ${exe:run.exe} -log log_native2 -- ${bin:jbuilder} exec -j1 --root . stub_native true )
(run ${exe:run.exe} -log log_native3 -inverse -- ${bin:jbuilder} exec -j1 --root . stub_native fail )
(run ${exe:run.exe} -log log_byte2 -- ${bin:jbuilder} exec -j1 --root . stub_byte true )
(run ${exe:run.exe} -log log_byte3 -inverse -- ${bin:jbuilder} exec -j1 --root . stub_byte fail )
)))))
18 changes: 15 additions & 3 deletions test/workspaces/output_obj/jbuild
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@
))

(rule (
(targets (stub))
(deps (stub.c test.exe.o test.so))
(action (run cc -o stub -I ${ocaml_where} -I . -ltest stub.c))
(targets (stub_native))
(deps (stub.c test.exe.o))
(action (run cc -o stub -I ${ocaml_where} -I . test.exe.o -lm -ldl stub.c))
))

(rule (
(targets (stub_byte))
(deps (stub.c test.bc.o))
(action (run cc -o stub -I ${ocaml_where} -I . test.bc.o -lm -ldl stub.c))
))

(install (
(section bin)
(files (stub_native stub_byte))
(package stub)
))
2 changes: 1 addition & 1 deletion test/workspaces/output_obj/stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <caml/callback.h>
#include <caml/memory.h>

int main(char ** argv){
int main(int argc, char ** argv){

caml_startup(argv);
return 0;
Expand Down
Empty file.
4 changes: 3 additions & 1 deletion test/workspaces/output_obj/test.ml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
let () = print_string "Test!!"
let () = Printf.printf "Test!!\n%!"

let () = if Sys.argv.(1) = "fail" then assert false

0 comments on commit f397109

Please sign in to comment.