From 1b3e7ef7714cf7788591e4231f191fc139e840ee Mon Sep 17 00:00:00 2001 From: Nikita Pekin Date: Thu, 1 Dec 2016 01:43:41 -0500 Subject: [PATCH 1/3] chore: fix OS X CI builds Modify Travis CI config to install OpenSSL on OS X. Intended to fix Travis CI builds. --- .travis.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index ed76721..19afd3f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,13 @@ before_script: else export PATH=$HOME/Library/Python/2.7/bin:$PATH fi + - | + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + brew install openssl && \ + export OPENSSL_INCLUDE_DIR=`brew --prefix openssl`/include && \ + export OPENSSL_LIB_DIR=`brew --prefix openssl`/lib && \ + echo "Installed OpenSSL for OS X." + fi # the main build script: - | @@ -47,11 +54,16 @@ script: else travis-cargo bench fi && - travis-cargo --only stable doc + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + travis-cargo --only stable doc + fi after_success: # upload the documentation from the build with stable (automatically only - # actually runs from the master branch, not individual PRs) - - travis-cargo --only stable doc-upload + # actually runs from the master branch, not individual PRs), not on OS X. + - | + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + travis-cargo --only stable doc-upload + fi # measure code coverage and upload to coveralls.io (the verify argument # mitigates kcov crashes due to malformed debuginfo, at the cost of some # speed. ) From 7070f3c462741b011c523a2d109894748bb08a14 Mon Sep 17 00:00:00 2001 From: Nikita Pekin Date: Thu, 1 Dec 2016 04:50:05 -0500 Subject: [PATCH 2/3] chore: downgrade serde_xml Downgrade `serde_xml` to 0.8.1 because 0.9.0 introduced breaking changes which we cannot support yet. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 97b30c9..66e262d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ version = "0.8.19" [dependencies] log = "0.3.6" serde = "0.8.19" -serde_xml = "0.9.1" +serde_xml = "0.8.1" [dependencies.clippy] optional = true From e67d67392f7d073e653db12a0a9a2ba5728eb767 Mon Sep 17 00:00:00 2001 From: Nikita Pekin Date: Thu, 1 Dec 2016 04:50:44 -0500 Subject: [PATCH 3/3] test: add Plaintext deserialization test Add `Plaintext` deserialization test. --- src/model.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/model.rs b/src/model.rs index 443c641..f1e3371 100644 --- a/src/model.rs +++ b/src/model.rs @@ -27,7 +27,7 @@ include!(concat!(env!("OUT_DIR"), "/model.rs")); mod tests { use serde_xml::from_str; - use super::{Img, Infos, Pod, QueryResult, Subpod}; + use super::{Img, Infos, Plaintext, Pod, QueryResult, Subpod}; #[test] fn test_query_result_deserializer() { @@ -91,6 +91,12 @@ mod tests { from_str::(&s).unwrap(); } + #[test] + fn test_plaintext_deserializer() { + from_str::(&"<plaintext>pi</plaintext>".to_owned()).unwrap(); + from_str::<Option<Plaintext>>(&"<plaintext/>".to_owned()).unwrap(); + } + #[test] fn test_infos_deserializer() { let s = INFOS_STR.to_owned();