Skip to content

Commit

Permalink
Fix check for Python3 (#610)
Browse files Browse the repository at this point in the history
When changing to find_package(Python3) (see #610), the variable
PYTHON_VERSION_MAJOR no longer gets set.  That caused HAS_PYTHON3 to get set
to FALSE and for the test TriBITS_sphinx_rst_generator_UnitTests to not get
enabled (but is actually disabled using property DISABLED).

NOTE: The CDash feature that reports when tests go missing caught this
problem!  (I never noticed that when doing local testing).  Here is what that
CDash email looked like:

----

Summary: [tribits-checkins] FAILED (m=1): TriBITS/TriBITS -
tribits_cmake-3.25.2_makefiles_python-3.8_g++-11 - Continuous

A submission to CDash for the project TriBITS has missing tests. You have been
identified as one of the authors who have checked in changes that are part of
this submission or you are listed in the default contact list.

Details on the submission can be found at https://my.cdash.org/build/2685504.

Project: TriBITS
SubProject: TriBITS
Site: ubuntu-latest
Build Name: tribits_cmake-3.25.2_makefiles_python-3.8_g++-11
Build Time: 2024-10-09 16:55:55
Type: Continuous
Total Missing Tests: 1

*Missing Tests*
TriBITS_sphinx_rst_generator_UnitTests (https://my.cdash.org/viewTest.php?buildid=2685505)

-CDash

----

That is such a nice feature!
  • Loading branch information
bartlettroscoe committed Oct 9, 2024
1 parent bd5ce80 commit 83ec3e4
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions test/doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
if (PYTHON_VERSION_MAJOR GREATER_EQUAL 3)
set(HAS_PYTHON3 TRUE)
else()
set(HAS_PYTHON3 FALSE)
endif()


advanced_set( ${PROJECT_NAME}_ENABLE_DOC_GENERATION_TESTS OFF
CACHE BOOL
"Enable testing for the build of the documentation, including using Sphinx. Requires docutils, sphinx, and sphinx-rd-theme and will blow away and rebuild the existing documentation in the source tree since the documentation builds in place. Therefore, one must be careful to not blow away non-tracked files." )
Expand All @@ -13,15 +6,14 @@ advanced_set( ${PROJECT_NAME}_ENABLE_DOC_GENERATION_TESTS OFF
tribits_add_advanced_test( sphinx_rst_generator_UnitTests
OVERALL_WORKING_DIRECTORY TEST_NAME
OVERALL_NUM_MPI_PROCS 1
EXCLUDE_IF_NOT_TRUE HAS_PYTHON3
EXCLUDE_IF_NOT_TRUE Python3_EXECUTABLE
TEST_0 CMND ${Python3_EXECUTABLE}
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/sphinx_rst_generator_UnitTests.py -v
PASS_REGULAR_EXPRESSION "OK"
ALWAYS_FAIL_ON_NONZERO_RETURN
DISABLED "Test is broken for long time, see commit c477daa1"
)


tribits_add_advanced_test( build_docs
EXCLUDE_IF_NOT_TRUE ${PROJECT_NAME}_ENABLE_DOC_GENERATION_TESTS
GIT_EXECUTABLE
Expand Down

0 comments on commit 83ec3e4

Please sign in to comment.