Skip to content

Commit 92f72ff

Browse files
authored
Merge pull request #276 from avsm/fix-tests
ppx_tests: preprocess output to remove file id
2 parents c680aa0 + 59bf6b9 commit 92f72ff

19 files changed

+69
-85
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ env:
1515
- PACKAGE="cstruct" DISTRO="alpine" OCAML_VERSION="4.07"
1616
- PACKAGE="cstruct-lwt" DISTRO="debian-testing" OCAML_VERSION="4.07"
1717
- PACKAGE="cstruct-async" DISTRO="centos" OCAML_VERSION="4.07"
18-
- PACKAGE="ppx_cstruct" DISTRO="debian-unstable" OCAML_VERSION="4.07"
18+
- PACKAGE="ppx_cstruct" DISTRO="debian-stable" OCAML_VERSION="4.07"
1919
- PACKAGE="cstruct-unix" DISTRO="ubuntu" OCAML_VERSION="4.07"
2020
- PACKAGE="cstruct-unix" DISTRO="alpine" OCAML_VERSION="4.08"
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
File "cenum_id_payload.ml", line 2, characters 18-20:
21
Error: ppx_cstruct: invalid id
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
File "cenum_invalid_type.ml", line 2, characters 11-19:
21
Error: ppx_cstruct: invalid cenum variant
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
File "cenum_no_attribute.ml", line 2, characters 2-18:
21
Error: ppx_cstruct: invalid cenum attributes
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
File "cenum_not_a_variant.ml", line 2, characters 2-34:
21
Error: ppx_cstruct: expected variant type
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
File "cenum_unknown_attribute.ml", line 2, characters 2-32:
21
Error: ppx_cstruct: enum: unknown width specifier uint9_t
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
File "cstruct_attribute_payload.ml", line 2, characters 2-57:
21
Error: ppx_cstruct: no attribute payload expected
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
File "cstruct_duplicate_field.ml", line 5, characters 2-14:
21
Error: ppx_cstruct: field x is present several times in this type
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
File "cstruct_len_int32.ml", line 3, characters 17-20:
21
Error: ppx_cstruct: [@len] argument should be an integer
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
File "cstruct_len_not_int.ml", line 3, characters 17-20:
21
Error: ppx_cstruct: [@len] argument should be an integer
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
File "cstruct_len_zero.ml", line 3, characters 17-20:
21
Error: ppx_cstruct: [@len] argument should be > 0
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
File "cstruct_multiple_len.ml", line 3, characters 4-35:
21
Error: ppx_cstruct: multiple field length attribute
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
File "cstruct_not_a_record.ml", line 2, characters 2-14:
21
Error: ppx_cstruct: record type declaration expected
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
File "cstruct_not_an_identifier.ml", line 3, characters 8-20:
21
Error: ppx_cstruct: type identifier expected
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
File "cstruct_several_attributes.ml", line 2, characters 2-71:
21
Error: ppx_cstruct: too many attributes
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
File "cstruct_unknown_endian.ml", line 2, characters 2-49:
21
Error: ppx_cstruct: unknown endian unknown_endian, should be little_endian, big_endian, host_endian or bi_endian
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
File "cstruct_unknown_type.ml", line 3, characters 4-15:
21
Error: ppx_cstruct: Unknown type uint9_t

ppx_test/errors/dune.inc

+64-64
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
(deps pp.exe (:input cenum_id_payload.ml))
44
(targets cenum_id_payload.ml.errors)
55
(action
6-
(with-stderr-to
7-
%{targets}
8-
(run ./pp.exe --impl %{input}))))
9-
6+
(progn
7+
(with-stderr-to %{targets}
8+
(run ./pp.exe --impl %{input}))
9+
(bash "sed -i.bak '1d' %{targets}"))))
1010
(rule
1111
(alias runtest)
1212
(package ppx_cstruct)
@@ -17,10 +17,10 @@
1717
(deps pp.exe (:input cenum_invalid_type.ml))
1818
(targets cenum_invalid_type.ml.errors)
1919
(action
20-
(with-stderr-to
21-
%{targets}
22-
(run ./pp.exe --impl %{input}))))
23-
20+
(progn
21+
(with-stderr-to %{targets}
22+
(run ./pp.exe --impl %{input}))
23+
(bash "sed -i.bak '1d' %{targets}"))))
2424
(rule
2525
(alias runtest)
2626
(package ppx_cstruct)
@@ -31,10 +31,10 @@
3131
(deps pp.exe (:input cenum_no_attribute.ml))
3232
(targets cenum_no_attribute.ml.errors)
3333
(action
34-
(with-stderr-to
35-
%{targets}
36-
(run ./pp.exe --impl %{input}))))
37-
34+
(progn
35+
(with-stderr-to %{targets}
36+
(run ./pp.exe --impl %{input}))
37+
(bash "sed -i.bak '1d' %{targets}"))))
3838
(rule
3939
(alias runtest)
4040
(package ppx_cstruct)
@@ -45,10 +45,10 @@
4545
(deps pp.exe (:input cenum_not_a_variant.ml))
4646
(targets cenum_not_a_variant.ml.errors)
4747
(action
48-
(with-stderr-to
49-
%{targets}
50-
(run ./pp.exe --impl %{input}))))
51-
48+
(progn
49+
(with-stderr-to %{targets}
50+
(run ./pp.exe --impl %{input}))
51+
(bash "sed -i.bak '1d' %{targets}"))))
5252
(rule
5353
(alias runtest)
5454
(package ppx_cstruct)
@@ -59,10 +59,10 @@
5959
(deps pp.exe (:input cenum_unknown_attribute.ml))
6060
(targets cenum_unknown_attribute.ml.errors)
6161
(action
62-
(with-stderr-to
63-
%{targets}
64-
(run ./pp.exe --impl %{input}))))
65-
62+
(progn
63+
(with-stderr-to %{targets}
64+
(run ./pp.exe --impl %{input}))
65+
(bash "sed -i.bak '1d' %{targets}"))))
6666
(rule
6767
(alias runtest)
6868
(package ppx_cstruct)
@@ -73,10 +73,10 @@
7373
(deps pp.exe (:input cstruct_attribute_payload.ml))
7474
(targets cstruct_attribute_payload.ml.errors)
7575
(action
76-
(with-stderr-to
77-
%{targets}
78-
(run ./pp.exe --impl %{input}))))
79-
76+
(progn
77+
(with-stderr-to %{targets}
78+
(run ./pp.exe --impl %{input}))
79+
(bash "sed -i.bak '1d' %{targets}"))))
8080
(rule
8181
(alias runtest)
8282
(package ppx_cstruct)
@@ -87,10 +87,10 @@
8787
(deps pp.exe (:input cstruct_duplicate_field.ml))
8888
(targets cstruct_duplicate_field.ml.errors)
8989
(action
90-
(with-stderr-to
91-
%{targets}
92-
(run ./pp.exe --impl %{input}))))
93-
90+
(progn
91+
(with-stderr-to %{targets}
92+
(run ./pp.exe --impl %{input}))
93+
(bash "sed -i.bak '1d' %{targets}"))))
9494
(rule
9595
(alias runtest)
9696
(package ppx_cstruct)
@@ -101,10 +101,10 @@
101101
(deps pp.exe (:input cstruct_len_int32.ml))
102102
(targets cstruct_len_int32.ml.errors)
103103
(action
104-
(with-stderr-to
105-
%{targets}
106-
(run ./pp.exe --impl %{input}))))
107-
104+
(progn
105+
(with-stderr-to %{targets}
106+
(run ./pp.exe --impl %{input}))
107+
(bash "sed -i.bak '1d' %{targets}"))))
108108
(rule
109109
(alias runtest)
110110
(package ppx_cstruct)
@@ -115,10 +115,10 @@
115115
(deps pp.exe (:input cstruct_len_not_int.ml))
116116
(targets cstruct_len_not_int.ml.errors)
117117
(action
118-
(with-stderr-to
119-
%{targets}
120-
(run ./pp.exe --impl %{input}))))
121-
118+
(progn
119+
(with-stderr-to %{targets}
120+
(run ./pp.exe --impl %{input}))
121+
(bash "sed -i.bak '1d' %{targets}"))))
122122
(rule
123123
(alias runtest)
124124
(package ppx_cstruct)
@@ -129,10 +129,10 @@
129129
(deps pp.exe (:input cstruct_len_zero.ml))
130130
(targets cstruct_len_zero.ml.errors)
131131
(action
132-
(with-stderr-to
133-
%{targets}
134-
(run ./pp.exe --impl %{input}))))
135-
132+
(progn
133+
(with-stderr-to %{targets}
134+
(run ./pp.exe --impl %{input}))
135+
(bash "sed -i.bak '1d' %{targets}"))))
136136
(rule
137137
(alias runtest)
138138
(package ppx_cstruct)
@@ -143,10 +143,10 @@
143143
(deps pp.exe (:input cstruct_multiple_len.ml))
144144
(targets cstruct_multiple_len.ml.errors)
145145
(action
146-
(with-stderr-to
147-
%{targets}
148-
(run ./pp.exe --impl %{input}))))
149-
146+
(progn
147+
(with-stderr-to %{targets}
148+
(run ./pp.exe --impl %{input}))
149+
(bash "sed -i.bak '1d' %{targets}"))))
150150
(rule
151151
(alias runtest)
152152
(package ppx_cstruct)
@@ -157,10 +157,10 @@
157157
(deps pp.exe (:input cstruct_not_a_record.ml))
158158
(targets cstruct_not_a_record.ml.errors)
159159
(action
160-
(with-stderr-to
161-
%{targets}
162-
(run ./pp.exe --impl %{input}))))
163-
160+
(progn
161+
(with-stderr-to %{targets}
162+
(run ./pp.exe --impl %{input}))
163+
(bash "sed -i.bak '1d' %{targets}"))))
164164
(rule
165165
(alias runtest)
166166
(package ppx_cstruct)
@@ -171,10 +171,10 @@
171171
(deps pp.exe (:input cstruct_not_an_identifier.ml))
172172
(targets cstruct_not_an_identifier.ml.errors)
173173
(action
174-
(with-stderr-to
175-
%{targets}
176-
(run ./pp.exe --impl %{input}))))
177-
174+
(progn
175+
(with-stderr-to %{targets}
176+
(run ./pp.exe --impl %{input}))
177+
(bash "sed -i.bak '1d' %{targets}"))))
178178
(rule
179179
(alias runtest)
180180
(package ppx_cstruct)
@@ -185,10 +185,10 @@
185185
(deps pp.exe (:input cstruct_several_attributes.ml))
186186
(targets cstruct_several_attributes.ml.errors)
187187
(action
188-
(with-stderr-to
189-
%{targets}
190-
(run ./pp.exe --impl %{input}))))
191-
188+
(progn
189+
(with-stderr-to %{targets}
190+
(run ./pp.exe --impl %{input}))
191+
(bash "sed -i.bak '1d' %{targets}"))))
192192
(rule
193193
(alias runtest)
194194
(package ppx_cstruct)
@@ -199,10 +199,10 @@
199199
(deps pp.exe (:input cstruct_unknown_endian.ml))
200200
(targets cstruct_unknown_endian.ml.errors)
201201
(action
202-
(with-stderr-to
203-
%{targets}
204-
(run ./pp.exe --impl %{input}))))
205-
202+
(progn
203+
(with-stderr-to %{targets}
204+
(run ./pp.exe --impl %{input}))
205+
(bash "sed -i.bak '1d' %{targets}"))))
206206
(rule
207207
(alias runtest)
208208
(package ppx_cstruct)
@@ -213,10 +213,10 @@
213213
(deps pp.exe (:input cstruct_unknown_type.ml))
214214
(targets cstruct_unknown_type.ml.errors)
215215
(action
216-
(with-stderr-to
217-
%{targets}
218-
(run ./pp.exe --impl %{input}))))
219-
216+
(progn
217+
(with-stderr-to %{targets}
218+
(run ./pp.exe --impl %{input}))
219+
(bash "sed -i.bak '1d' %{targets}"))))
220220
(rule
221221
(alias runtest)
222222
(package ppx_cstruct)

ppx_test/errors/gen_tests.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ let output_stanzas name =
55
(deps pp.exe (:input %s))
66
(targets %s.errors)
77
(action
8-
(with-stderr-to
9-
%%{targets}
10-
(run ./pp.exe --impl %%{input}))))
11-
8+
(progn
9+
(with-stderr-to %%{targets}
10+
(run ./pp.exe --impl %%{input}))
11+
(bash "sed -i.bak '1d' %%{targets}"))))
1212
(rule
1313
(alias runtest)
1414
(package ppx_cstruct)

0 commit comments

Comments
 (0)