summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml28
-rw-r--r--dhall/Cargo.toml3
-rw-r--r--dhall/tests/common/mod.rs26
3 files changed, 46 insertions, 11 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..6106df1
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,28 @@
+language: rust
+sudo: required
+dist: trusty
+addons:
+ apt:
+ packages:
+ - libssl-dev
+cache: cargo
+rust:
+ - nightly
+
+before_cache: |
+ # RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin -f
+
+install:
+- cargo build --release --all --all-features
+
+script:
+- cargo test --release --all --all-features
+
+after_success: |
+ # Uncomment the following line for coveralls.io
+ # cargo tarpaulin --ciserver travis-ci --coveralls $TRAVIS_JOB_ID
+
+ # Uncomment the following two lines create and upload a report for codecov.io
+ # cargo tarpaulin --out Xml
+ # bash <(curl -s https://codecov.io/bash)
+
diff --git a/dhall/Cargo.toml b/dhall/Cargo.toml
index fd462b1..3c3e375 100644
--- a/dhall/Cargo.toml
+++ b/dhall/Cargo.toml
@@ -7,6 +7,9 @@ edition = "2018"
[lib]
doctest = false
+[features]
+nothreads = [] # disable threads for tarpaulin
+
[dependencies]
bytecount = "0.5.1"
itertools = "0.8.0"
diff --git a/dhall/tests/common/mod.rs b/dhall/tests/common/mod.rs
index 0589a4a..d18b4bf 100644
--- a/dhall/tests/common/mod.rs
+++ b/dhall/tests/common/mod.rs
@@ -24,18 +24,22 @@ macro_rules! make_spec_test {
#[allow(non_snake_case)]
fn $name() {
use crate::common::*;
- use std::thread;
- // The parser stack overflows even on small files
- // when compiled without optimizations
- thread::Builder::new()
- .stack_size(4 * 1024 * 1024)
- .spawn(move || {
- run_test($path, Feature::$type);
- })
- .unwrap()
- .join()
- .unwrap();
+ if cfg!(feature="nothreads") {
+ run_test($path, Feature::$type);
+ } else {
+ use std::thread;
+ // The parser stack overflows even on small files
+ // when compiled without optimizations
+ thread::Builder::new()
+ .stack_size(4 * 1024 * 1024)
+ .spawn(move || {
+ run_test($path, Feature::$type);
+ })
+ .unwrap()
+ .join()
+ .unwrap();
+ }
}
};
}