Compare commits

...

2 Commits

Author SHA1 Message Date
66d4df0524 fix 2026-03-19 20:17:10 +03:00
54e14760ca fix 2026-03-19 20:09:07 +03:00
2 changed files with 25 additions and 4 deletions

View File

@@ -380,6 +380,7 @@ jobs:
run: cmake --build cmake-build/build/${{ matrix.preset }} --target unit_tests omath
- name: Run unit_tests
if: ${{ matrix.coverage != true }}
shell: bash
run: ./out/Release/unit_tests
@@ -388,6 +389,8 @@ jobs:
shell: bash
run: |
brew install lcov
# Clean stale profraw files before running coverage
find cmake-build/build/${{ matrix.preset }} -name "*.profraw" -delete 2>/dev/null || true
chmod +x scripts/coverage-llvm.sh
./scripts/coverage-llvm.sh \
"${{ github.workspace }}" \

View File

@@ -17,8 +17,20 @@ echo "[*] Output dir: ${OUTPUT_DIR}"
find_llvm_tool() {
local tool_name="$1"
# macOS: use xcrun
# macOS: derive from the same directory as the active clang to guarantee
# the profraw format version matches the compiler that instrumented the binary.
if [[ "$(uname)" == "Darwin" ]]; then
local clang_path
clang_path=$(xcrun --find clang 2>/dev/null)
if [[ -n "$clang_path" ]]; then
local tool_path
tool_path="$(dirname "$clang_path")/${tool_name}"
if [[ -x "$tool_path" ]]; then
echo "$tool_path"
return 0
fi
fi
# Fallback: xcrun
if xcrun --find "${tool_name}" &>/dev/null; then
echo "xcrun ${tool_name}"
return 0
@@ -51,6 +63,12 @@ fi
echo "[*] Using: ${LLVM_PROFDATA}"
echo "[*] Using: ${LLVM_COV}"
# Print version info for debugging version mismatches
if [[ "$(uname)" == "Darwin" ]]; then
echo "[*] Compiler: $(xcrun clang --version | head -1)"
echo "[*] profdata: $(${LLVM_PROFDATA} show --version 2>&1 | head -1 || true)"
fi
# Find test binary
if [[ -z "${TEST_BINARY}" ]]; then
for path in \