Test compiling C program

This commit is contained in:
Rudi Grinberg 2018-04-05 12:20:20 +08:00
parent ab9b278304
commit 8ee13dde4d
3 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,5 @@
(jbuild_version 1)
(executable
((name run)
(libraries (jbuilder.configurator))))

View File

@ -0,0 +1,15 @@
let () =
Configurator.main ~name:"c_test" (fun t ->
let c_result =
Configurator.c_test t {c|
#include <stdio.h>
int main()
{
printf("Hello, World!");
return 0;
}
|c} in
assert c_result;
print_endline "Successfully compiled c program"
)

View File

@ -1,2 +1,3 @@
$ jbuilder exec config/run.exe
version is present
$ jbuilder exec c_test/run.exe