Update Travis to use travis-cargo

This commit is contained in:
Andrew Poelstra 2015-07-28 12:38:01 -05:00
parent 77f6b6bf21
commit 8d6f384dac
4 changed files with 32 additions and 7 deletions

View File

@ -1,8 +1,25 @@
language: rust
matrix:
include:
- rust: stable
- rust: beta
- rust: nightly
install:
- git clone https://github.com/bitcoin/secp256k1.git
- cd secp256k1
- ./autogen.sh && ./configure && make && sudo make install
- sudo ldconfig /usr/local/lib
- cd ..
- |
pip install 'travis-cargo<0.2' --user &&
export PATH=$HOME/.local/bin:$PATH
script:
- |
travis-cargo build &&
travis-cargo test &&
travis-cargo bench &&
travis-cargo --only stable doc

View File

@ -16,6 +16,9 @@ readme = "README.md"
name = "secp256k1"
path = "src/lib.rs"
[features]
unstable = []
[dependencies]
arrayvec = "0.3"
rand = "0.3"

View File

@ -34,7 +34,7 @@ pub type NonceFn = unsafe extern "C" fn(nonce32: *mut c_uchar,
attempt: c_uint,
data: *const c_void);
#[repr(C)] struct ContextInner;
#[repr(C)] struct ContextInner(c_int);
/// A Secp256k1 context, containing various precomputed values and such
/// needed to do elliptic curve computations. If you create one of these

View File

@ -25,9 +25,6 @@
#![crate_type = "dylib"]
#![crate_name = "secp256k1"]
// Keep this until 1.0 I guess; it's needed for `black_box` at least
#![cfg_attr(test, feature(test))]
// Coding conventions
#![deny(non_upper_case_globals)]
#![deny(non_camel_case_types)]
@ -35,10 +32,12 @@
#![deny(unused_mut)]
#![warn(missing_docs)]
#![cfg_attr(all(test, feature = "unstable"), feature(test))]
#[cfg(all(test, feature = "unstable"))] extern crate test;
extern crate arrayvec;
extern crate rustc_serialize as serialize;
extern crate serde;
#[cfg(test)] extern crate test;
extern crate libc;
extern crate rand;
@ -369,8 +368,6 @@ impl Secp256k1 {
mod tests {
use rand::{Rng, thread_rng};
use test::{Bencher, black_box};
use key::{SecretKey, PublicKey};
use super::constants;
use super::{Secp256k1, Signature, Message, RecoveryId, ContextFlag};
@ -614,6 +611,14 @@ mod tests {
25, 26, 27, 28, 29, 30, 31, 255]);
assert_eq!(&format!("{:?}", msg), "Message(0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1fff)");
}
}
#[cfg(all(test, feature = "unstable"))]
mod benches {
use rand::{Rng, thread_rng};
use test::{Bencher, black_box};
use super::{Secp256k1, Message};
#[bench]
pub fn generate(bh: &mut Bencher) {