|
24 | 24 |
|
25 | 25 | # from swift_build_support import cmake |
26 | 26 | from swift_build_support import shell |
27 | | -# from swift_build_support.products import CMark |
| 27 | +from swift_build_support.products import CMark |
28 | 28 | from swift_build_support.targets import StdlibDeploymentTarget |
29 | 29 | from swift_build_support.toolchain import host_toolchain |
30 | 30 | from swift_build_support.workspace import Workspace |
@@ -113,3 +113,31 @@ def test_build(self): |
113 | 113 | # cmake=self.toolchain.cmake, |
114 | 114 | # cmake_args=' '.join(_cmake.common_options()), |
115 | 115 | # 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