diff --git a/Makefile b/Makefile index 1a2ac54f..97656a3a 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,10 @@ run-integration-test: @zig build integration_test ./zig-out/bin/integration_test +run-integration-test-filter: + @zig build integration_test + ./zig-out/bin/integration_test $(FILTER) + build-and-run-pedersen-table-gen: @zig build pedersen_table_gen > ./src/math/crypto/pedersen/gen/constants.zig diff --git a/src/integration_tests.zig b/src/integration_tests.zig index d6ce79a5..3909b87a 100644 --- a/src/integration_tests.zig +++ b/src/integration_tests.zig @@ -5,7 +5,7 @@ const CairoVM = @import("vm/core.zig").CairoVM; const CairoRunner = @import("vm/runners/cairo_runner.zig").CairoRunner; const HintProcessor = @import("./hint_processor/hint_processor_def.zig").CairoVMHintProcessor; -pub fn main() void { +pub fn main() !void { var gpa = std.heap.GeneralPurposeAllocator(.{}){}; // Given const allocator = gpa.allocator(); @@ -227,6 +227,10 @@ pub fn main() void { .{ .pathname = "cairo_programs/usort.json", .layout = "all_cairo" }, }; + const args = try std.process.argsAlloc(allocator); + defer std.process.argsFree(allocator, args); + const test_substring = if (args.len > 1) args[1] else ""; + var ok_count: usize = 0; var fail_count: usize = 0; var progress = std.Progress{ @@ -237,6 +241,10 @@ pub fn main() void { (progress.supports_ansi_escape_codes or progress.is_windows_terminal); for (cairo_programs, 0..) |test_cairo_program, i| { + // Check if the current test's pathname contains the provided test filter substring + if (test_substring.len > 0 and !std.mem.containsAtLeast(u8, test_cairo_program.pathname, 1, test_substring)) { + continue; + } var test_node = root_node.start(test_cairo_program.pathname, 0); test_node.activate(); progress.refresh();