Skip to content

Commit 4b6d7b9

Browse files
committed
Merge pull request #778 from modocache/add-python-unit-tests-to-build
[test] Run Python unit tests in validation tests
2 parents 6568945 + 0ede0c4 commit 4b6d7b9

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

docs/Testing.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ Other substitutions:
313313
* ``%platform-sdk-overlay-dir``: absolute path of the directory where the SDK
314314
overlay module files for the target platform are stored.
315315

316+
* ``%{python}``: run the same Python interpreter that's being used to run the
317+
current ``lit`` test.
316318

317319
When writing a test where output (or IR, SIL) depends on the bitness of the
318320
target CPU, use this pattern::

test/lit.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import os
2222
import platform
2323
import re
2424
import subprocess
25+
import sys
2526
import tempfile
2627

2728
import lit.formats
@@ -271,6 +272,7 @@ completion_cache_path = tempfile.mkdtemp(prefix="swift-testsuite-completion-cach
271272
ccp_opt = "-completion-cache-path %r" % completion_cache_path
272273
lit_config.note("Using code completion cache: " + completion_cache_path)
273274

275+
config.substitutions.append( ('%{python}', sys.executable) )
274276
config.substitutions.append( ('%mcp_opt', mcp_opt) )
275277
config.substitutions.append( ('%swift_driver_plain', "%r" % config.swift) )
276278
config.substitutions.append( ('%swiftc_driver_plain', "%r" % config.swiftc) )
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// RUN: %{python} -m unittest discover -s %S/../../utils/cmpcodesize

0 commit comments

Comments
 (0)