Skip to content

Commit 724bd07

Browse files
committed
skip tests that are expected to fail for now
1 parent 2c226a9 commit 724bd07

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

test/cases.zig

+11-12
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ pub fn addCaseTests(
2323
.optimize = mode,
2424
});
2525
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?
3127
b.installArtifact(exe);
3228
exes[i] = exe;
3329
}
@@ -49,6 +45,9 @@ pub fn addCaseTests(
4945
const case = caseFromFile(b, entry, target.query) catch |err|
5046
std.debug.panic("failed to process case '{s}': {s}", .{ entry.path, @errorName(err) });
5147

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+
5251
for (translate_exes) |exe| switch (case.kind) {
5352
.translate => |output| {
5453
const annotated_case_name = b.fmt("translate {s}", .{case.name});
@@ -67,7 +66,6 @@ pub fn addCaseTests(
6766
const check_file = translate_c.addCheckFile(output);
6867
check_file.step.name = b.fmt("{s} CheckFile", .{annotated_case_name});
6968
test_translate_step.dependOn(&check_file.step);
70-
test_translate_step.dependOn(&translate_c.step);
7169
},
7270
.run => |output| {
7371
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
163161
expect = std.meta.stringToEnum(Case.Expect, value) orelse return error.InvalidExpectValue;
164162
} else return error.InvalidTestConfigOption;
165163
}
166-
164+
167165
return .{
168166
.name = std.fs.path.stem(entry.basename),
169167
.target = b.resolveTargetQuery(target),
@@ -179,8 +177,9 @@ fn caseFromFile(b: *std.Build, entry: std.fs.Dir.Walker.Entry, default_target: s
179177
fn trailing(arena: std.mem.Allocator, it: *std.mem.TokenIterator(u8, .scalar)) ![]const u8 {
180178
var buf: std.ArrayList(u8) = .init(arena);
181179
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..];
184183
if (buf.items.len != 0) try buf.append('\n');
185184
try buf.appendSlice(trimmed);
186185
}
@@ -193,8 +192,9 @@ fn trailingSplit(arena: std.mem.Allocator, it: *std.mem.TokenIterator(u8, .scala
193192
var buf: std.ArrayList(u8) = .init(arena);
194193
defer buf.deinit();
195194

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..];
198198
if (trimmed.len == 0) {
199199
if (buf.items.len != 0) {
200200
try out.append(try buf.toOwnedSlice());
@@ -209,4 +209,3 @@ fn trailingSplit(arena: std.mem.Allocator, it: *std.mem.TokenIterator(u8, .scala
209209
}
210210
return try out.toOwnedSlice();
211211
}
212-

0 commit comments

Comments
 (0)