Skip to content

Commit

Permalink
Use release test build in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
bdmendes committed Apr 20, 2024
1 parent d969a13 commit 81041c3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov

- name: Test with coverage
run: cargo llvm-cov --all-features --workspace --codecov --output-path codecov.json
run: cargo llvm-cov -r -v --all-features --workspace --codecov --output-path codecov.json

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand Down
20 changes: 13 additions & 7 deletions tests/winatchess.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,16 @@ const SCENARIO_SEARCH_TIME: Duration = Duration::new(1, 0);
const SCENARIO_THREADS: u16 = 4;

fn expect_search(fen: &str, mov: &str) {
for cof in &[1, 5, 30, 90] {
let duration = SCENARIO_SEARCH_TIME * *cof;
let quick_constraint = SearchConstraint {
let table = Arc::new(SearchTable::new(DEFAULT_TABLE_SIZE_MB * SCENARIO_THREADS as usize));

for cof in 1.. {
let duration = SCENARIO_SEARCH_TIME * cof;

if duration > Duration::new(30, 0) {
panic!("Search failed for {} {}", fen, mov);
}

let constraint = SearchConstraint {
time_constraint: Some(TimeConstraint {
initial_instant: Instant::now(),
move_time: duration,
Expand All @@ -33,21 +40,20 @@ fn expect_search(fen: &str, mov: &str) {
game_history: vec![],
};

let table = SearchTable::new(DEFAULT_TABLE_SIZE_MB * SCENARIO_THREADS as usize);
let result = search_iterative_deepening_multithread(
&Position::from_fen(fen).unwrap(),
0,
MAX_DEPTH,
Arc::new(table),
&quick_constraint,
table.clone(),
&constraint,
);

if result.unwrap().to_string() == mov {
return;
}
}

panic!("Search failed for {} {}", fen, mov);
unreachable!()
}

const WAC_POSITIONS: &str =
Expand Down

0 comments on commit 81041c3

Please sign in to comment.