Skip to content

Commit

Permalink
Split up mio-using examples/tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ctz committed Mar 8, 2019
1 parent b3a06b9 commit 9ffc866
Show file tree
Hide file tree
Showing 25 changed files with 817 additions and 736 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Expand Up @@ -24,12 +24,11 @@ script:
- cargo build
- RUST_BACKTRACE=1 cargo test
- RUST_BACKTRACE=1 cargo test --all-features
- cargo test --release --no-run
- ./target/release/examples/bench
- ( cd rustls-mio && cargo test --release --no-run && ./target/release/examples/bench )
- ( cd rustls-mio && cargo test --all-features )
# - ( cd trytls && ./runme )
- ( cd bogo && ./runme )
- cargo build --no-default-features
- cargo test --no-default-features --no-run
- ( cd examples && cargo build --examples --all-features )
- if [[ "$COVERAGE" == "1" ]]; then ./admin/coverage ; fi
- if [[ "$COVERAGE" == "1" ]]; then coveralls-lcov final.info ; fi
14 changes: 13 additions & 1 deletion Cargo.toml
Expand Up @@ -26,6 +26,18 @@ quic = []

[dev-dependencies]
env_logger = "0.6.1"
regex = "1.0"
tempfile = "3.0"
webpki-roots = "0.16"

[[example]]
name = "bogo_shim"
path = "examples/internal/bogo_shim.rs"
required-features = ["dangerous_configuration", "quic"]

[[example]]
name = "trytls_shim"
path = "examples/internal/trytls_shim.rs"

[[example]]
name = "bench"
path = "examples/internal/bench.rs"
2 changes: 1 addition & 1 deletion admin/capture-certdata
Expand Up @@ -33,7 +33,7 @@ def extract_certs(line):

def collect(hostname):
subp = subprocess.Popen([
'./target/debug/examples/tlsclient',
'./rustls-mio/target/debug/examples/tlsclient',
'--verbose',
'--http',
hostname],
Expand Down
4 changes: 2 additions & 2 deletions admin/coverage
Expand Up @@ -68,11 +68,11 @@ run('rustls')
all_infos.append(lcov('rustls.info'))

cleanup()
for example in 'tlsclient tlsserver bench bogo_shim trytls_shim'.split():
for example in 'bench bogo_shim trytls_shim'.split():
rustc('--profile', 'dev', '--example', example)

# tests
for test in 'api badssl bugs client_suites curves errors features server_suites topsites'.split():
for test in 'api'.split():
rustc('--profile', 'dev', '--test', test)
run(test)

Expand Down
4 changes: 2 additions & 2 deletions admin/pull-usage
Expand Up @@ -4,13 +4,13 @@
set -e

awk 'BEGIN { take=1 }/```tlsclient/{take=0;print}take' < README.md > README.md.new
./target/debug/examples/tlsclient --help >> README.md.new
./rustls-mio/target/debug/examples/tlsclient --help >> README.md.new
awk '/^```tlsclient$/ {start=1;} start' < README.md > README.md.tmp
awk '/^```$/ {start=1;} start' < README.md.tmp >> README.md.new
mv README.md.new README.md

awk 'BEGIN { take=1 }/```tlsserver/{take=0;print}take' < README.md > README.md.new
./target/debug/examples/tlsserver --help >> README.md.new
./rustls-mio/target/debug/examples/tlsserver --help >> README.md.new
awk '/^```tlsserver$/ {start=1;} start' < README.md > README.md.tmp
awk '/^```$/ {start=1;} start' < README.md.tmp >> README.md.new
mv README.md.new README.md
Expand Down
1 change: 1 addition & 0 deletions examples/README.md
@@ -0,0 +1 @@
Find examples using mio in rustls-mio/examples.
Expand Up @@ -134,8 +134,8 @@ impl KeyType {

fn path_for(&self, part: &str) -> String {
match self {
KeyType::RSA => format!("test-ca/rsa/{}", part),
KeyType::ECDSA => format!("test-ca/ecdsa/{}", part),
KeyType::RSA => format!("../test-ca/rsa/{}", part),
KeyType::ECDSA => format!("../test-ca/ecdsa/{}", part),
}
}

Expand Down
File renamed without changes.
File renamed without changes.
19 changes: 4 additions & 15 deletions examples/Cargo.toml → rustls-mio/Cargo.toml
@@ -1,11 +1,11 @@
[package]
name = "rustls-examples"
name = "rustls-mio"
version = "0.15.1"
edition = "2018"
authors = ["Joseph Birr-Pixton <jpixton@gmail.com>"]
license = "Apache-2.0/ISC/MIT"
readme = "README.md"
description = "Rustls is a modern TLS library written in Rust."
description = "Rustls example code and tests that depend on mio."
homepage = "https://github.com/ctz/rustls"
repository = "https://github.com/ctz/rustls"
categories = ["network-programming", "cryptography"]
Expand All @@ -28,24 +28,13 @@ ct-logs = "0.5"
docopt = "1.0"
env_logger = "0.6"
mio = "0.6"
regex = "1.0"
serde = "1.0"
serde_derive = "1.0"
tempfile = "3.0"
vecio = "0.1"
webpki-roots = "0.16"

[[example]]
name = "bogo_shim"
path = "examples/internal/bogo_shim.rs"
required-features = ["dangerous_configuration", "quic"]

[[example]]
name = "trytls_shim"
path = "examples/internal/trytls_shim.rs"

[[example]]
name = "bench"
path = "examples/internal/bench.rs"

[[example]]
name = "tlsclient"
path = "examples/tlsclient.rs"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 9ffc866

Please sign in to comment.