Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/build_native.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def replace(match):
level = "QT_LOG_WARN"
elif any(word in message for word in (
"fatal", "failed", "cannot", "oom", "unsupported",
"not a valid", "no audio data", "unknown format",
"not a valid", "not found", "no audio data", "unknown format",
)):
level = "QT_LOG_ERROR"
else:
Expand Down
20 changes: 20 additions & 0 deletions tests/test_build_native.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""Check diagnostics in the pinned native source after wheel-build patching."""

import os
from pathlib import Path
import shutil

import pytest

from scripts.build_native import native_diagnostic_compatibility


def test_missing_tokenizer_remains_an_error(tmp_path):
source = os.environ.get("QWENTTS_CPP_SOURCE")
if not source:
pytest.skip("QWENTTS_CPP_SOURCE not set")

shutil.copytree(Path(source).resolve() / "src", tmp_path / "src")
with native_diagnostic_compatibility(tmp_path):
bpe = (tmp_path / "src" / "bpe.h").read_text()
assert 'qt_log(QT_LOG_ERROR, "[BPE] Tokenizer not found in %s", gguf_path);' in bpe
Loading