diff options
author | Joe Wilm <joe@jwilm.com> | 2017-02-02 20:50:48 -0800 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-02-03 08:11:19 -0800 |
commit | f2f750f9f3688e20d44bf43e6c0f568cf86edaa5 (patch) | |
tree | 176fa38cfe17e3b63e0df0dc3f9a14ce0db0d510 /tests | |
parent | 875167a51006944da1a397fd0131b9aa69bf9a02 (diff) | |
download | alacritty-f2f750f9f3688e20d44bf43e6c0f568cf86edaa5.tar.gz alacritty-f2f750f9f3688e20d44bf43e6c0f568cf86edaa5.zip |
Alacritty now compiles on stable Rust :tada:
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ref.rs | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/tests/ref.rs b/tests/ref.rs index b8be58cf..66bbfe95 100644 --- a/tests/ref.rs +++ b/tests/ref.rs @@ -1,12 +1,9 @@ extern crate alacritty; extern crate serde_json as json; -extern crate test; -use std::env; use std::fs::File; use std::io::{self, Read}; -use std::path::{Path, PathBuf}; -use test::{TestDescAndFn, TestDesc, TestFn, ShouldPanic, TestName, test_main}; +use std::path::Path; use alacritty::Grid; use alacritty::Term; @@ -14,29 +11,30 @@ use alacritty::term::Cell; use alacritty::term::SizeInfo; use alacritty::ansi; -fn main() { - let test_dir = Path::new(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/ref")); - - let args = env::args().collect::<Vec<_>>(); - - let tests = test_dir - .read_dir() - .unwrap() - .map(|e| desc(e.unwrap().path())) - .collect(); - - test_main(&args, tests); +macro_rules! ref_tests { + ($($name:ident,)*) => { + ref_tests!($($name),*); + }; + ($($name:ident),*) => { + $( + #[test] + fn $name() { + let test_dir = Path::new(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/ref")); + let test_path = test_dir.join(stringify!($name)); + ref_test(&test_path); + } + )* + } } -fn desc(dir: PathBuf) -> TestDescAndFn { - TestDescAndFn { - desc: TestDesc { - name: TestName::DynTestName(dir.file_name().unwrap().to_string_lossy().into_owned()), - ignore: false, - should_panic: ShouldPanic::No, - }, - testfn: TestFn::dyn_test_fn(move || ref_test(&dir)), - } +ref_tests! { + fish_cc, + indexed_256_colors, + ll, + tmux_git_log, + tmux_htop, + vim_large_window_scroll, + vim_simple_edit, } fn read_u8<P>(path: P) -> Vec<u8> |