Skip to content

Commit

Permalink
doc: add comments to .github/test.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
dj8yf0μl committed Mar 25, 2024
1 parent 82575d1 commit db870ac
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
35 changes: 29 additions & 6 deletions .github/test.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,54 @@
#!/usr/bin/env bash

# NOTE: `cargo test [TESTNAME]` is used to filter only the submodule with tests to test a
# specific feature or features' combination
# e.g. `cargo test --features rc,unstable__schema 'schema::test_rc'` is used to test `BorshSchema`
# implementation of `std::rc::Rc` and `std::sync::Arc`,
# where `[TESTNAME]` argument is set to `schema::test_rc`, which filters out tests from `schema::test_rc`
# submodule of `borsh/tests/tests.rs`
set -e
set -x
export INSTA_UPDATE=no
pushd borsh
############################ borsh `default-features = true` group #########################
########## general group
cargo test --no-run
cargo test
cargo test --features derive
cargo test --features unstable__schema
########## features = ["ascii"] group
cargo test --features ascii 'roundtrip::test_ascii_strings'
cargo test --features ascii 'deserialization_errors::test_ascii_strings'
cargo test --features ascii,unstable__schema 'schema::test_ascii_strings'
cargo test --features derive
cargo test --features unstable__schema
########## features = ["rc"] group
cargo test --features rc 'roundtrip::test_rc'
cargo test --features rc,unstable__schema 'schema::test_rc'
########## features = ["de_strict_order"] group
cargo test --features de_strict_order 'roundtrip::test_hash_map'
cargo test --features de_strict_order 'roundtrip::test_btree_map'
cargo test --features derive,bson 'roundtrip::requires_derive_category::test_bson_object_ids'
cargo test --features derive,bytes 'roundtrip::requires_derive_category::test_ultimate_many_features_combined'
########## features = ["bson"] group
cargo test --features bson,derive 'roundtrip::requires_derive_category::test_bson_object_ids'
########## features = ["bytes"] group
cargo test --features bytes,derive 'roundtrip::requires_derive_category::test_ultimate_many_features_combined'


############################ borsh `default-features = false` group #########################
########## general group
cargo test --no-default-features
cargo test --no-default-features --features derive
cargo test --no-default-features --features unstable__schema
########## features = ["ascii"] group
cargo test --no-default-features --features ascii 'roundtrip::test_ascii_strings'
cargo test --no-default-features --features ascii 'deserialization_errors::test_ascii_strings'
cargo test --no-default-features --features ascii,unstable__schema 'schema::test_ascii_strings'
cargo test --no-default-features --features derive
cargo test --no-default-features --features unstable__schema
########## features = ["rc"] group
cargo test --no-default-features --features rc 'roundtrip::test_rc'
cargo test --no-default-features --features rc,unstable__schema 'schema::test_rc'
########## features = ["hashbrown"] group
cargo test --no-default-features --features hashbrown
cargo test --no-default-features --features hashbrown,derive
cargo test --no-default-features --features hashbrown,unstable__schema
popd
pushd borsh-derive
############################ borsh-derive group #########################
cargo test --features schema
3 changes: 3 additions & 0 deletions borsh/tests/compile_derives/test_generic_enums.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use borsh::{BorshDeserialize, BorshSerialize};

#[allow(unused)]
use alloc::{string::String, vec::Vec};

#[cfg(feature = "hashbrown")]
use hashbrown::HashMap;

Expand Down

0 comments on commit db870ac

Please sign in to comment.