From f7d8ea96865fac77819ecdfb4679280dcf31e100 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Fri, 24 Jun 2016 16:51:25 +0100 Subject: [PATCH] #5390 Add --skip-tests config option --- ext/toolchain/commands1.py | 9 ++++++++- src/CMakeLists.txt | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ext/toolchain/commands1.py b/ext/toolchain/commands1.py index 5f85a3e3..54b2a663 100644 --- a/ext/toolchain/commands1.py +++ b/ext/toolchain/commands1.py @@ -34,7 +34,7 @@ class Toolchain: # options used by all commands 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 # are None for now (this is mainly for extensibility) @@ -240,6 +240,9 @@ class InternalCommands: # by default, compile the gui enableMakeGui = True + + # by default, compile the tests + enableMakeTests = True # by default, unknown macSdk = None @@ -442,6 +445,8 @@ class InternalCommands: cmake_args += " -DCMAKE_OSX_DEPLOYMENT_TARGET=" + self.macSdk cmake_args += " -DOSX_TARGET_MAJOR=" + macSdkMatch.group(1) cmake_args += " -DOSX_TARGET_MINOR=" + macSdkMatch.group(2) + + cmake_args += " -DDISABLE_TESTS=" + str(int(not self.enableMakeTests)) # if not visual studio, use parent dir sourceDir = generator.getSourceDir() @@ -1914,6 +1919,8 @@ class CommandHandler: self.ic.enableMakeGui = False elif o == '--skip-core': self.ic.enableMakeCore = False + elif o == '--skip-tests': + self.ic.enableMakeTests = False elif o in ('-d', '--debug'): self.build_targets += ['debug',] elif o in ('-r', '--release'): diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 45aa7df4..77b3b31b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -18,6 +18,6 @@ add_subdirectory(lib) add_subdirectory(cmd) add_subdirectory(micro) -if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "IRIX") +if ((NOT ${CMAKE_SYSTEM_NAME} MATCHES "IRIX") AND (NOT ${DISABLE_TESTS})) add_subdirectory(test) endif()