Skip to content

Commit 4bafb2e

Browse files
OlivierNicolehhugo
authored andcommitted
Add test for --empty-sourcemap
1 parent 8e4294c commit 4bafb2e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

compiler/tests-jsoo/empty_sourcemap.t

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
$ echo 'prerr_endline "a"' > a.ml
2+
$ echo 'prerr_endline "b"' > b.ml
3+
$ ocamlc -g a.ml -c
4+
$ ocamlc -g b.ml -c
5+
$ ocamlc -g a.cmo b.cmo -o test.bc
6+
7+
Build object files and executable with --empty-sourcemap:
8+
9+
$ dune exec -- js_of_ocaml --sourcemap --empty-sourcemap a.cmo -o a.js
10+
$ cat a.map
11+
{"version":3,"file":"a.js","names":[],"sources":[],"mappings":"","sourcesContent":[]}
12+
$ dune exec -- js_of_ocaml --sourcemap --empty-sourcemap b.cmo -o b.js
13+
$ cat b.map
14+
{"version":3,"file":"b.js","names":[],"sources":[],"mappings":"","sourcesContent":[]}
15+
$ dune exec -- js_of_ocaml --sourcemap --empty-sourcemap test.bc -o test.js
16+
$ cat test.map
17+
{"version":3,"file":"test.js","names":[],"sources":[],"mappings":"","sourcesContent":[]}
18+
19+
Build object files with sourcemap and link with --empty-sourcemap:
20+
21+
$ dune exec -- js_of_ocaml --sourcemap a.cmo -o a.js
22+
$ dune exec -- js_of_ocaml --sourcemap b.cmo -o b.js
23+
$ dune exec -- js_of_ocaml link --sourcemap --resolve-sourcemap-url=true --empty-sourcemap a.js b.js -o test.js -a
24+
$ cat test.map
25+
{"version":3,"file":"test.js","sections":[]}

0 commit comments

Comments
 (0)