Skip to content

Commit

Permalink
Merge pull request #1946 from ghutchis/fixup-qt-tests
Browse files Browse the repository at this point in the history
Only build MoleQueue tests when requested
  • Loading branch information
ghutchis authored Jan 21, 2025
2 parents 126e6d0 + 1b0e954 commit 9e111de
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions tests/qtgui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}"
"${AvogadroLibs_SOURCE_DIR}/tests/core")

find_package(Qt${QT_VERSION} COMPONENTS Widgets Network Test REQUIRED)
# Pull in MoleQueue for QtJson
find_package(MoleQueue REQUIRED NO_MODULE)
include_directories(${MoleQueue_INCLUDE_DIRS})

# Find python interpreter for input generator
find_package(PythonInterp 3)
Expand All @@ -25,10 +22,19 @@ set(tests
# GitHub is showing this as a free() bug
# TODO: Fix this
# Molecule
MoleQueueQueueListModel
RWMolecule
)

if (BUILD_MOLEQUEUE)
# Pull in MoleQueue
find_package(MoleQueue REQUIRED NO_MODULE)
include_directories(${MoleQueue_INCLUDE_DIRS})
list(APPEND tests
MoleQueueQueueListModel
)
set(MoleQueueLink Avogadro::MoleQueue MoleQueueClient)
endif()

if(PYTHON_EXECUTABLE AND AVOGADRO_DATA)
list(APPEND tests
# FIXME: These tests are broken
Expand All @@ -48,8 +54,9 @@ endforeach()

# Add a single executable for all of our tests.
add_executable(AvogadroQtGuiTests ${testSrcs})
target_link_libraries(AvogadroQtGuiTests Avogadro::QtGui Avogadro::MoleQueue
MoleQueueClient ${GTEST_BOTH_LIBRARIES} ${EXTRA_LINK_LIB} Qt${QT_VERSION}::Widgets Qt${QT_VERSION}::Test)
target_link_libraries(AvogadroQtGuiTests Avogadro::QtGui ${MoleQueueLink}
${GTEST_BOTH_LIBRARIES} ${EXTRA_LINK_LIB}
Qt${QT_VERSION}::Widgets Qt${QT_VERSION}::Test)

# Now add all of the tests, using the gtest_filter argument so that only those
# cases are run in each test invocation.
Expand Down

0 comments on commit 9e111de

Please sign in to comment.