Skip to content

Commit f38192d

Browse files
authored
Merge pull request #16123 from compnerd/join
test: construct paths using python
2 parents 8ef98b8 + 2ff48c1 commit f38192d

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

test/lit.cfg

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -326,14 +326,14 @@ config.swift_frontend_test_options = os.environ.get('SWIFT_FRONTEND_TEST_OPTIONS
326326
config.swift_driver_test_options = os.environ.get('SWIFT_DRIVER_TEST_OPTIONS', '')
327327
config.sil_test_options = os.environ.get('SIL_TEST_OPTIONS', '')
328328

329-
clang_module_cache_path = config.swift_test_results_dir + "/clang-module-cache"
329+
clang_module_cache_path = os.path.join(config.swift_test_results_dir, "clang-module-cache")
330330
shutil.rmtree(clang_module_cache_path, ignore_errors=True)
331331
mcp_opt = "-module-cache-path %r" % clang_module_cache_path
332332
clang_mcp_opt = "-fmodules-cache-path=%r" % clang_module_cache_path
333333
lit_config.note("Using Clang module cache: " + clang_module_cache_path)
334334
lit_config.note("Using test results dir: " + config.swift_test_results_dir)
335335

336-
completion_cache_path = config.swift_test_results_dir + "/completion-cache"
336+
completion_cache_path = os.path.join(config.swift_test_results_dir, "completion-cache")
337337
shutil.rmtree(completion_cache_path, ignore_errors=True)
338338
ccp_opt = "-completion-cache-path %r" % completion_cache_path
339339
lit_config.note("Using code completion cache: " + completion_cache_path)
@@ -379,23 +379,16 @@ config.substitutions.append(
379379
'%target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -emit-module -o %t %clang-importer-sdk-path/swift-modules/Foundation.swift'))
380380

381381
# FIXME: BEGIN -enable-source-import hackaround
382-
config.substitutions.append(
383-
('%clang-importer-sdk-path',
384-
'%r/Inputs/clang-importer-sdk' %
385-
(config.test_source_root) ) )
382+
config.substitutions.append(('%clang-importer-sdk-path',
383+
'%r' % (os.path.join(config.test_source_root, 'Inputs', 'clang-importer-sdk'))))
386384

387-
config.substitutions.append(
388-
('%clang-importer-sdk-nosource',
389-
'-sdk %r/Inputs/clang-importer-sdk ' %
390-
(config.test_source_root) ) )
385+
config.substitutions.append(('%clang-importer-sdk-nosource',
386+
'-sdk %r' % (os.path.join(config.test_source_root, 'Inputs', 'clang-importer-sdk'))))
391387
# FIXME: END -enable-source-import hackaround
392388

393-
config.substitutions.append(
394-
('%clang-importer-sdk',
395-
'-enable-source-import '
396-
'-sdk %r/Inputs/clang-importer-sdk '
397-
'-I %r/Inputs/clang-importer-sdk/swift-modules ' %
398-
(config.test_source_root, config.test_source_root) ) )
389+
config.substitutions.append(('%clang-importer-sdk',
390+
'-enable-source-import -sdk %r -I %r ' % (os.path.join(config.test_source_root, 'Inputs', 'clang-importer-sdk'),
391+
os.path.join(config.test_source_root, 'Inputs', 'clang-importer-sdk', 'swift-modules'))))
399392

400393
config.substitutions.append( ('%clang_apinotes',
401394
"%r -cc1apinotes" %

0 commit comments

Comments
 (0)