Configuration - VCPKG add GTest feature (#616)

- Bumped OCCT version from 7.8.1 to 8.0.0 and updated the documentation URL.
- Enhanced descriptions for existing vcpkg features and introduced a “gtest” feature in vcpkg.json.
- Modified CMakeLists.txt to add/unset the GTest vcpkg feature and reorganized test setup calls.
This commit is contained in:
Pasukhin Dmitry
2025-07-14 22:15:51 +01:00
committed by GitHub
parent ef187e7b20
commit 2e2dc8d3e5
3 changed files with 35 additions and 25 deletions

View File

@@ -58,7 +58,6 @@ runs:
run: | run: |
cd install cd install
call env.bat vc14 win64 release call env.bat vc14 win64 release
cd bin
set GTEST_OUTPUT="" set GTEST_OUTPUT=""
OpenCascadeGTest.exe --gtest_output=xml:gtest_results.xml > gtest_output.log 2>&1 OpenCascadeGTest.exe --gtest_output=xml:gtest_results.xml > gtest_output.log 2>&1
type gtest_output.log type gtest_output.log
@@ -82,8 +81,8 @@ runs:
with: with:
name: gtest-results-${{ inputs.platform }}-${{ inputs.compiler }}-${{ inputs.artifact-suffix }} name: gtest-results-${{ inputs.platform }}-${{ inputs.compiler }}-${{ inputs.artifact-suffix }}
path: | path: |
install/bin/gtest_results.xml install/**/gtest_results.xml
install/bin/gtest_output.log install/**/gtest_output.log
retention-days: 15 retention-days: 15
- name: Check for test failures on Windows - name: Check for test failures on Windows
@@ -91,7 +90,7 @@ runs:
id: check-failures-windows id: check-failures-windows
shell: pwsh shell: pwsh
run: | run: |
cd install/bin cd install
$log = Get-Content "gtest_output.log" -Raw $log = Get-Content "gtest_output.log" -Raw
if ($log -match "\[\s+FAILED\s+\]") { if ($log -match "\[\s+FAILED\s+\]") {
Write-Error "GTest failures detected in the output." Write-Error "GTest failures detected in the output."

View File

@@ -759,6 +759,17 @@ else()
OCCT_CHECK_AND_UNSET ("INSTALL_JEMALLOC") OCCT_CHECK_AND_UNSET ("INSTALL_JEMALLOC")
endif() endif()
# GTest
if (BUILD_GTEST)
OCCT_ADD_VCPKG_FEATURE ("gtest")
list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/gtest")
else()
OCCT_UNSET_VCPKG_FEATURE ("gtest")
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GTEST")
OCCT_CHECK_AND_UNSET_GROUP ("GTest")
OCCT_CHECK_AND_UNSET ("INSTALL_GTEST")
endif()
# qt for samples # qt for samples
if (BUILD_SAMPLES_QT) if (BUILD_SAMPLES_QT)
# check qt 3rdparty path # check qt 3rdparty path
@@ -1198,7 +1209,6 @@ endforeach()
# Setup Google Test integration if enabled # Setup Google Test integration if enabled
if (BUILD_GTEST) if (BUILD_GTEST)
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gtest")
enable_testing() enable_testing()
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_gtest") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_gtest")
@@ -1212,11 +1222,6 @@ if (BUILD_GTEST)
# Set environment variables for all tests # Set environment variables for all tests
OCCT_SET_GTEST_ENVIRONMENT() OCCT_SET_GTEST_ENVIRONMENT()
else()
# Disable GTest integration if not enabled
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GTEST")
OCCT_CHECK_AND_UNSET_GROUP ("GTest")
OCCT_CHECK_AND_UNSET ("INSTALL_GTEST")
endif() endif()
if (BUILD_DOC_Overview OR BUILD_DOC_RefMan) if (BUILD_DOC_Overview OR BUILD_DOC_RefMan)

View File

@@ -1,10 +1,10 @@
{ {
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "opencascade", "name": "opencascade",
"version": "7.8.1", "version": "8.0.0",
"description": "Open CASCADE Technology (OCCT) is an open-source software development platform for 3D CAD, CAM, CAE.", "description": "Open CASCADE Technology (OCCT) is an open-source software development platform for 3D CAD, CAM, CAE.",
"homepage": "https://github.com/Open-Cascade-SAS/OCCT", "homepage": "https://github.com/Open-Cascade-SAS/OCCT",
"documentation": "https://github.com/Open-Cascade-SAS/OCCT/wiki", "documentation": "https://dev.opencascade.org/doc/overview/html",
"license": "LGPL-2.1", "license": "LGPL-2.1",
"dependencies": [ "dependencies": [
{ {
@@ -35,7 +35,7 @@
], ],
"features": { "features": {
"angle": { "angle": {
"description": "Enables optional usage of OpenGL ES 2.0. Part of the module-visualization.", "description": "Enables OpenGL ES 2.0 through ANGLE project. Required for 3D visualization in OCCT on UWP platform where desktop OpenGL is not available.",
"dependencies": [ "dependencies": [
{ {
"name": "angle", "name": "angle",
@@ -44,19 +44,19 @@
] ]
}, },
"opengl": { "opengl": {
"description": "Enables optional usage of OpenGL. Part of the module-visualization.", "description": "Enables OpenGL support for 3D visualization toolkit. Required for OCCT's OpenGL rendering pipeline and graphical display drivers.",
"dependencies": [ "dependencies": [
"opengl" "opengl"
] ]
}, },
"tcl": { "tcl": {
"description": "Enables optional usage of Tcl. Part of the module-foundation-classes.", "description": "Enables Tcl scripting support for OCCT's DRAWEXE test harness and command-line interface. Provides access to OCCT's geometric algorithms through scripting.",
"dependencies": [ "dependencies": [
"tcl" "tcl"
] ]
}, },
"tcltk": { "tcltk": {
"description": "Enables optional usage of TclTk. Part of the module-foundation-classes.", "description": "Enables Tcl/Tk GUI support for DRAWEXE test harness. Provides windowed interface for OCCT's geometric modeling and visualization tools.",
"dependencies": [ "dependencies": [
{ {
"name": "tcl", "name": "tcl",
@@ -71,13 +71,13 @@
] ]
}, },
"freeimage": { "freeimage": {
"description": "Enables optional usage of FreeImage. Part of the module-visualization.", "description": "Enables FreeImage support for advanced image file format handling (TIFF, PNG, JPEG, etc.) in OCCT's imaging and visualization components.",
"dependencies": [ "dependencies": [
"freeimage" "freeimage"
] ]
}, },
"freetype": { "freetype": {
"description": "Enables optional usage of FreeType. Part of the module-visualization.", "description": "Enables FreeType font rendering engine for high-quality text display in OCCT's 3D visualization and technical drawing output.",
"supports": "!uwp", "supports": "!uwp",
"dependencies": [ "dependencies": [
"fontconfig", "fontconfig",
@@ -88,19 +88,19 @@
] ]
}, },
"rapidjson": { "rapidjson": {
"description": "Enables optional usage of RapidJSON. Part of the module-data-exchange.", "description": "Enables RapidJSON for efficient JSON parsing and serialization in OCCT's glTF 2.0 import/export functionality.",
"dependencies": [ "dependencies": [
"rapidjson" "rapidjson"
] ]
}, },
"tbb": { "tbb": {
"description": "Enables optional usage of TBB. Part of the module-foundation-classes.", "description": "Enables Intel Threading Building Blocks for optimized parallel computing. Replaces OCCT's default threading with TBB's task-based parallelism for better performance.",
"dependencies": [ "dependencies": [
"tbb" "tbb"
] ]
}, },
"vtk": { "vtk": {
"description": "Enables optional usage of VTK. Part of the module-visualization.", "description": "Enables VTK (Visualization Toolkit) integration for advanced scientific visualization capabilities and mesh processing in OCCT.",
"dependencies": [ "dependencies": [
{ {
"name": "vtk", "name": "vtk",
@@ -112,28 +112,34 @@
] ]
}, },
"draco": { "draco": {
"description": "Enables optional usage of Draco. Part of the module-data-exchange.", "description": "Enables Google Draco geometry compression for efficient mesh storage and transmission in OCCT's glTF 2.0 import/export workflow.",
"dependencies": [ "dependencies": [
"draco" "draco"
] ]
}, },
"ffmpeg": { "ffmpeg": {
"description": "Enables optional usage of FFmpeg. Part of the module-visualization.", "description": "Enables FFmpeg multimedia framework for video encoding/decoding and animation export capabilities in OCCT's visualization pipeline.",
"dependencies": [ "dependencies": [
"ffmpeg" "ffmpeg"
] ]
}, },
"openvr": { "openvr": {
"description": "Enables optional usage of OpenVR. Part of the module-visualization.", "description": "Enables OpenVR SDK integration for virtual reality support in OCCT's 3D visualization, allowing immersive CAD model exploration.",
"dependencies": [ "dependencies": [
"openvr" "openvr"
] ]
}, },
"jemalloc": { "jemalloc": {
"description": "Enables optional usage of jemalloc. Part of the module-foundation-classes.", "description": "Enables jemalloc high-performance memory allocator as replacement for system malloc. Improves memory usage patterns for large-scale CAD operations.",
"dependencies": [ "dependencies": [
"jemalloc" "jemalloc"
] ]
},
"gtest": {
"description": "Enables Google Test framework for building OCCT's unit test suite. Required for running automated tests and validation of OCCT functionality.",
"dependencies": [
"gtest"
]
} }
} }
} }