diff --git a/Cargo.toml b/Cargo.toml index 1752cf6c..b2c34c65 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ name = "google_speech" version = "0.1.0" authors = ["Uttarayan Mondal "] edition = "2018" +build = "build.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/build.rs b/build.rs new file mode 100644 index 00000000..7c5d61b3 --- /dev/null +++ b/build.rs @@ -0,0 +1,3 @@ +// OUT_DIR is only defined when there is a build script +// https://github.com/rust-lang/cargo/issues/879#issuecomment-215491052 +pub fn main() {} diff --git a/tests/tests.rs b/tests/tests.rs index bc4c2528..98247b27 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -8,7 +8,7 @@ fn test_hello_play() { #[test] fn test_hello_save() { let hello = Speech::new("Hello", Lang::en_us).unwrap(); - unsafe { hello.save("target/hello.mp3").unwrap() }; + unsafe { hello.save(concat!(env!("OUT_DIR"), "/hello.mp3")).unwrap() }; } // #[test]