1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-25 11:01:14 +00:00

add optional skeptic

This commit is contained in:
Nikolay Kim 2017-10-26 06:12:23 -07:00
parent 86583049fa
commit 488fb256b4
6 changed files with 31 additions and 20 deletions

View file

@ -7,9 +7,11 @@ readme = "README.md"
keywords = ["actor", "http", "web"]
homepage = "https://github.com/actix/actix-web"
repository = "https://github.com/actix/actix-web.git"
documentation = "https://docs.rs/actix-web/"
categories = ["network-programming", "asynchronous"]
license = "Apache-2.0"
exclude = [".gitignore", ".travis.yml", ".cargo/config", "appveyor.yml"]
build = "build.rs"
[badges]
travis-ci = { repository = "actix/actix-web", branch = "master" }
@ -58,6 +60,10 @@ features = []
[dev-dependencies]
env_logger = "0.4"
reqwest = "0.8"
skeptic = "0.13"
[build-dependencies]
skeptic = "0.13"
[profile.release]
lto = true

View file

@ -10,6 +10,9 @@ build:
test: build clippy
cargo test $(CARGO_FLAGS)
skeptic:
USE_SKEPTIC=1 cargo test $(CARGO_FLAGS)
# cd examples/word-count && python setup.py install && pytest -v tests
clippy:
@ -17,22 +20,3 @@ clippy:
doc: build
cargo doc --no-deps $(CARGO_FLAGS)
clean:
rm -r target
gh-pages:
git clone --branch gh-pages git@github.com:fafhrd91/ctx.git gh-pages
.PHONY: gh-pages-doc
gh-pages-doc: doc | gh-pages
cd gh-pages && git pull
rm -r gh-pages/doc
cp -r target/doc gh-pages/
rm gh-pages/doc/.lock
cd gh-pages && git add .
cd gh-pages && git commit -m "Update documentation"
publish: default gh-pages-doc
cargo publish
cd gh-pages && git push

View file

@ -110,6 +110,7 @@ fn main() {
.serve::<_, ()>("127.0.0.1:8080").unwrap();
println!("Started http server: 127.0.0.1:8080");
Arbiter::system().send(msgs::SystemExit(0));
let _ = sys.run();
}
```

18
build.rs Normal file
View file

@ -0,0 +1,18 @@
extern crate skeptic;
use std::{env, fs};
#[cfg(unix)]
fn main() {
if env::var("USE_SKEPTIC").is_ok() {
// generates doc tests for `README.md`.
skeptic::generate_doc_tests(&["README.md"]);
} else {
let f = env::var("OUT_DIR").unwrap() + "/skeptic-tests.rs";
let _ = fs::File::create(f);
}
}
#[cfg(not(unix))]
fn main() {
}

View file

@ -44,7 +44,7 @@ fn main() {
.body(Body::Empty)
}))
// static files
.route_handler("/static", StaticFiles::new("static/", true)))
.route_handler("/static", StaticFiles::new("examples/static/", true)))
.serve::<_, ()>("127.0.0.1:8080").unwrap();
println!("Started http server: 127.0.0.1:8080");

2
tests/skeptic.rs Normal file
View file

@ -0,0 +1,2 @@
#[cfg(unix)]
include!(concat!(env!("OUT_DIR"), "/skeptic-tests.rs"));