Skip to content

Commit

Permalink
Disable speed tests, CI will be quite variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ringtailsoftware committed Nov 30, 2024
1 parent 87b0e0d commit 4af1905
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions src/test.zig
Original file line number Diff line number Diff line change
Expand Up @@ -576,31 +576,31 @@ test "gamerr1" {
}
}

test "speed" {
var pi:usize = 0;
config.players[0] = try UiAgent.make("random");
config.players[1] = try UiAgent.make("random");
const runs = 100;

clock.initTime();
const start = clock.millis();

for (0..runs) |_| {
var gs = GameState.init();
while(!gs.hasWon(0) and !gs.hasWon(1)) {
try config.players[pi].selectMoveInteractive(&gs, pi);
try config.players[pi].process(&gs, pi);
// FIXME assumes move is available immediately, should poll for it and call process repeatedly
if (config.players[pi].getCompletedMove()) |vmove| {
try gs.applyMove(pi, vmove);
pi = (pi + 1) % config.NUM_PAWNS;
}
}
}
const end = clock.millis();
std.debug.print("t={any}\r\n", .{end-start});

try expect(end-start < 3000);


}
//test "speed" {
// var pi:usize = 0;
// config.players[0] = try UiAgent.make("random");
// config.players[1] = try UiAgent.make("random");
// const runs = 100;
//
// clock.initTime();
// const start = clock.millis();
//
// for (0..runs) |_| {
// var gs = GameState.init();
// while(!gs.hasWon(0) and !gs.hasWon(1)) {
// try config.players[pi].selectMoveInteractive(&gs, pi);
// try config.players[pi].process(&gs, pi);
// // FIXME assumes move is available immediately, should poll for it and call process repeatedly
// if (config.players[pi].getCompletedMove()) |vmove| {
// try gs.applyMove(pi, vmove);
// pi = (pi + 1) % config.NUM_PAWNS;
// }
// }
// }
// const end = clock.millis();
// std.debug.print("t={any}\r\n", .{end-start});
//
// try expect(end-start < 3000);
//
//
//}

0 comments on commit 4af1905

Please sign in to comment.