test: add unit testing for point.h to CI workflow

This commit is contained in:
2025-11-08 21:57:23 +01:00
parent 60a210ab0f
commit aee965c84d
5 changed files with 97 additions and 2 deletions
+14
View File
@@ -6,6 +6,12 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_PATH="$(cd "$SCRIPT_DIR/../../" && pwd)"
DOCKERFILE_PATH="$SCRIPT_DIR/../occt.Dockerfile"
# Check for --unit-testing argument
RUN_UNIT_TESTS=false
if [[ "${1-}" == "--unit-testing" ]]; then
RUN_UNIT_TESTS=true
fi
echo "Building image..."
if ! docker build -f "$DOCKERFILE_PATH" -t "$IMAGE_NAME" "$PROJECT_PATH"; then
echo "Image build failed." >&2
@@ -17,3 +23,11 @@ if ! docker run --rm "$IMAGE_NAME" ls /usr/local/bin; then
echo "Listing /usr/local/bin failed." >&2
exit 1
fi
if [ "$RUN_UNIT_TESTS" = true ]; then
echo "Running unit tests..."
if ! docker run --rm "$IMAGE_NAME" ctest --test-dir /app/build/unit-tests -V; then
echo "Unit tests failed." >&2
exit 1
fi
fi