Commit 1c3a1bb7 authored by David Thompson's avatar David Thompson
Browse files

Fixes for cmake policy CMP0115 and test-label uniformity.

CMP0115 requires test names passed to `smtk_add_test` to
include the filetype extension.

The `smtk_add_test` macro was not properly escaping labels
so if developers specified multiple labels they were not
passed to `set_tests_properties(LABELS ...)` properly.

A lot of test labels in SMTK were not consistently named
(bad capitalization and other variations).
parent 177540a0
......@@ -58,7 +58,7 @@ function(smtk_unit_tests)
)
set_tests_properties(${tname} PROPERTIES TIMEOUT 120)
if(SMTK_ut_LABEL)
set_tests_properties(${tname} PROPERTIES LABELS ${SMTK_ut_LABEL})
set_tests_properties(${tname} PROPERTIES LABELS "${SMTK_ut_LABEL}")
endif()
endforeach(test)
......@@ -130,7 +130,7 @@ function(smtk_build_failure_tests)
)
set_tests_properties(${tname} PROPERTIES TIMEOUT 120 WILL_FAIL TRUE)
if(SMTK_ut_LABEL)
set_tests_properties(${tname} PROPERTIES LABELS ${SMTK_ut_LABEL})
set_tests_properties(${tname} PROPERTIES LABELS "${SMTK_ut_LABEL}")
endif()
endforeach() # attempt
endforeach() # source_idx
......
CMake Policies
==============
Because of CMake policy CMP0115 (source file extensions must be explicit),
when passing test names to the ``smtk_add_test`` macro, be sure to include
the filename extension (such as ``.cxx``).
......@@ -74,38 +74,38 @@ endif()
################################################################################
set(unit_tests
unitAdvanceLevelTest
unitAssociationRulesTest
unitAssociationTest
unitAttributeAnalysis
unitAttributeAssociation
unitAttributeAssociationConstraints
unitAttributeBasics
unitAttributeExclusiveAnalysis
unitReferenceItemChildrenTest
unitCategories
unitAdvanceLevelTest.cxx
unitAssociationRulesTest.cxx
unitAssociationTest.cxx
unitAttributeAnalysis.cxx
unitAttributeAssociation.cxx
unitAttributeAssociationConstraints.cxx
unitAttributeBasics.cxx
unitAttributeExclusiveAnalysis.cxx
unitReferenceItemChildrenTest.cxx
unitCategories.cxx
unitComponentItem.cxx
unitComponentItemConstraints
unitCustomItem
unitComponentItemConstraints.cxx
unitCustomItem.cxx
unitDateTimeItem.cxx
unitDefinitionTags
unitDefinitionTags.cxx
unitDoubleItem.cxx
unitEvaluatorFactory.cxx
unitEvaluatorManager.cxx
unitExclusionCategories
unitExclusionCategories.cxx
unitInfixExpressionEvaluator.cxx
unitJsonItemDefinitions.cxx
unitOptionalItems
unitPassCategories
unitOptionalItems.cxx
unitPassCategories.cxx
unitPathGrammar.cxx
unitRegistrar.cxx
unitSymbolDependencyStorage.cxx
)
set(unit_tests_which_require_data
unitAnalysisConfigurations
unitConditionalGroup
unitItemBlocks
unitAnalysisConfigurations.cxx
unitConditionalGroup.cxx
unitItemBlocks.cxx
)
set(extra_libs ${Boost_LIBRARIES})
......
......@@ -33,25 +33,25 @@ endif()
set(unit_tests
TestArchive.cxx
UnitTestDerivedThreadPool
UnitTestDerivedThreadPool.cxx
UnitTestDateTime.cxx
UnitTestDateTimeZonePair.cxx
UnitTestFactory
UnitTestFactory.cxx
UnitTestInfixExpressionGrammar.cxx
UnitTestInfixExpressionGrammarImpl.cxx
UnitTestLinks
UnitTestObservers
UnitTestThreadPool
UnitTestTypeContainer
UnitTestTypeMap
UnitTestTypeName
UnitTestLinks.cxx
UnitTestObservers.cxx
UnitTestThreadPool.cxx
UnitTestTypeContainer.cxx
UnitTestTypeMap.cxx
UnitTestTypeName.cxx
)
set(unit_tests_which_require_data
)
smtk_unit_tests(
Label "Common"
LABEL "Common"
SOURCES ${unit_tests}
SOURCES_REQUIRE_DATA ${unit_tests_which_require_data}
LIBRARIES smtkCore ${Boost_LIBRARIES} Threads::Threads MOAB
......
......@@ -24,7 +24,7 @@ if (SMTK_ENABLE_VTK_SUPPORT)
endif()
smtk_unit_tests(
LABEL "vtk"
LABEL "VTK"
SOURCES ${unit_tests}
SOURCES_REQUIRE_DATA ${unit_tests_which_require_data}
EXTRA_SOURCES ${additional_sources}
......
......@@ -9,7 +9,7 @@ set(MeshSelection_USES_DIRECT_DATA ON)
if (SMTK_DATA_DIR)
smtk_add_client_tests(
# LABEL "pv_meshsession"
#LABEL "MeshSession"
TEST_SCRIPTS ${TESTS_WITH_BASELINES}
LOAD_PLUGINS
smtkResourcePlugin
......
......@@ -21,7 +21,7 @@ set(SplineWidget_USES_DIRECT_DATA ON)
if (SMTK_DATA_DIR)
smtk_add_client_tests(
# LABEL "pv_meshsession"
#LABEL "MeshSession"
TEST_SCRIPTS ${TESTS_WITH_BASELINES}
LOAD_PLUGINS
smtkResourcePlugin
......
......@@ -67,7 +67,8 @@ endif ()
set(CMAKE_AUTOMOC 1)
smtk_unit_tests(LABEL "qt"
smtk_unit_tests(
LABEL "Qt"
SOURCES ${unit_tests}
SOURCES_REQUIRE_DATA ${unit_tests_which_require_data}
EXTRA_SOURCES ${unit_tests_headers}
......
......@@ -23,7 +23,7 @@ set(unit_tests_which_require_data
set(unit_test_libs)
smtk_unit_tests(LABEL "vtk/io"
smtk_unit_tests(LABELS "VTK"
SOURCES ${unit_tests}
SOURCES_REQUIRE_DATA ${unit_tests_which_require_data}
LIBRARIES smtkIOVTK smtkCoreModelTesting
......
......@@ -18,6 +18,6 @@ if (SMTK_DATA_DIR)
foreach(test ${smtkExtensionVTKSourcePythonDataTests})
smtk_add_test_python(${test}Py ${test}.py
--data-dir=${SMTK_DATA_DIR} )
set_tests_properties( ${test}Py PROPERTIES LABELS "Source" )
set_tests_properties( ${test}Py PROPERTIES LABELS "VTK" )
endforeach()
endif()
......@@ -7,7 +7,7 @@ set(unit_tests
)
smtk_unit_tests(
Label "Geometry"
LABEL "Geometry"
SOURCES ${unit_tests}
LIBRARIES smtkCore
)
......@@ -9,7 +9,7 @@ set(unit_tests
)
smtk_unit_tests(
Label "GraphResource"
LABEL "Graph"
SOURCES ${unit_tests}
LIBRARIES smtkCore
)
......@@ -46,7 +46,7 @@ target_link_libraries(benchmarkModel smtkCore smtkCoreModelTesting)
#add_test(NAME benchmarkModel COMMAND benchmarkModel)
set(unit_tests
unitDeleterGroup
unitDeleterGroup.cxx
)
################################################################################
......
set(unit_tests
TestAsyncOperation
TestAvailableOperations
TestMutexedOperation
unitOperation
unitNamingGroup
TestOperationGroup
TestOperationLauncher
TestRemoveResource
TestThreadSafeLazyEvaluation
TestAsyncOperation.cxx
TestAvailableOperations.cxx
TestMutexedOperation.cxx
unitOperation.cxx
unitNamingGroup.cxx
TestOperationGroup.cxx
TestOperationLauncher.cxx
TestRemoveResource.cxx
TestThreadSafeLazyEvaluation.cxx
)
find_package(Threads REQUIRED)
smtk_unit_tests(
Label "operation"
LABEL "Operation"
SOURCES ${unit_tests}
LIBRARIES smtkCore
)
set(unit_tests
UnitTestRegistry
UnitTestRegistry.cxx
)
set(unit_tests_which_require_data
)
smtk_unit_tests(
Label "Plugin"
LABEL "Plugin"
SOURCES ${unit_tests}
SOURCES_REQUIRE_DATA ${unit_tests_which_require_data}
LIBRARIES smtkCore
......
......@@ -30,7 +30,7 @@ foreach(test ${smtkPVPluginSupportPythonTests})
else()
smtk_add_test_python(${test}Py ${testfile})
endif()
set_tests_properties( ${test}Py PROPERTIES LABELS "PVPluginSupport" )
set_tests_properties( ${test}Py PROPERTIES LABELS "Plugin" )
endforeach()
if (SMTK_DATA_DIR)
......@@ -45,6 +45,6 @@ if (SMTK_DATA_DIR)
smtk_add_test_python(${test}Py ${test}.py
--data-dir=${SMTK_DATA_DIR} )
endif()
set_tests_properties( ${test}Py PROPERTIES LABELS "PVPluginSupport" )
set_tests_properties( ${test}Py PROPERTIES LABELS "Plugin" )
endforeach()
endif()
if (SMTK_ENABLE_PROJECT_UI)
set(ui_classes
set(uiClasses
AutoStart
pqSMTKProjectBrowser
pqSMTKProjectMenu
......@@ -7,6 +7,9 @@ if (SMTK_ENABLE_PROJECT_UI)
)
set(uiFiles)
foreach(class ${uiClasses})
list(APPEND uiFiles ${class}.cxx)
endforeach()
smtk_encode_file("${CMAKE_CURRENT_SOURCE_DIR}/ProjectPanelConfiguration.json"
TYPE "_json"
......@@ -42,7 +45,6 @@ endif ()
smtk_add_plugin(smtkProjectPlugin
REGISTRAR smtk::project::plugin::Registrar
REGISTRAR_HEADER smtk/project/plugin/Registrar.h
MANAGERS
smtk::common::Managers
smtk::operation::Manager
......@@ -52,7 +54,7 @@ smtk_add_plugin(smtkProjectPlugin
PARAVIEW_PLUGIN_ARGS
VERSION 1.0
SOURCES
Registrar
Registrar.cxx
${ui_classes}
${plugin_ui_srcs}
UI_INTERFACES
......
# Using smtk test harness
set(unit_tests
TestDefineOp
TestProject
TestProjectAssociation
TestProjectLifeCycle
TestProjectLifeCycle_Deprecated
TestProjectResources
TestDefineOp.cxx
TestProject.cxx
TestProjectAssociation.cxx
TestProjectLifeCycle.cxx
TestProjectLifeCycle_Deprecated.cxx
TestProjectResources.cxx
)
set(unit_tests_which_require_data
TestProjectReadWrite
TestProjectReadWrite_Deprecated
TestProjectReadWrite2
TestProjectReadWrite2_Deprecated
TestProjectReadWriteEmpty
TestProjectReadWrite.cxx
TestProjectReadWrite_Deprecated.cxx
TestProjectReadWrite2.cxx
TestProjectReadWrite2_Deprecated.cxx
TestProjectReadWriteEmpty.cxx
)
set(extra_libs)
if (SMTK_ENABLE_VTK_SUPPORT)
......
......@@ -21,7 +21,7 @@ set(unit_tests
)
smtk_unit_tests(
Label "Resource"
LABEL "Resource"
SOURCES ${unit_tests}
LIBRARIES smtkCore
)
......@@ -8,7 +8,7 @@ set(OpenExodusFile_USES_DIRECT_DATA ON)
if (SMTK_DATA_DIR)
smtk_add_client_tests(
# LABEL "pv_meshsession"
#LABEL "MeshSession"
TEST_SCRIPTS ${TESTS_WITH_BASELINES}
LOAD_PLUGINS
smtkResourcePlugin
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment