-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from killercup/feature/tests
Run Tests on Travis
- Loading branch information
Showing
20 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
[*.rs] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
[*.toml] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
language: rust | ||
rust: | ||
- nightly-2016-04-11 | ||
- nightly | ||
matrix: | ||
allow_failures: | ||
- rust: nightly | ||
before_script: | ||
- | | ||
pip install 'travis-cargo<0.2' --user && | ||
export PATH=$HOME/.local/bin:$PATH | ||
script: | ||
- | | ||
travis-cargo build && | ||
env RUST_SYSROOT=$HOME/rust RUST_TEST_NOCAPTURE=1 travis-cargo test | ||
notifications: | ||
email: | ||
on_success: never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
use std::{env, fs}; | ||
use std::process::{Command, Output}; | ||
|
||
fn run_miri(file: &str, sysroot: &str) -> Output { | ||
Command::new("cargo") | ||
.args(&["run", "--", "--sysroot", sysroot, file]) | ||
.output() | ||
.unwrap_or_else(|e| panic!("failed to execute process: {}", e)) | ||
} | ||
|
||
#[test] | ||
fn run_pass() { | ||
let sysroot = env::var("RUST_SYSROOT").expect("env variable `RUST_SYSROOT` not set"); | ||
|
||
let test_files = fs::read_dir("./tests/run-pass/") | ||
.expect("Can't read `run-pass` directory") | ||
.filter_map(|entry| entry.ok()) | ||
.filter(|entry| { | ||
entry.clone() | ||
.file_type() | ||
.map(|x| x.is_file()) | ||
.unwrap_or(false) | ||
}) | ||
.filter_map(|entry| entry.path().to_str().map(|x| x.to_string())); | ||
|
||
for file in test_files { | ||
println!("{}: compile test running", file); | ||
|
||
let test_run = run_miri(&file, &sysroot); | ||
|
||
if test_run.status.code().unwrap_or(-1) != 0 { | ||
println!("{}: error {:?}", file, test_run); | ||
} else { | ||
println!("{}: ok", file); | ||
} | ||
} | ||
} |
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.
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.
File renamed without changes.