Update the build script

This commit is contained in:
Uttarayan Mondal
2021-06-02 13:45:33 +05:30
parent 2ef4802862
commit cd7322bbf2
3 changed files with 5 additions and 1 deletions
+1
View File
@@ -3,6 +3,7 @@ name = "google_speech"
version = "0.1.0" version = "0.1.0"
authors = ["Uttarayan Mondal <uttarayan21@gmail.com>"] authors = ["Uttarayan Mondal <uttarayan21@gmail.com>"]
edition = "2018" edition = "2018"
build = "build.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+3
View File
@@ -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() {}
+1 -1
View File
@@ -8,7 +8,7 @@ fn test_hello_play() {
#[test] #[test]
fn test_hello_save() { fn test_hello_save() {
let hello = Speech::new("Hello", Lang::en_us).unwrap(); 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] // #[test]