summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2017-02-02 20:50:48 -0800
committerJoe Wilm <jwilm@users.noreply.github.com>2017-02-03 08:11:19 -0800
commitf2f750f9f3688e20d44bf43e6c0f568cf86edaa5 (patch)
tree176fa38cfe17e3b63e0df0dc3f9a14ce0db0d510
parent875167a51006944da1a397fd0131b9aa69bf9a02 (diff)
Alacritty now compiles on stable Rust :tada:
-rw-r--r--.travis.yml2
-rw-r--r--Cargo.lock30
-rw-r--r--Cargo.toml9
-rw-r--r--README.md11
-rw-r--r--font/src/lib.rs8
-rw-r--r--rustc-version1
-rw-r--r--src/config.rs2
-rw-r--r--src/term/cell.rs2
-rw-r--r--src/term/mod.rs3
-rw-r--r--src/tty.rs3
-rw-r--r--tests/ref.rs48
11 files changed, 34 insertions, 85 deletions
diff --git a/.travis.yml b/.travis.yml
index db9051ab..df3abc19 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,7 +8,7 @@ os:
- osx
rust:
- - nightly
+ - stable
script:
- cargo test --no-default-features
diff --git a/Cargo.lock b/Cargo.lock
index dba08302..17dcc644 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -18,7 +18,6 @@ dependencies = [
"mio 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"notify 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-test 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -356,11 +355,6 @@ dependencies = [
]
[[package]]
-name = "getopts"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
name = "gl_generator"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -824,18 +818,6 @@ version = "0.3.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
-name = "rustc-test"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
- "term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
name = "rustc_version"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1015,15 +997,6 @@ dependencies = [
]
[[package]]
-name = "term"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
name = "term_size"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1254,7 +1227,6 @@ dependencies = [
"checksum fsevent-sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "72e33a926306442d961595c3a325864326ca4287795e106dae8993afe484ede6"
"checksum gcc 0.3.41 (registry+https://github.com/rust-lang/crates.io-index)" = "3689e1982a563af74960ae3a4758aa632bb8fd984cfc3cc3b60ee6109477ab6e"
"checksum gdi32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "65256ec4dc2592e6f05bfc1ca3b956a4e0698aa90b1dff1f5687d55a5a3fd59a"
-"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685"
"checksum gl_generator 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1d8edc81c5ae84605a62f5dac661a2313003b26d59839f81d47d46cf0f16a55"
"checksum gleam 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3023edde169b7767a71d2e5dd8e8903ac3b1436ff659225310928db87d6a8a"
"checksum glutin 0.6.1 (git+https://github.com/jwilm/glutin?rev=af7fe340bd4a2af53ea521defcb4f377cdc588cf)" = "<none>"
@@ -1308,7 +1280,6 @@ dependencies = [
"checksum redox_syscall 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "8dd35cc9a8bdec562c757e3d43c1526b5c6d2653e23e2315065bc25556550753"
"checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957"
"checksum rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "237546c689f20bb44980270c73c3b9edd0891c1be49cc1274406134a66d3957b"
-"checksum rustc-test 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5a8a7c2bc3cd2df4e0da9e548cd1b50c4c7b68d72410d34eba98a2d5393a2875"
"checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084"
"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac"
"checksum semver 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d5b7638a1f03815d94e88cb3b3c08e87f0db4d683ef499d1836aaf70a45623f"
@@ -1332,7 +1303,6 @@ dependencies = [
"checksum syn 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f4f94368aae82bb29656c98443a7026ca931a659e8d19dcdc41d6e273054e820"
"checksum target_build_utils 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "54c550e226618cd35334b75e92bfa5437c61474bdb75c38bf330ab5a8037b77c"
"checksum tempfile 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3213fd2b7ed87e39306737ccfac04b1233b57a33ca64cfbf52f2ffaa2b765e2f"
-"checksum term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3deff8a2b3b6607d6d7cc32ac25c0b33709453ca9cceac006caac51e963cf94a"
"checksum term_size 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f7f5f3f71b0040cecc71af239414c23fd3c73570f5ff54cf50e03cef637f2a0"
"checksum time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "211b63c112206356ef1ff9b19355f43740fc3f85960c598a93d3a3d3ba7beade"
"checksum toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "0590d72182e50e879c4da3b11c6488dae18fccb1ae0c7a3eda18e16795844796"
diff --git a/Cargo.toml b/Cargo.toml
index f7bbb161..fa09a27f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,10 +11,6 @@ doc = false
path = "src/main.rs"
name = "alacritty"
-[[test]]
-name = "ref"
-harness = false
-
[dependencies]
libc = "*"
cgmath = "0.7"
@@ -23,7 +19,7 @@ bitflags = "*"
font = { path = "./font" }
errno = "0.1.6"
lazy_static = "0.2.2"
-parking_lot = { version = "0.3.1", features = ["nightly"] }
+parking_lot = "0.3.1"
serde = "0.9"
serde_yaml = "0.6"
serde_derive = "0.9"
@@ -52,9 +48,6 @@ gl_generator = "0.5"
git = "https://github.com/jwilm/glutin"
rev = "af7fe340bd4a2af53ea521defcb4f377cdc588cf"
-[dev-dependencies]
-rustc-test = { version = "0.1", features = ["capture"] }
-
[profile.release]
lto = true
debug = true
diff --git a/README.md b/README.md
index 1b5de7b9..dd15302b 100644
--- a/README.md
+++ b/README.md
@@ -55,16 +55,11 @@ makepkg -isr
cd alacritty
```
-3. Make sure you have the right Rust compiler installed. Alacritty requires nightly Rust. Run
+3. Make sure you have the right Rust compiler installed. Alacritty requires at least 1.15. Run
```sh
- rustup override set nightly
- ```
-
- If you run into problems, you can try a known-good version of the compiler by running
-
- ```sh
- rustup override set $(<rustc-version)
+ rustup override set stable
+ rustup update stable
```
#### Ubuntu
diff --git a/font/src/lib.rs b/font/src/lib.rs
index c5c0a2c7..7b8d92e7 100644
--- a/font/src/lib.rs
+++ b/font/src/lib.rs
@@ -17,8 +17,6 @@
//! CoreText is used on Mac OS.
//! FreeType is used on everything that's not Mac OS.
//! Eventually, ClearType support will be available for windows
-#![feature(integer_atomics)]
-
#[cfg(not(target_os = "macos"))]
extern crate fontconfig;
#[cfg(not(target_os = "macos"))]
@@ -44,7 +42,7 @@ extern crate log;
use std::hash::{Hash, Hasher};
use std::fmt;
-use std::sync::atomic::{AtomicU16, ATOMIC_U16_INIT, Ordering};
+use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
// If target isn't macos, reexport everything from ft
#[cfg(not(target_os = "macos"))]
@@ -123,10 +121,10 @@ impl FontKey {
///
/// The generated key will be globally unique
pub fn next() -> FontKey {
- static TOKEN: AtomicU16 = ATOMIC_U16_INIT;
+ static TOKEN: AtomicUsize = ATOMIC_USIZE_INIT;
FontKey {
- token: TOKEN.fetch_add(1, Ordering::SeqCst),
+ token: TOKEN.fetch_add(1, Ordering::SeqCst) as _,
}
}
}
diff --git a/rustc-version b/rustc-version
deleted file mode 100644
index 144295f6..00000000
--- a/rustc-version
+++ /dev/null
@@ -1 +0,0 @@
-nightly-2017-01-15
diff --git a/src/config.rs b/src/config.rs
index b8768c01..05147631 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -1314,8 +1314,6 @@ mod tests {
// Sanity check that key bindings are being parsed
assert!(config.key_bindings.len() >= 1);
-
- println!("config: {:#?}", config);
}
#[test]
diff --git a/src/term/cell.rs b/src/term/cell.rs
index e6e9f340..2cbdf14b 100644
--- a/src/term/cell.rs
+++ b/src/term/cell.rs
@@ -124,7 +124,7 @@ mod tests {
}
}
-#[cfg(test)]
+#[cfg(all(test, feature = "bench"))]
mod benches {
extern crate test;
use super::Cell;
diff --git a/src/term/mod.rs b/src/term/mod.rs
index 3cf06b2c..e4c64fa5 100644
--- a/src/term/mod.rs
+++ b/src/term/mod.rs
@@ -1264,7 +1264,6 @@ impl ansi::Handler for Term {
#[cfg(test)]
mod tests {
extern crate serde_json;
- extern crate test;
use super::{Term, limit, SizeInfo};
@@ -1314,7 +1313,7 @@ mod tests {
}
}
-#[cfg(test)]
+#[cfg(all(test, feature = "bench"))]
mod benches {
extern crate test;
extern crate serde_json as json;
diff --git a/src/tty.rs b/src/tty.rs
index 4fcf065f..ca5fad78 100644
--- a/src/tty.rs
+++ b/src/tty.rs
@@ -329,6 +329,5 @@ unsafe fn set_nonblocking(fd: c_int) {
#[test]
fn test_get_pw_entry() {
let mut buf: [i8; 1024] = [0; 1024];
- let pw = get_pw_entry(&mut buf);
- println!("{:?}", pw);
+ let _pw = get_pw_entry(&mut buf);
}
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>