Clean up our feature story and more aggressively test features.
parent
3029341d5a
commit
8b6050f711
28
.travis.yml
28
.travis.yml
|
@ -1,35 +1,37 @@
|
|||
language: rust
|
||||
matrix:
|
||||
include:
|
||||
# litmus check that we work on stable/beta
|
||||
# we don't, not until slice_rotate lands
|
||||
### Litmus check that we work on stable/beta
|
||||
# (we don't, not until slice_rotate lands)
|
||||
# - rust: stable
|
||||
# env: FEATURES='default' MODE='test'
|
||||
# - rust: beta
|
||||
# env: FEATURES='default' MODE='test'
|
||||
# actually test everything
|
||||
### Test default configurations
|
||||
- rust: nightly
|
||||
env: FEATURES='default' MODE='test'
|
||||
- rust: nightly
|
||||
env: FEATURES='default proto-ipv6' MODE='test'
|
||||
### Test select feature permutations, chosen to be as orthogonal as possible
|
||||
- rust: nightly
|
||||
env: FEATURES='phy-raw_socket socket-udp' MODE='build'
|
||||
env: FEATURES='std phy-raw_socket socket-udp' MODE='test'
|
||||
- rust: nightly
|
||||
env: FEATURES='phy-tap_interface socket-udp' MODE='build'
|
||||
env: FEATURES='std phy-tap_interface socket-udp' MODE='test'
|
||||
- rust: nightly
|
||||
env: FEATURES='socket-raw' MODE='build'
|
||||
env: FEATURES='std socket-raw' MODE='test'
|
||||
- rust: nightly
|
||||
env: FEATURES='socket-udp' MODE='build'
|
||||
env: FEATURES='std socket-udp' MODE='test'
|
||||
- rust: nightly
|
||||
env: FEATURES='socket-tcp' MODE='build'
|
||||
env: FEATURES='std socket-tcp' MODE='test'
|
||||
- rust: nightly
|
||||
env: FEATURES='socket-icmp' MODE='build'
|
||||
env: FEATURES='std socket-icmp' MODE='test'
|
||||
### Test select feature permutations, chosen to be as aggressive as possible
|
||||
- rust: nightly
|
||||
env: FEATURES='socket-raw socket-udp socket-tcp socket-icmp std' MODE='test'
|
||||
- rust: nightly
|
||||
env: FEATURES='socket-raw socket-udp socket-tcp socket-icmp alloc' MODE='test'
|
||||
- rust: nightly
|
||||
env: FEATURES='socket-raw socket-udp socket-tcp socket-icmp' MODE='build'
|
||||
- rust: nightly
|
||||
env: FEATURES='socket-raw socket-udp socket-tcp socket-icmp std' MODE='build'
|
||||
- rust: nightly
|
||||
env: FEATURES='socket-raw socket-udp socket-tcp socket-icmp alloc' MODE='build'
|
||||
script:
|
||||
- cargo "$MODE" --no-default-features --features "$FEATURES"
|
||||
notifications:
|
||||
|
|
18
Cargo.toml
18
Cargo.toml
|
@ -48,18 +48,24 @@ default = [
|
|||
|
||||
[[example]]
|
||||
name = "tcpdump"
|
||||
|
||||
[[example]]
|
||||
name = "server"
|
||||
|
||||
[[example]]
|
||||
name = "client"
|
||||
required-features = ["std", "phy-raw_socket"]
|
||||
|
||||
[[example]]
|
||||
name = "httpclient"
|
||||
required-features = ["std", "phy-tap_interface", "proto-ipv4", "socket-tcp"]
|
||||
|
||||
[[example]]
|
||||
name = "ping"
|
||||
required-features = ["std", "phy-tap_interface", "proto-ipv4", "socket-icmp"]
|
||||
|
||||
[[example]]
|
||||
name = "server"
|
||||
required-features = ["std", "phy-tap_interface", "proto-ipv4", "socket-tcp", "socket-udp"]
|
||||
|
||||
[[example]]
|
||||
name = "client"
|
||||
required-features = ["std", "phy-tap_interface", "proto-ipv4", "socket-tcp", "socket-udp"]
|
||||
|
||||
[[example]]
|
||||
name = "loopback"
|
||||
required-features = ["alloc", "proto-ipv4"]
|
||||
|
|
|
@ -303,12 +303,12 @@ that do. Because of this, only one such example is provided.
|
|||
### examples/loopback.rs
|
||||
|
||||
_examples/loopback.rs_ sets up _smoltcp_ to talk with itself via a loopback interface.
|
||||
Although it does not require `std`, this example still requires the `collections` feature to run.
|
||||
Although it does not require `std`, this example still requires the `alloc` feature to run.
|
||||
|
||||
Read its [source code](/examples/loopback.rs), then run it without `std`:
|
||||
|
||||
```sh
|
||||
cargo run --example loopback --no-default-features --features collections
|
||||
cargo run --example loopback --no-default-features --features alloc
|
||||
```
|
||||
|
||||
... or with `std`:
|
||||
|
|
|
@ -912,6 +912,7 @@ mod test {
|
|||
use wire::{IpAddress, IpCidr, IpProtocol, IpRepr};
|
||||
use wire::{Ipv4Address, Ipv4Repr};
|
||||
use wire::{Icmpv4Repr, Icmpv4DstUnreachable};
|
||||
#[cfg(feature = "socket-udp")]
|
||||
use wire::{UdpPacket, UdpRepr};
|
||||
|
||||
use super::Packet;
|
||||
|
@ -1039,6 +1040,7 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "socket-udp")]
|
||||
fn test_icmp_error_port_unreachable() {
|
||||
static UDP_PAYLOAD: [u8; 12] = [
|
||||
0x48, 0x65, 0x6c, 0x6c,
|
||||
|
|
|
@ -84,6 +84,7 @@ extern crate libc;
|
|||
#[cfg(feature = "alloc")]
|
||||
extern crate alloc;
|
||||
#[cfg(any(test, feature = "log"))]
|
||||
#[allow(unused_imports)]
|
||||
#[macro_use(log, trace, debug)]
|
||||
extern crate log;
|
||||
|
||||
|
|
Loading…
Reference in New Issue