1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
#!/bin/bash
#
# Autopkgtest for libwebm, testing against system-installed library
# This approach tests the actual installed libwebm package instead of
# rebuilding from source, making it a proper CI test for the archive.
#
# SPDX-License-Identifier: BSD-3-Clause OR CC0-1.0
set -e
echo "=== libwebm system library autopkgtest ==="
# Set up working directory
WORKDIR="${AUTOPKGTEST_TMP}"
SOURCE_DIR="$(pwd)"
echo "Source directory: ${SOURCE_DIR}"
echo "Working directory: ${WORKDIR}"
# Change to working directory and create build area
cd "${WORKDIR}"
mkdir -p build
cd build
echo "=== Building tests against system libwebm ==="
# Configure the build to use our minimal CMakeLists.txt
cmake "${SOURCE_DIR}/debian/tests" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE=Release
# Build the test executables
make
echo "=== Built test executables ==="
ls -la
# Set up test data path - pointing to source tree's test data
export LIBWEBM_TEST_DATA_PATH="${SOURCE_DIR}/testing/testdata"
echo "=== Running tests against system-installed libwebm ==="
# Track test results
failed_tests=""
total_tests=0
passed_tests=0
# Function to run a test
run_test() {
local test_name="$1"
local test_binary="$2"
if [ ! -x "./${test_binary}" ]; then
echo "SKIP: ${test_name} (binary not found or not executable)"
return
fi
echo "========== Running ${test_name} =========="
total_tests=$((total_tests + 1))
if "./${test_binary}"; then
echo "=== PASS: ${test_name} ==="
passed_tests=$((passed_tests + 1))
else
echo "=== FAIL: ${test_name} ==="
failed_tests="${failed_tests} ${test_name}"
fi
}
# Run the individual tests
run_test "mkvparser_test" "mkvparser_test"
run_test "mkvmuxer_test" "mkvmuxer_test"
run_test "video_frame_test" "video_frame_test"
# Clean up
unset LIBWEBM_TEST_DATA_PATH
echo "=== Test Results Summary ==="
echo "Total tests: ${total_tests}"
echo "Passed tests: ${passed_tests}"
echo "Failed tests: ${failed_tests}"
if [ -n "${failed_tests}" ]; then
echo "ERROR: Some tests failed: ${failed_tests}"
exit 1
else
echo "SUCCESS: All tests passed against system-installed libwebm"
exit 0
fi
|