Skip to content

Commit d655c3d

Browse files
committed
test: improve test coverage rate for Windows
Strip the use of `env` on Windows which will swallow the error code if the GnuWin32 version (which is recommended/used by LLVM) is used. Since SDKROOT should not be set on Windows anyways, this should not matter much in practice but will help improve the test coverage on Windows. Additionally, remove the path lowercasing on Windows as the path is kept in the proper case, even on the nightlies. This should help improve the number of Driver tests that pass. With this change, I now can get all the Driver tests to pass locally.
1 parent f157cdc commit d655c3d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/lit.cfg

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,12 @@ config.substitutions.append( ('%{python}', sys.executable) )
370370
config.substitutions.append( ('%mcp_opt', mcp_opt) )
371371
config.substitutions.append( ('%swift_driver_plain', "%r" % config.swift) )
372372
config.substitutions.append( ('%swiftc_driver_plain', "%r" % config.swiftc) )
373-
config.substitutions.append( ('%swift_driver', "env SDKROOT= %r %s %s %s" % (config.swift, mcp_opt, config.swift_test_options, config.swift_driver_test_options)) )
374-
config.substitutions.append( ('%swiftc_driver', "env SDKROOT= %r %s %s %s" % (config.swiftc, mcp_opt, config.swift_test_options, config.swift_driver_test_options)) )
373+
if kIsWindows:
374+
config.substitutions.append( ('%swift_driver', "%r %s %s %s" % (config.swift, mcp_opt, config.swift_test_options, config.swift_driver_test_options)) )
375+
config.substitutions.append( ('%swiftc_driver', "%r %s %s %s" % (config.swiftc, mcp_opt, config.swift_test_options, config.swift_driver_test_options)) )
376+
else:
377+
config.substitutions.append( ('%swift_driver', "env SDKROOT= %r %s %s %s" % (config.swift, mcp_opt, config.swift_test_options, config.swift_driver_test_options)) )
378+
config.substitutions.append( ('%swiftc_driver', "env SDKROOT= %r %s %s %s" % (config.swiftc, mcp_opt, config.swift_test_options, config.swift_driver_test_options)) )
375379
config.substitutions.append( ('%sil-opt', "%r %s %s" % (config.sil_opt, mcp_opt, config.sil_test_options)) )
376380
config.substitutions.append( ('%sil-func-extractor', "%r %s" % (config.sil_func_extractor, mcp_opt)) )
377381
config.substitutions.append( ('%sil-llvm-gen', "%r %s" % (config.sil_llvm_gen, mcp_opt)) )
@@ -1379,8 +1383,7 @@ config.substitutions.append(('%FileCheck',
13791383
'%r %r --sanitize BUILD_DIR=%r --sanitize SOURCE_DIR=%r --use-filecheck %r' % (
13801384
sys.executable,
13811385
config.PathSanitizingFileCheck,
1382-
# Match lit/python, which, on Windows, normalizes path case (lowercases)
1383-
swift_obj_root.lower() if kIsWindows else swift_obj_root,
1386+
swift_obj_root,
13841387
config.swift_src_root,
13851388
config.filecheck)))
13861389
config.substitutions.append(('%raw-FileCheck', pipes.quote(config.filecheck)))

0 commit comments

Comments
 (0)