Compare commits

..

3 Commits

Author SHA1 Message Date
Savanni D'Gerinel d76a824987 Resolve tests which call the GameState constructor
I changed the constructor from new() to default(), but didn't catch all of the tests.
2023-10-05 12:31:27 -04:00
Savanni D'Gerinel 436b0c3a0d Run release build before building running the dist scripts 2023-10-05 12:30:18 -04:00
Savanni D'Gerinel 672e5aeaa1 Make sure the distribution scripts compress files and include version numbers 2023-10-05 12:29:19 -04:00
5 changed files with 8 additions and 7 deletions

View File

@ -38,6 +38,7 @@ build_dist() {
for target in $TARGETS; do for target in $TARGETS; do
if [ -f $target/dist.sh ]; then if [ -f $target/dist.sh ]; then
build_rust_targets release ${TARGETS[*]}
cd $target && ./dist.sh cd $target && ./dist.sh
fi fi
done done

View File

@ -1,11 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
set -x
VERSION=`cat Cargo.toml | grep "^version =" | sed -r 's/^version = "(.+)"$/\1/'`
mkdir -p dist mkdir -p dist
cp dashboard.desktop dist cp dashboard.desktop dist
cp ../target/release/dashboard dist cp ../target/release/dashboard dist
strip dist/dashboard strip dist/dashboard
tar -cf dashboard.tgz dist/ tar -czf dashboard-${VERSION}.tgz dist/

View File

@ -9,5 +9,5 @@ cp ../target/release/file-service dist
cp ../target/release/auth-cli dist cp ../target/release/auth-cli dist
strip dist/file-service strip dist/file-service
strip dist/auth-cli strip dist/auth-cli
tar -cf file-service-${VERSION}.tar.gz dist/ tar -czf file-service-${VERSION}.tgz dist/

View File

@ -83,7 +83,6 @@ mod test {
let db = let db =
Database::open_path(PathBuf::from("fixtures/five_games/")).expect("database to open"); Database::open_path(PathBuf::from("fixtures/five_games/")).expect("database to open");
assert_eq!(db.all_games().count(), 5); assert_eq!(db.all_games().count(), 5);
for game in db.all_games() {}
assert_matches!(db.all_games().find(|g| g.info.black_player == Some("Steve".to_owned())), assert_matches!(db.all_games().find(|g| g.info.black_player == Some("Steve".to_owned())),
Some(game) => { Some(game) => {

View File

@ -185,7 +185,7 @@ mod test {
#[test] #[test]
fn current_player_changes_after_move() { fn current_player_changes_after_move() {
let mut state = GameState::new(); let mut state = GameState::default();
assert_eq!(state.current_player, Color::Black); assert_eq!(state.current_player, Color::Black);
state.place_stone(Coordinate { column: 9, row: 9 }).unwrap(); state.place_stone(Coordinate { column: 9, row: 9 }).unwrap();
assert_eq!(state.current_player, Color::White); assert_eq!(state.current_player, Color::White);
@ -193,7 +193,7 @@ mod test {
#[test] #[test]
fn current_player_remains_the_same_after_self_capture() { fn current_player_remains_the_same_after_self_capture() {
let mut state = GameState::new(); let mut state = GameState::default();
state.board = Board::from_coordinates( state.board = Board::from_coordinates(
vec![ vec![
(Coordinate { column: 17, row: 0 }, Color::White), (Coordinate { column: 17, row: 0 }, Color::White),
@ -214,7 +214,7 @@ mod test {
#[test] #[test]
fn ko_rules_are_enforced() { fn ko_rules_are_enforced() {
let mut state = GameState::new(); let mut state = GameState::default();
state.board = Board::from_coordinates( state.board = Board::from_coordinates(
vec![ vec![
(Coordinate { column: 7, row: 9 }, Color::White), (Coordinate { column: 7, row: 9 }, Color::White),