File tree 18 files changed +163
-78
lines changed
18 files changed +163
-78
lines changed Original file line number Diff line number Diff line change @@ -18,3 +18,5 @@ _build/
18
18
# oasis generated files
19
19
setup.data
20
20
setup.log
21
+
22
+ .DS_store
Original file line number Diff line number Diff line change @@ -8,18 +8,30 @@ PKG base
8
8
PKG base.caml
9
9
PKG base.shadow_stdlib
10
10
PKG bigarray
11
+ PKG bin_prot
12
+ PKG bin_prot.shape
11
13
PKG bytes
12
14
PKG cmdliner
15
+ PKG fieldslib
16
+ PKG ppx_assert.runtime-lib
17
+ PKG ppx_bench.runtime-lib
13
18
PKG ppx_compare.runtime-lib
19
+ PKG ppx_expect.collector
20
+ PKG ppx_expect.common
21
+ PKG ppx_expect.config
14
22
PKG ppx_hash.runtime-lib
23
+ PKG ppx_inline_test.config
24
+ PKG ppx_inline_test.runtime-lib
15
25
PKG re
16
26
PKG re.emacs
17
27
PKG re.str
18
28
PKG result
19
29
PKG sexp_pretty
20
30
PKG sexplib
21
31
PKG sexplib.0
32
+ PKG typerep
22
33
PKG unix
34
+ PKG variantslib
23
35
S ../src/cli
24
36
S ../src/filesystem
25
37
S ../src/jbuilder
Original file line number Diff line number Diff line change @@ -7,18 +7,30 @@ PKG base
7
7
PKG base.caml
8
8
PKG base.shadow_stdlib
9
9
PKG bigarray
10
+ PKG bin_prot
11
+ PKG bin_prot.shape
10
12
PKG bytes
11
13
PKG cmdliner
14
+ PKG fieldslib
15
+ PKG ppx_assert.runtime-lib
16
+ PKG ppx_bench.runtime-lib
12
17
PKG ppx_compare.runtime-lib
18
+ PKG ppx_expect.collector
19
+ PKG ppx_expect.common
20
+ PKG ppx_expect.config
13
21
PKG ppx_hash.runtime-lib
22
+ PKG ppx_inline_test.config
23
+ PKG ppx_inline_test.runtime-lib
14
24
PKG re
15
25
PKG re.emacs
16
26
PKG re.str
17
27
PKG result
18
28
PKG sexp_pretty
19
29
PKG sexplib
20
30
PKG sexplib.0
31
+ PKG typerep
21
32
PKG unix
33
+ PKG variantslib
22
34
S ../filesystem
23
35
S ../jbuilder
24
36
S ../project
Original file line number Diff line number Diff line change 1
1
B ../../_build/default/src/filesystem
2
2
FLG -open Ogen_filesystem -w -40
3
+ FLG -ppx '/Users/holyshared/Documents/projects/ocaml-gen/_build/default/.ppx/ppx_jane+ppx_driver.runner/ppx.exe --as-ppx --cookie '\''library-name="ogen_filesystem"'\'''
4
+ PKG base
5
+ PKG base.caml
6
+ PKG base.shadow_stdlib
3
7
PKG bigarray
8
+ PKG bin_prot
9
+ PKG bin_prot.shape
10
+ PKG fieldslib
11
+ PKG ppx_assert.runtime-lib
12
+ PKG ppx_bench.runtime-lib
13
+ PKG ppx_compare.runtime-lib
14
+ PKG ppx_expect.collector
15
+ PKG ppx_expect.common
16
+ PKG ppx_expect.config
17
+ PKG ppx_hash.runtime-lib
18
+ PKG ppx_inline_test.config
19
+ PKG ppx_inline_test.runtime-lib
4
20
PKG sexplib
5
21
PKG sexplib.0
22
+ PKG typerep
6
23
PKG unix
24
+ PKG variantslib
Original file line number Diff line number Diff line change @@ -65,3 +65,13 @@ let create ?content ~path =
65
65
open_write path
66
66
|> bind ~f: (write_string ~s: (to_string content))
67
67
|> bind ~f: close
68
+
69
+ let % test_module _ = (module struct
70
+ exception Assert_error of string
71
+ let % test_unit " create a new file" =
72
+ let temp_dir = Filename. get_temp_dir_name () in
73
+ let test_file = temp_dir ^ " /" ^ " test.txt" in
74
+ match create ~content: " ok" ~path: test_file with
75
+ | Ok f -> assert ((path f) = test_file)
76
+ | Error e -> raise (Assert_error (string_of_error e))
77
+ end )
Original file line number Diff line number Diff line change 3
3
(library (
4
4
(public_name ogen.file_system)
5
5
(name ogen_filesystem)
6
+ (library_flags -linkall)
6
7
(libraries (sexplib))
8
+ (preprocess (pps (ppx_jane ppx_driver.runner)))
7
9
))
Original file line number Diff line number Diff line change 1
1
B ../../_build/default/src/filesystem
2
2
B ../../_build/default/src/jbuilder
3
3
FLG -open Ogen_jbuilder -w -40
4
- FLG -ppx '/Users/holyshared/Documents/projects/ocaml-gen/_build/default/.ppx/ppx_sexp_conv+ppx_type_conv+ppx_driver.runner/ppx.exe --as-ppx --cookie '\''library-name="ogen_jbuilder"'\'''
4
+ FLG -ppx '/Users/holyshared/Documents/projects/ocaml-gen/_build/default/.ppx/ppx_jane+ ppx_sexp_conv+ppx_type_conv+ppx_driver.runner/ppx.exe --as-ppx --cookie '\''library-name="ogen_jbuilder"'\'''
5
5
PKG base
6
6
PKG base.caml
7
7
PKG base.shadow_stdlib
8
8
PKG bigarray
9
+ PKG bin_prot
10
+ PKG bin_prot.shape
9
11
PKG bytes
12
+ PKG fieldslib
13
+ PKG ppx_assert.runtime-lib
14
+ PKG ppx_bench.runtime-lib
10
15
PKG ppx_compare.runtime-lib
16
+ PKG ppx_expect.collector
17
+ PKG ppx_expect.common
18
+ PKG ppx_expect.config
11
19
PKG ppx_hash.runtime-lib
20
+ PKG ppx_inline_test.config
21
+ PKG ppx_inline_test.runtime-lib
12
22
PKG re
13
23
PKG re.emacs
14
24
PKG re.str
15
25
PKG sexp_pretty
16
26
PKG sexplib
17
27
PKG sexplib.0
28
+ PKG typerep
18
29
PKG unix
30
+ PKG variantslib
19
31
S ../filesystem
Original file line number Diff line number Diff line change 3
3
(library (
4
4
(public_name ogen.jbuilder)
5
5
(name ogen_jbuilder)
6
+ (library_flags -linkall)
6
7
(libraries (sexplib sexp_pretty ogen.file_system))
7
- (preprocess (pps (ppx_type_conv ppx_sexp_conv ppx_driver.runner)))
8
+ (preprocess (pps (ppx_jane ppx_type_conv ppx_sexp_conv ppx_driver.runner)))
8
9
))
Original file line number Diff line number Diff line change @@ -35,3 +35,18 @@ let of_sexp = t_of_sexp
35
35
let to_string t =
36
36
let open Sexp_pretty in
37
37
Pretty_print. sexp_to_string (sexp_of_config_format (" library" , t))
38
+
39
+ let % test_module _ = (module struct
40
+ let % test_unit " configuration of library" =
41
+ let name_by s = create ~name: s ~pub_name: s in
42
+ let lib_conf = name_by " test" () in
43
+ assert ((name lib_conf) = " test" );
44
+ assert ((public_name lib_conf) = (Some " test" ));
45
+ assert ((libraries lib_conf) = None )
46
+
47
+ let % test_unit " configuration to string" =
48
+ let name_by s = create ~name: s ~pub_name: s () in
49
+ let expected = " (library (\n (name test)\n (public_name test)))\n " in
50
+ let acutual = to_string (name_by " test" ) in
51
+ assert (acutual = expected)
52
+ end )
Original file line number Diff line number Diff line change @@ -6,15 +6,27 @@ PKG base
6
6
PKG base.caml
7
7
PKG base.shadow_stdlib
8
8
PKG bigarray
9
+ PKG bin_prot
10
+ PKG bin_prot.shape
9
11
PKG bytes
12
+ PKG fieldslib
13
+ PKG ppx_assert.runtime-lib
14
+ PKG ppx_bench.runtime-lib
10
15
PKG ppx_compare.runtime-lib
16
+ PKG ppx_expect.collector
17
+ PKG ppx_expect.common
18
+ PKG ppx_expect.config
11
19
PKG ppx_hash.runtime-lib
20
+ PKG ppx_inline_test.config
21
+ PKG ppx_inline_test.runtime-lib
12
22
PKG re
13
23
PKG re.emacs
14
24
PKG re.str
15
25
PKG sexp_pretty
16
26
PKG sexplib
17
27
PKG sexplib.0
28
+ PKG typerep
18
29
PKG unix
30
+ PKG variantslib
19
31
S ../filesystem
20
32
S ../jbuilder
Original file line number Diff line number Diff line change
1
+ B ../_build/default/src/cli
2
+ B ../_build/default/src/filesystem
3
+ B ../_build/default/src/jbuilder
4
+ B ../_build/default/src/project
5
+ B ../_build/default/test
6
+ FLG -w -40 -open Ogen_all -w -40
7
+ PKG base
8
+ PKG base.caml
9
+ PKG base.shadow_stdlib
10
+ PKG bigarray
11
+ PKG bin_prot
12
+ PKG bin_prot.shape
13
+ PKG bytes
14
+ PKG cmdliner
15
+ PKG fieldslib
16
+ PKG ppx_assert.runtime-lib
17
+ PKG ppx_bench.runtime-lib
18
+ PKG ppx_compare.runtime-lib
19
+ PKG ppx_expect.collector
20
+ PKG ppx_expect.common
21
+ PKG ppx_expect.config
22
+ PKG ppx_hash.runtime-lib
23
+ PKG ppx_inline_test.config
24
+ PKG ppx_inline_test.runner.lib
25
+ PKG ppx_inline_test.runtime-lib
26
+ PKG re
27
+ PKG re.emacs
28
+ PKG re.str
29
+ PKG result
30
+ PKG sexp_pretty
31
+ PKG sexplib
32
+ PKG sexplib.0
33
+ PKG typerep
34
+ PKG unix
35
+ PKG variantslib
36
+ S .
37
+ S ../src/cli
38
+ S ../src/filesystem
39
+ S ../src/jbuilder
40
+ S ../src/project
Original file line number Diff line number Diff line change
1
+ (library (
2
+ (name ogen_all)
3
+ (libraries (ogen.cli ogen.file_system ogen.jbuilder ogen.project))
4
+ (library_flags -linkall)
5
+ (preprocess (pps (ppx_jane ppx_driver.runner)))
6
+ ))
7
+
8
+ (executable (
9
+ (name test_runner)
10
+ (libraries (ppx_inline_test.runner.lib ogen_all))
11
+ ))
12
+
13
+ (alias
14
+ ((name runtest)
15
+ (deps (test_runner.exe))
16
+ (action (run ${<} inline-test-runner ogen_filesystem -diff-cmd "diff -u --label actual --label expected"))))
17
+
18
+ (alias
19
+ ((name runtest)
20
+ (deps (test_runner.exe))
21
+ (action (run ${<} inline-test-runner ogen_jbuilder -diff-cmd "diff -u --label actual --label expected"))))
22
+
23
+ (jbuild_version 1)
Original file line number Diff line number Diff line change
1
+
2
+ Ppx_inline_test_lib.Runtime. exit ()
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments