Skip to content

Commit

Permalink
Add tests for import defines
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrinberg committed Apr 6, 2018
1 parent 85188cb commit 9a51af0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(jbuild_version 1)

(executable
((name run)
(libraries (jbuilder.configurator))))
15 changes: 15 additions & 0 deletions test/blackbox-tests/test-cases/configurator/import-define/run.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
let () =
let module C_define = Configurator.C_define in
Configurator.main ~name:"c_test" (fun t ->
assert (
C_define.import t
~includes:["caml/config.h"]
[ "CAML_CONFIG_H", C_define.Type.Switch
; "Page_log", C_define.Type.Int
] =
[ "CAML_CONFIG_H", C_define.Value.Switch true
; "Page_log", Int 12
]
);
print_endline "Successfully import #define's"
)
3 changes: 3 additions & 0 deletions test/blackbox-tests/test-cases/configurator/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ We're able to compile C program sucessfully
$ jbuilder exec c_test/run.exe
Successfully compiled c program

Importing #define's from code is successful
$ jbuilder exec import-define/run.exe
Successfully import #define's

0 comments on commit 9a51af0

Please sign in to comment.