diff --git a/tests/test-enums/dune b/tests/test-enums/dune new file mode 100644 index 00000000..bb690472 --- /dev/null +++ b/tests/test-enums/dune @@ -0,0 +1,29 @@ +(rule + (targets generated_struct_stubs.c) + (action (run %{exe:struct-stub-generator/driver.exe} --c-struct-file %{targets}))) + +(rule + (targets struct-stub-generator.exe) + (deps generated_struct_stubs.c ../clib/test_functions.h ../config/test-cflags) + (action (run %{cc} %{read-lines:../config/test-cflags} -I ../clib + -I %{ocaml-config:standard_library} -o %{targets} generated_struct_stubs.c))) + +(rule + (targets generated_stubs.c) + (action (run %{exe:stub-generator/driver.exe} --c-file %{targets}))) + +(rule + (targets generated_bindings.ml) + (action (run %{exe:stub-generator/driver.exe} --ml-file %{targets}))) + +(library + (name test_enums_generated) + (modules generated_bindings) + (c_names generated_stubs) + (libraries test_functions) + (wrapped false)) + +(test + (name test_enums) + (modules test_enums) + (libraries ounit ctypes test_enums_generated test_enums_stubs)) diff --git a/tests/test-enums/struct-stub-generator/dune b/tests/test-enums/struct-stub-generator/dune new file mode 100644 index 00000000..6bcf34be --- /dev/null +++ b/tests/test-enums/struct-stub-generator/dune @@ -0,0 +1,4 @@ +(executable + (name driver) + (modules driver) + (libraries ctypes test_enums_struct_stubs tests_common)) diff --git a/tests/test-enums/struct-stubs/dune b/tests/test-enums/struct-stubs/dune new file mode 100644 index 00000000..a2f58637 --- /dev/null +++ b/tests/test-enums/struct-stubs/dune @@ -0,0 +1,4 @@ +(library + (name test_enums_struct_stubs) + (wrapped false) + (libraries ctypes)) diff --git a/tests/test-enums/stub-generator/dune b/tests/test-enums/stub-generator/dune new file mode 100644 index 00000000..ee5b8649 --- /dev/null +++ b/tests/test-enums/stub-generator/dune @@ -0,0 +1,4 @@ +(executable + (name driver) + (modules driver) + (libraries ctypes test_enums_stubs tests_common)) diff --git a/tests/test-enums/stubs/dune b/tests/test-enums/stubs/dune new file mode 100644 index 00000000..939d1446 --- /dev/null +++ b/tests/test-enums/stubs/dune @@ -0,0 +1,8 @@ +(library + (name test_enums_stubs) + (wrapped false) + (libraries ctypes.stubs test_enums_struct_stubs)) + +(rule + (targets generated_struct_bindings.ml) + (action (with-stdout-to %{targets} (run %{exe:../struct-stub-generator.exe})))) diff --git a/tests/test-enums/test_enums.ml b/tests/test-enums/test_enums.ml index b6471e1b..8d6ce102 100644 --- a/tests/test-enums/test_enums.ml +++ b/tests/test-enums/test_enums.ml @@ -5,6 +5,8 @@ * See the file LICENSE for details. *) +[@@@warning "-33"] + open OUnit2 open Ctypes