Skip to content

Commit 7ca2301

Browse files
authored
Merge pull request #37852 from drexin/wip-fix-skip-test-cmark
[Build] Fix --skip-test-cmark
2 parents a9d0bfb + 2d04ed0 commit 7ca2301

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed

utils/build_swift/build_swift/driver_arguments.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ def _apply_default_arguments(args):
183183
args.test_tvos = False
184184
args.test_watchos = False
185185
args.test_android = False
186+
args.test_cmark = False
186187
args.test_swiftpm = False
187188
args.test_swift_driver = False
188189
args.test_swiftsyntax = False
@@ -1069,6 +1070,8 @@ def create_argument_parser():
10691070
help='skip cleaning up swiftpm')
10701071
option('--skip-clean-swift-driver', toggle_false('clean_swift_driver'),
10711072
help='skip cleaning up Swift driver')
1073+
option('--skip-test-cmark', toggle_false('test_cmark'),
1074+
help='skip testing cmark')
10721075
option('--skip-test-swiftpm', toggle_false('test_swiftpm'),
10731076
help='skip testing swiftpm')
10741077
option('--skip-test-swift-driver', toggle_false('test_swift_driver'),

utils/build_swift/tests/expected_options.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@
247247
'test_watchos_host': False,
248248
'test_watchos_simulator': False,
249249
'test_playgroundsupport': True,
250+
'test_cmark': False,
250251
'test_swiftpm': False,
251252
'test_swift_driver': False,
252253
'test_swiftsyntax': False,
@@ -620,6 +621,7 @@ class BuildScriptImplOption(_BaseOption):
620621
dest='test_watchos_simulator'),
621622
DisableOption('--skip-test-playgroundsupport',
622623
dest='test_playgroundsupport'),
624+
DisableOption('--skip-test-cmark', dest='test_cmark'),
623625
DisableOption('--skip-test-swiftpm', dest='test_swiftpm'),
624626
DisableOption('--skip-test-swift-driver', dest='test_swift_driver'),
625627
DisableOption('--skip-test-swiftsyntax', dest='test_swiftsyntax'),

utils/swift_build_support/swift_build_support/products/cmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def should_test(self, host_target):
8686
if self.is_cross_compile_target(host_target):
8787
return False
8888

89-
return self.args.test
89+
return self.args.test_cmark
9090

9191
def test(self, host_target):
9292
"""

utils/swift_build_support/tests/products/test_cmark.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
# from swift_build_support import cmake
2626
from swift_build_support import shell
27-
# from swift_build_support.products import CMark
27+
from swift_build_support.products import CMark
2828
from swift_build_support.targets import StdlibDeploymentTarget
2929
from swift_build_support.toolchain import host_toolchain
3030
from swift_build_support.workspace import Workspace
@@ -113,3 +113,31 @@ def test_build(self):
113113
# cmake=self.toolchain.cmake,
114114
# cmake_args=' '.join(_cmake.common_options()),
115115
# build_variant=self.args.cmark_build_variant))
116+
117+
def test_should_test(self):
118+
cmark = CMark(
119+
args=argparse.Namespace(test_cmark=True, cross_compile_hosts=[]),
120+
toolchain=self.toolchain,
121+
source_dir=self.workspace.source_root,
122+
build_dir=self.workspace.build_root)
123+
124+
self.assertTrue(cmark.should_test(self.host.name))
125+
126+
def test_should_skip_test(self):
127+
cmark = CMark(
128+
args=argparse.Namespace(test_cmark=False, cross_compile_hosts=[]),
129+
toolchain=self.toolchain,
130+
source_dir=self.workspace.source_root,
131+
build_dir=self.workspace.build_root)
132+
133+
self.assertFalse(cmark.should_test(self.host.name))
134+
135+
def test_should_skip_test_cross_compile(self):
136+
cmark = CMark(
137+
args=argparse.Namespace(test_cmark=True,
138+
cross_compile_hosts=[self.host.name]),
139+
toolchain=self.toolchain,
140+
source_dir=self.workspace.source_root,
141+
build_dir=self.workspace.build_root)
142+
143+
self.assertFalse(cmark.should_test(self.host.name))

0 commit comments

Comments
 (0)