Skip to content

Commit

Permalink
port test-enums to dune
Browse files Browse the repository at this point in the history
  • Loading branch information
avsm committed May 18, 2019
1 parent f353636 commit d72e533
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/test-enums/dune
Original file line number Diff line number Diff line change
@@ -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))
4 changes: 4 additions & 0 deletions tests/test-enums/struct-stub-generator/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(executable
(name driver)
(modules driver)
(libraries ctypes test_enums_struct_stubs tests_common))
4 changes: 4 additions & 0 deletions tests/test-enums/struct-stubs/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(library
(name test_enums_struct_stubs)
(wrapped false)
(libraries ctypes))
4 changes: 4 additions & 0 deletions tests/test-enums/stub-generator/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(executable
(name driver)
(modules driver)
(libraries ctypes test_enums_stubs tests_common))
8 changes: 8 additions & 0 deletions tests/test-enums/stubs/dune
Original file line number Diff line number Diff line change
@@ -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}))))
2 changes: 2 additions & 0 deletions tests/test-enums/test_enums.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* See the file LICENSE for details.
*)

[@@@warning "-33"]

open OUnit2
open Ctypes

Expand Down

0 comments on commit d72e533

Please sign in to comment.