Skip to content

Commit

Permalink
Run sample bin in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
passcod committed Apr 25, 2018
1 parent 7a40d29 commit f196996
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ test_script:
cargo test --target %TARGET% -p notify-backend --release
)

# cargo run

# cargo test --target %TARGET% -p notify-backend-winapi &&
# cargo test --target %TARGET% -p notify-backend-winapi --release
# cargo test --target %TARGET% -p notify-backend-poll-tree &&
Expand Down
1 change: 1 addition & 0 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ main() {
echo bothx test -p notify-backend-fsevents
elif [[ "$TARGET" =~ -linux- ]]; then
bothx test -p notify-backend-inotify
bothx run $(pwd)/CONTRIBUTING.md
fi
}

Expand Down
20 changes: 15 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extern crate notify;
extern crate tokio;

use notify::manager::Manager;
use std::path::PathBuf;
use std::{env, path::PathBuf};
use tokio::reactor::Handle;

fn main() {
Expand All @@ -19,12 +19,22 @@ fn main() {
println!(" backend can: {:?}", life.capabilities());
}

let path: PathBuf = "/opt/notify-test".into();
println!("Let us bind to {:?}", path);
man.bind(vec![path]).unwrap();
let mut args: Vec<String> = env::args().skip(1).collect();
println!("Retrieved command arguments: {:?}", args);

if args.len() == 0 {
args.push("/opt/notify-test".into());
println!("No paths given, adding default path");
}

let paths: Vec<PathBuf> = args.iter().map(|s| s.into()).collect();
println!("Converted args to paths: {:?}", paths);

man.bind(paths).unwrap();
println!("Manager bound: {:?}", man);

let life = man.active().unwrap();
println!("Bound {:?}", life);
println!("Life bound: {:?}", life);

// println!("Handle the backend stream");
// let b = life.backend().unwrap();
Expand Down

0 comments on commit f196996

Please sign in to comment.