Skip to content

Commit

Permalink
link-onnxruntimecargo testが通るようにする
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip committed Jul 2, 2024
1 parent 07d70e0 commit c545f89
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
key: "cargo-integration-test-cache-${{ matrix.features }}-${{ matrix.os }}"
- name: Run cargo integration test
run: RUST_BACKTRACE=full cargo test --test "*" -vv --features ,${{ matrix.features }} -- --include-ignored
- name: Run cargo integration test (load-onnxruntime)
run: RUST_BACKTRACE=full cargo test -vv --features ,${{ matrix.features }} -- --include-ignored
- name: Run cargo integration test (link-onnxruntime)
run: RUST_BACKTRACE=full cargo test -vv -p voicevox_core --features link-onnxruntime,${{ matrix.features }}

c-header:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion crates/voicevox_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pretty_assertions.workspace = true
rstest.workspace = true
rstest_reuse.workspace = true
test_util.workspace = true
tokio = { workspace = true, features = ["rt", "macros"] }
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }

[target."cfg(windows)".dependencies]
humansize.workspace = true
Expand Down
6 changes: 4 additions & 2 deletions crates/voicevox_core/src/infer/runtimes/onnxruntime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ pub(crate) mod blocking {
/// インスタンスは[voicevox-ort]側に作られる。Rustのクレートとしてこのライブラリを利用する場合、
/// Tokio版APIやvoicevox-ortを利用する他クレートともインスタンスが共有される。
///
/// ```
#[cfg_attr(feature = "load-onnxruntime", doc = "```")]
#[cfg_attr(feature = "link-onnxruntime", doc = "```compile_fail")]
/// # use voicevox_core as another_lib;
/// #
/// # fn main() -> anyhow::Result<()> {
Expand Down Expand Up @@ -419,7 +420,8 @@ pub(crate) mod tokio {
/// インスタンスは[voicevox-ort]側に作られる。Rustのクレートとしてこのライブラリを利用する場合、
/// ブロッキング版APIやvoicevox-ortを利用する他クレートともインスタンスが共有される。
///
/// ```
#[cfg_attr(feature = "load-onnxruntime", doc = "```")]
#[cfg_attr(feature = "link-onnxruntime", doc = "```compile_fail")]
/// # use voicevox_core as another_lib;
/// #
/// # #[tokio::main]
Expand Down
3 changes: 2 additions & 1 deletion crates/voicevox_core/src/synthesizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ pub(crate) mod blocking {
///
/// # Example
///
/// ```
#[cfg_attr(feature = "load-onnxruntime", doc = "```")]
#[cfg_attr(feature = "link-onnxruntime", doc = "```compile_fail")]
/// # #[tokio::main]
/// # async fn main() -> anyhow::Result<()> {
/// # use test_util::{ONNXRUNTIME_DYLIB_PATH, OPEN_JTALK_DIC_DIR};
Expand Down

0 comments on commit c545f89

Please sign in to comment.