Add tests for import defines
This commit is contained in:
parent
fb8d400165
commit
148835967e
|
@ -0,0 +1,5 @@
|
|||
(jbuild_version 1)
|
||||
|
||||
(executable
|
||||
((name run)
|
||||
(libraries (jbuilder.configurator))))
|
|
@ -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"
|
||||
)
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue