@@ -23,11 +23,7 @@ pub fn addCaseTests(
23
23
.optimize = mode ,
24
24
});
25
25
exe .root_module .addImport ("aro" , aro .module ("aro" ));
26
- b .installDirectory (.{
27
- .source_dir = aro .path ("include" ),
28
- .install_dir = .prefix ,
29
- .install_subdir = "include" ,
30
- });
26
+ // TODO why does this need to be installed?
31
27
b .installArtifact (exe );
32
28
exes [i ] = exe ;
33
29
}
@@ -49,6 +45,9 @@ pub fn addCaseTests(
49
45
const case = caseFromFile (b , entry , target .query ) catch | err |
50
46
std .debug .panic ("failed to process case '{s}': {s}" , .{ entry .path , @errorName (err ) });
51
47
48
+ // Skip cases we expect to fail, would be nice to be able to check that they actually do fail.
49
+ if (case .expect == .fail ) continue ;
50
+
52
51
for (translate_exes ) | exe | switch (case .kind ) {
53
52
.translate = > | output | {
54
53
const annotated_case_name = b .fmt ("translate {s}" , .{case .name });
@@ -67,7 +66,6 @@ pub fn addCaseTests(
67
66
const check_file = translate_c .addCheckFile (output );
68
67
check_file .step .name = b .fmt ("{s} CheckFile" , .{annotated_case_name });
69
68
test_translate_step .dependOn (& check_file .step );
70
- test_translate_step .dependOn (& translate_c .step );
71
69
},
72
70
.run = > | output | {
73
71
const annotated_case_name = b .fmt ("run-translated {s}" , .{case .name });
@@ -163,7 +161,7 @@ fn caseFromFile(b: *std.Build, entry: std.fs.Dir.Walker.Entry, default_target: s
163
161
expect = std .meta .stringToEnum (Case .Expect , value ) orelse return error .InvalidExpectValue ;
164
162
} else return error .InvalidTestConfigOption ;
165
163
}
166
-
164
+
167
165
return .{
168
166
.name = std .fs .path .stem (entry .basename ),
169
167
.target = b .resolveTargetQuery (target ),
@@ -179,8 +177,9 @@ fn caseFromFile(b: *std.Build, entry: std.fs.Dir.Walker.Entry, default_target: s
179
177
fn trailing (arena : std.mem.Allocator , it : * std .mem .TokenIterator (u8 , .scalar )) ! []const u8 {
180
178
var buf : std .ArrayList (u8 ) = .init (arena );
181
179
defer buf .deinit ();
182
- while (it .next ()) | line | {
183
- const trimmed = std .mem .trim (u8 , line [2.. ], " \t \r " );
180
+ while (it .next ()) | line | {
181
+ if (line .len < 3 ) continue ;
182
+ const trimmed = line [3.. ];
184
183
if (buf .items .len != 0 ) try buf .append ('\n ' );
185
184
try buf .appendSlice (trimmed );
186
185
}
@@ -193,8 +192,9 @@ fn trailingSplit(arena: std.mem.Allocator, it: *std.mem.TokenIterator(u8, .scala
193
192
var buf : std .ArrayList (u8 ) = .init (arena );
194
193
defer buf .deinit ();
195
194
196
- while (it .next ()) | line | {
197
- const trimmed = std .mem .trim (u8 , line [2.. ], " \t \r " );
195
+ while (it .next ()) | line | {
196
+ if (line .len < 3 ) continue ;
197
+ const trimmed = line [3.. ];
198
198
if (trimmed .len == 0 ) {
199
199
if (buf .items .len != 0 ) {
200
200
try out .append (try buf .toOwnedSlice ());
@@ -209,4 +209,3 @@ fn trailingSplit(arena: std.mem.Allocator, it: *std.mem.TokenIterator(u8, .scala
209
209
}
210
210
return try out .toOwnedSlice ();
211
211
}
212
-
0 commit comments