CMake/Tests
Brad King 130f116340 Merge topic 'fix-qtautogen-with-object-library-Ninja'
9bc6eb8e cmGlobalGenerator: Initialize generator targets on construction (#15729)
2015-09-29 10:08:13 -04:00
..
AliasTarget
Architecture
ArgumentExpansion
Assembler
BuildDepends
BundleGeneratorTest
BundleTest
BundleUtilities
CFBundleTest
CheckCompilerRelatedVariables
CMakeCommands
CMakeLib
CMakeOnly
CMakeTestAllGenerators
CMakeTestMultipleConfigures
CMakeTests
CoberturaCoverage
CommandLineTest
CompatibleInterface
CompileCommandOutput
CompileDefinitions
CompileFeatures
CompileOptions
Complex
ComplexOneConfig
ConfigSources
COnly
Contracts
CPackComponents
CPackComponentsDEB Merge topic 'cpack-package-empty-dirs' 2015-09-29 10:08:06 -04:00
CPackComponentsForAll
CPackComponentsPrefix
CPackTestAllGenerators
CPackWiXGenerator
CrossCompile
CTestBuildCommandProjectInSubdir
CTestConfig
CTestCoverageCollectGCOV
CTestLimitDashJ
CTestScriptMode
CTestTest
CTestTest2
CTestTestBadExe
CTestTestBadGenerator
CTestTestChecksum
CTestTestCostSerial
CTestTestCrash
CTestTestCycle
CTestTestDepends
CTestTestEmptyBinaryDirectory
CTestTestFailure
CTestTestFdSetSize
CTestTestLabelRegExp
CTestTestLaunchers
CTestTestMissingDependsExe
CTestTestParallel
CTestTestResourceLock
CTestTestRunScript
CTestTestScheduler
CTestTestSerialInDepends
CTestTestSerialOrder
CTestTestSkipReturnCode
CTestTestStopTime
CTestTestSubdir
CTestTestTimeout
CTestTestUpload
CTestTestVerboseOutput
CTestTestZeroTimeout
CustComDepend
CustomCommand
CustomCommandByproducts
CustomCommandWorkingDirectory
CxxDialect
CxxOnly
CxxSubdirC
DelphiCoverage
Dependency
DoubleProject
EmptyDepends
EmptyLibrary
EmptyProperty
Environment
ExportImport
ExternalOBJ
ExternalProject
ExternalProjectLocal
ExternalProjectSubdir
ExternalProjectUpdate
FindGSL
FindGTK2
FindJsonCpp
FindMatlab
FindModulesExecuteAll
FindOpenSSL
FindPackageModeMakefileTest
FindPackageTest
FindThreads
ForceInclude
Fortran
FortranC
FortranOnly
Framework
FunctionTest
GeneratorExpression
GhsMulti
IncludeDirectories
InterfaceLibrary
InterfaceLinkLibraries
iOSNavApp
IPO
JacocoCoverage
Java
JavaJavah
JavascriptCoverage
JCTest
Jump
LibName
LinkDirectory
LinkFlags
LinkLanguage
LinkLine
LinkLineOrder
LinkStatic
LoadCommand
LoadCommandOneConfig
MacroTest
MacRuntimePath
MakeClean
MathTest
MFC
MissingInstall
MissingSourceFile
Module
ModuleDefinition
MSManifest
MumpsCoverage
NewlineArgs
ObjC++
ObjectLibrary
OutDir
OutOfBinary
OutOfSource
PDBDirectoryAndName
PerConfig
Plugin
Policy0002
PolicyScope
PositionIndependentTargets
PrecompiledHeader
PreOrder
Preprocess
Properties
PythonCoverage
Qt4And5Automoc
Qt4Deploy
Qt4Targets
QtAutogen
QtAutomocNoQt
QtAutoUicInterface
ReturnTest
RunCMake
RuntimePath
SameName
SBCS
SetLang
Simple
SimpleCOnly
SimpleExclude
SimpleInstall
SimpleInstallS2
SourceFileProperty
SourceGroups
SourcesProperty
StagingPrefix
StringFileTest
SubDir
SubDirSpaces
SubProject
SwiftMix
SwiftOnly
SwigTest
SystemInformation
TargetName
TestDriver
Testing
TestsWorkingDirectory
TryCompile
Tutorial
Unset
VariableUnusedViaSet
VariableUnusedViaUnset
VariableUsage
Visibility
VSExcludeFromDefaultBuild
VSExternalInclude
VSGNUFortran
VSMASM
VSMidl
VSNsightTegra
VSProjectInSubdir
VSResource
VSWindowsFormsResx
VSWinStorePhone
VSXaml
WarnUnusedCliUnused
Wrapping
X11
XCTest
.NoDartCoverage
bootstrap.bat.in
BootstrapTest.cmake
CheckFortran.cmake
CMakeBuildTest.cmake.in
CMakeCopyright.cmake
CMakeInstall.cmake
CMakeLists.txt
CTestUpdateBZR.cmake.in
CTestUpdateCommon.cmake
CTestUpdateCVS.cmake.in
CTestUpdateGIT.cmake.in
CTestUpdateGIT.sh.in
CTestUpdateHG.cmake.in
CTestUpdateP4.cmake.in
CTestUpdateSVN.cmake.in
EnforceConfig.cmake.in
README
test_clean.cmake.in

If you think about adding a new testcase then here is a small checklist you
can run through to find a proper place for it. Go through the list from the
beginning and stop once you find something that matches your tests needs,
i.e. if you will test a module and only need the configure mode use the
instructions from section 2, not 3.

1. Your testcase can run in CMake script mode, i.e. "cmake -P something"

Put your test in Tests/CMakeTests/ directory as a .cmake.in file. It will be
put into the test binary directory by configure_file(... @ONLY) and run from
there. Use the AddCMakeTest() macro in Tests/CMakeTests/CMakeLists.txt to add
your test to the test runs.

2. Your test needs CMake to run in configure mode, but will not build anything

This includes tests that will build something using try_compile() and friends,
but nothing that expects add_executable(), add_library(), or add_test() to run.

If the test configures the project only once and it must succeed then put it
into the Tests/CMakeOnly/ directory.  Create a subdirectory named like your
test and write the CMakeLists.txt you need into that subdirectory. Use the
add_CMakeOnly_test() macro from Tests/CMakeOnly/CMakeLists.txt to add your
test to the test runs.

If the test configures the project with multiple variations and verifies
success or failure each time then put it into the Tests/RunCMake/ directory.
Read the instructions in Tests/RunCMake/CMakeLists.txt to add a test.

3. If you are testing something from the Modules directory

Put your test in the Tests/Modules/ directory. Create a subdirectory there
named after your test. Use the ADD_TEST_MACRO macro from Tests/CMakeLists.txt
to add your test to the test run. If you have put your stuff in
Tests/Modules/Foo then you call it using ADD_TEST_MACRO(Module.Foo Foo).

4. You are doing other stuff.

Find a good place ;) In doubt mail to cmake-developers@cmake.org and ask for
advise.