#5390 Add --skip-tests config option

This commit is contained in:
Andrew Nelless 2016-06-24 16:51:25 +01:00 committed by Jerry (Xinyu Hou)
parent c5d5d5cba0
commit f7d8ea9686
2 changed files with 9 additions and 2 deletions

View File

@ -34,7 +34,7 @@ class Toolchain:
# options used by all commands # options used by all commands
globalOptions = 'v' globalOptions = 'v'
globalOptionsLong = ['no-prompts', 'verbose', 'skip-gui', 'skip-core'] globalOptionsLong = ['no-prompts', 'verbose', 'skip-gui', 'skip-core', 'skip-tests']
# list of valid commands as keys. the values are optarg strings, but most # list of valid commands as keys. the values are optarg strings, but most
# are None for now (this is mainly for extensibility) # are None for now (this is mainly for extensibility)
@ -241,6 +241,9 @@ class InternalCommands:
# by default, compile the gui # by default, compile the gui
enableMakeGui = True enableMakeGui = True
# by default, compile the tests
enableMakeTests = True
# by default, unknown # by default, unknown
macSdk = None macSdk = None
@ -443,6 +446,8 @@ class InternalCommands:
cmake_args += " -DOSX_TARGET_MAJOR=" + macSdkMatch.group(1) cmake_args += " -DOSX_TARGET_MAJOR=" + macSdkMatch.group(1)
cmake_args += " -DOSX_TARGET_MINOR=" + macSdkMatch.group(2) cmake_args += " -DOSX_TARGET_MINOR=" + macSdkMatch.group(2)
cmake_args += " -DDISABLE_TESTS=" + str(int(not self.enableMakeTests))
# if not visual studio, use parent dir # if not visual studio, use parent dir
sourceDir = generator.getSourceDir() sourceDir = generator.getSourceDir()
@ -1914,6 +1919,8 @@ class CommandHandler:
self.ic.enableMakeGui = False self.ic.enableMakeGui = False
elif o == '--skip-core': elif o == '--skip-core':
self.ic.enableMakeCore = False self.ic.enableMakeCore = False
elif o == '--skip-tests':
self.ic.enableMakeTests = False
elif o in ('-d', '--debug'): elif o in ('-d', '--debug'):
self.build_targets += ['debug',] self.build_targets += ['debug',]
elif o in ('-r', '--release'): elif o in ('-r', '--release'):

View File

@ -18,6 +18,6 @@ add_subdirectory(lib)
add_subdirectory(cmd) add_subdirectory(cmd)
add_subdirectory(micro) add_subdirectory(micro)
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "IRIX") if ((NOT ${CMAKE_SYSTEM_NAME} MATCHES "IRIX") AND (NOT ${DISABLE_TESTS}))
add_subdirectory(test) add_subdirectory(test)
endif() endif()