Skip to content

Commit

Permalink
Use CMake variables to enable/disable test apps (#1987)
Browse files Browse the repository at this point in the history
* use CMake GFXRECON_INCLUDE_TEST_APPS instead of GFXRECON_NO_TEST_APPS

* Don't use environment variable GFXRECON_NO_TEST_APPS at the level of tests/
* Instead use CMake variable GFXRECON_INCLUDE_TEST_APPS, default ON

To turn off test apps, provide "-DGFXRECON_INCLUDE_TEST_APPS=OFF" to
CMake.

* document change of variable and meaning for test app build
  • Loading branch information
bradgrantham-lunarg committed Jan 28, 2025
1 parent 14a8ff6 commit b75c613
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ endif()

option(GFXRECON_TOCPP_SUPPORT "Build ToCpp export tool as part of GFXReconstruct builds." TRUE)

option(GFXRECON_INCLUDE_TEST_APPS "Build and install test apps" ON)

if(MSVC)

# The host toolchain architecture (i.e. are the compiler and other tools compiled to ARM/Intel 32bit/64bit binaries):
Expand Down Expand Up @@ -380,7 +382,10 @@ if(NOT BUILD_STATIC)
add_subdirectory(layer)
endif()
add_subdirectory(tools)

if(GFXRECON_INCLUDE_TEST_APPS)
add_subdirectory(test)
endif()

if (${RUN_TESTS})
add_test_package_file(${CMAKE_CURRENT_LIST_DIR}/scripts/build.py)
Expand Down
2 changes: 1 addition & 1 deletion TESTING_test_apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Use of the *TestAppBase* is optional.
## **Building Test Apps**

Test apps are built as part of the default build CMAKE build process. In order to stop test apps from building, set the
**GFXRECON_NO_TEST_APPS** environment variable at CMAKE build time.
**GFXRECON_INCLUDE_TEST_APPS** CMake variable to OFF, e.g. provide `-DGFXRECON_INCLUDE_TEST_APPS=OFF` in your cmake command line.
6 changes: 2 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
###############################################################################


if (NOT DEFINED ENV{GFXRECON_NO_TEST_APPS})
add_subdirectory(test_apps)
endif ()
add_subdirectory(test_apps)

# TODO: runner goes here
# TODO: runner goes here

0 comments on commit b75c613

Please sign in to comment.