Skip to content

Commit

Permalink
Merge pull request #1026 from smoltcp-rs/netsim
Browse files Browse the repository at this point in the history
tcp: add netsim test
  • Loading branch information
Dirbaio authored Mar 2, 2025
2 parents 2e9a30a + ab61335 commit f75e342
Show file tree
Hide file tree
Showing 6 changed files with 1,005 additions and 52 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Test
jobs:
tests:
runs-on: ubuntu-22.04
needs: [check-msrv, test-msrv, test-stable, clippy]
needs: [check-msrv, test-msrv, test-stable, clippy, test-netsim]
steps:
- name: Done
run: exit 0
Expand Down Expand Up @@ -48,6 +48,14 @@ jobs:
- name: Run Tests nightly
run: ./ci.sh test nightly

test-netsim:
runs-on: ubuntu-22.04
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Run network-simulation tests
run: ./ci.sh netsim

test-build-16bit:
runs-on: ubuntu-22.04
continue-on-error: true
Expand Down
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ getopts = "0.2"
rand = "0.8"
url = "2.0"
rstest = "0.17"
insta = "1.41.1"
rand_chacha = "0.3.1"

[features]
std = ["managed/std", "alloc"]
Expand Down Expand Up @@ -109,6 +111,8 @@ default = [

"_proto-fragmentation" = []

"_netsim" = []

# BEGIN AUTOGENERATED CONFIG FEATURES
# Generated by gen_config.py. DO NOT EDIT.
iface-max-addr-count-1 = []
Expand Down Expand Up @@ -267,6 +271,10 @@ rpl-parents-buffer-count-32 = []

# END AUTOGENERATED CONFIG FEATURES

[[test]]
name = "netsim"
required-features = ["_netsim"]

[[example]]
name = "packet2pcap"
path = "utils/packet2pcap.rs"
Expand Down
8 changes: 8 additions & 0 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ test() {
fi
}

netsim() {
cargo test --release --features _netsim netsim
}

check() {
local version=$1
rustup toolchain install $version
Expand Down Expand Up @@ -139,3 +143,7 @@ fi
if [[ $1 == "coverage" || $1 == "all" ]]; then
coverage
fi

if [[ $1 == "netsim" || $1 == "all" ]]; then
netsim
fi
Loading

0 comments on commit f75e342

Please sign in to comment.