@@ -16,7 +16,7 @@ COMPFLAGS= -g -w -40-30 -warn-error +a-40-30
16
16
17
17
print-% : ; @echo $* = $($* )
18
18
19
- INCLUDES = -I +compiler-libs -I ext -I common -I syntax -I depends -I core -I bsb
19
+ INCLUDES = -I +compiler-libs -I ext -I common -I syntax -I depends -I core -I bsb -I ounit -I ounit_tests
20
20
21
21
.mli.cmi :
22
22
$(NATIVE ) $(INCLUDES ) $(COMPFLAGS ) -c $<
@@ -46,7 +46,12 @@ common/bs_version.ml: build_version.js ../package.json
46
46
47
47
48
48
# ## list files
49
- EXT_SRCS = ext_array ext_bytes ext_char ext_file_pp ext_format ext_hashtbl ext_list ext_map ext_marshal ext_option \
49
+ OUNIT_SRCS = oUnit oUnitDiff oUnitLogger oUnitTypes oUnitUtils oUnitChooser
50
+ OUNIT_CMXS = $(addprefix ounit/, $(addsuffix .cmx, $(OUNIT_SRCS ) ) )
51
+ OUNIT_TESTS_SRCS = ounit_tests_main
52
+ OUNIT_TESTS_CMXS = $(addprefix ounit_tests/, $(addsuffix .cmx, $(OUNIT_TESTS_SRCS ) ) )
53
+
54
+ EXT_SRCS = ext_array ext_bytes ext_char resize_array ext_file_pp ext_format ext_hashtbl ext_list ext_map ext_marshal ext_option \
50
55
ext_pervasives ext_pp ext_ref ext_string ext_sys hash_set ident_set int_map literals string_map \
51
56
string_set ext_pp_scope ext_io ext_ident ext_filename
52
57
@@ -82,6 +87,9 @@ BSB_CMXS=$(addprefix bsb/, $(addsuffix .cmx, $(BSB_SRCS)))
82
87
MAIN_SRCS = jsgen_main jscmj_main bsb/bsb_main
83
88
MAINS_CMXS =$(addsuffix .cmx, $(MAIN_SRCS ) )
84
89
90
+ ounit.cmxa : $(OUNIT_CMXS )
91
+ ocamlopt.opt -a $^ -o $@
92
+
85
93
ext.cmxa : $(EXT_CMXS )
86
94
ocamlopt.opt -a $^ -o $@
87
95
common.cmxa :$(COMMON_CMXS )
@@ -95,7 +103,7 @@ core.cmxa:$(CORE_CMXS)
95
103
bsb.cmxa :$(BSB_CMXS )
96
104
ocamlopt.opt -a $^ -o $@
97
105
98
- check : $(EXT_CMXS ) $(COMMON_CMXS ) $(SYNTAX_CMXS ) $(DEPENDS_CMXS ) $(CORE_CMXS ) $(BSB_CMXS ) $(OTHER_CORE_CMXS ) $(MAIN_CMXS )
106
+ check : $(EXT_CMXS ) $(COMMON_CMXS ) $(SYNTAX_CMXS ) $(DEPENDS_CMXS ) $(CORE_CMXS ) $(BSB_CMXS ) $(OTHER_CORE_CMXS ) $(MAIN_CMXS ) $( OUNIT_CMXS ) $( OUNIT_TESTS_CMXS )
99
107
100
108
bin/bsb.exe : ext.cmxa common.cmxa bsb.cmxa bsb/bsb_main.cmx
101
109
$(NATIVE ) -g unix.cmxa str.cmxa $^ -o $@
@@ -118,11 +126,11 @@ bin/jsgen.exe:ext.cmxa jsgen_main.cmx
118
126
119
127
120
128
depend :
121
- $(CAMLDEP ) -native -I ext -I common -I syntax -I depends -I core -I bsb ext/* .ml ext/* .mli common/* .ml common/* .mli syntax/* .ml syntax/* .mli * .ml * .mli depends/* .ml depends/* .mli core/* .ml core/* .mli bsb/* .ml bsb/* .mli > all.depend
129
+ $(CAMLDEP ) -native -I ext -I common -I syntax -I depends -I core -I ounit -I ounit_tests -I bsb ext/* .ml ext/* .mli common/* .ml common/* .mli syntax/* .ml syntax/* .mli * .ml * .mli depends/* .ml depends/* .mli core/* .ml core/* .mli bsb/* .ml bsb/ * .mli ounit/ * .mli ounit/ * .ml ounit_tests/ * .ml ounit_tests /* .mli > all.depend
122
130
123
131
124
132
125
- SNAPSHOT_SRCS =$(addprefix bin/, $(addsuffix .ml, bsppx whole_compiler bsdep bsb bspp) )
133
+ SNAPSHOT_SRCS =$(addprefix bin/, $(addsuffix .ml, bsppx whole_compiler bsdep bsb bspp all_ounit_tests ) )
126
134
SNAPSHOT_DEPS=$(SNAPSHOT_SRCS:.ml =.d)
127
135
128
136
# this target is used to make snapshotml
@@ -194,7 +202,15 @@ bin/bspp.ml:./bin/bspack.exe
194
202
bin/js_compiler.ml :./bin/bspack.exe
195
203
BS_COMPILER_IN_BROWSER=true bspack.exe -bs-MD -prelude-str ' module Config = Config_whole_compiler' -bs-exclude-I config -o $@ -bs-main Jsoo_main -I ../ocaml/utils/ -I ../ocaml/parsing/ -I ../ocaml/typing/ -I ../ocaml/bytecomp/ -I ../ocaml/driver/ -I ext -I syntax -I depends -I common -I core
196
204
205
+ bin/all_ounit_tests.ml :./bin/bspack.exe
206
+ $< -bs-MD -I ounit -I ounit_tests -I common -I ext -I syntax -I depends -I bspp -I core -bs-main Ounit_tests_main -o $@
207
+ -include bin/all_ounit_tests.d
208
+ bin/all_ounit_tests.byte :bin/all_ounit_tests.mli bin/all_ounit_tests.ml
209
+ ocamlc.opt -g -I bin -w -a unix.cma $^ -o $@
197
210
211
+ ounit_test :bin/all_ounit_tests.byte
212
+ $^
213
+ .PHONY :ounit_test
198
214
# TODO: Fix Me use its own configuration
199
215
bin/js_compiler.byte :bin/js_compiler.mli bin/js_compiler.ml
200
216
ocamlc.opt -w -a -I bin bin/config_whole_compiler.mli bin/config_whole_compiler.ml $^ -no-check-prims -o $@
@@ -265,6 +281,7 @@ world:
265
281
travis-world-test :
266
282
$(MAKE ) world
267
283
@echo " Making test"
284
+ make ounit_test
268
285
$(MAKE ) -C test all
269
286
@echo " Making test finsihed"
270
287
0 commit comments