Skip to content

Commit 36c3f47

Browse files
committed
Converted default values to use the defaults module where appropriate to make the test suite more portable since the original hard-coded values were gathered from my development machine.
1 parent 5bfc0af commit 36c3f47

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

utils/build_swift/tests/expected_options.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88

99
import argparse
10+
import multiprocessing
11+
12+
from build_swift import defaults
1013

1114

1215
__all__ = [
@@ -54,7 +57,7 @@
5457
'build_ios': True,
5558
'build_ios_device': False,
5659
'build_ios_simulator': False,
57-
'build_jobs': 4,
60+
'build_jobs': multiprocessing.cpu_count(),
5861
'build_libdispatch': False,
5962
'build_libicu': False,
6063
'build_linux': True,
@@ -83,20 +86,25 @@
8386
'build_xctest': False,
8487
'clang_compiler_version': None,
8588
'clang_profile_instr_use': None,
86-
'clang_user_visible_version': '5.0.0',
89+
'clang_user_visible_version': defaults.CLANG_USER_VISIBLE_VERSION,
8790
'clean': False,
8891
'cmake': None,
8992
'cmake_generator': 'Ninja',
9093
'cmark_assertions': True,
9194
'cmark_build_variant': 'Debug',
92-
'compiler_vendor': 'none',
95+
'compiler_vendor': defaults.COMPILER_VENDOR,
9396
'coverage_db': None,
9497
'cross_compile_hosts': [],
95-
'darwin_deployment_version_ios': '7.0',
96-
'darwin_deployment_version_osx': '10.9',
97-
'darwin_deployment_version_tvos': '9.0',
98-
'darwin_deployment_version_watchos': '2.0',
99-
'darwin_xcrun_toolchain': 'default',
98+
'darwin_deployment_version_ios':
99+
defaults.DARWIN_DEPLOYMENT_VERSION_IOS,
100+
'darwin_deployment_version_osx':
101+
defaults.DARWIN_DEPLOYMENT_VERSION_OSX,
102+
'darwin_deployment_version_tvos':
103+
defaults.DARWIN_DEPLOYMENT_VERSION_TVOS,
104+
'darwin_deployment_version_watchos':
105+
defaults.DARWIN_DEPLOYMENT_VERSION_WATCHOS,
106+
'darwin_xcrun_toolchain':
107+
defaults.DARWIN_XCRUN_TOOLCHAIN,
100108
'distcc': False,
101109
'dry_run': False,
102110
'enable_asan': False,
@@ -114,8 +122,10 @@
114122
'host_cxx': None,
115123
'host_libtool': None,
116124
'host_lipo': None,
125+
# FIXME: determine actual default value rather than hardcode
117126
'host_target': 'macosx-x86_64',
118127
'host_test': False,
128+
# FIXME: determine actual default value rather than hardcode
119129
'install_prefix': '/Applications/Xcode.app/Contents/Developer/Toolchains/'
120130
'XcodeDefault.xctoolchain/usr',
121131
'install_symroot': None,
@@ -147,14 +157,14 @@
147157
'appletvos-arm64',
148158
'watchos-armv7k'
149159
],
150-
'swift_analyze_code_coverage': 'false',
160+
'swift_analyze_code_coverage': defaults.SWIFT_ANALYZE_CODE_COVERAGE,
151161
'swift_assertions': True,
152162
'swift_build_variant': 'Debug',
153163
'swift_compiler_version': None,
154164
'swift_stdlib_assertions': True,
155165
'swift_stdlib_build_variant': 'Debug',
156166
'swift_tools_max_parallel_lto_link_jobs': 0,
157-
'swift_user_visible_version': '4.1',
167+
'swift_user_visible_version': defaults.SWIFT_USER_VISIBLE_VERSION,
158168
'symbols_package': None,
159169
'test': None,
160170
'test_android_host': False,

0 commit comments

Comments
 (0)