3
3
import pytest
4
4
import textwrap
5
5
6
- from path import Path
6
+ from path import Path , matchers
7
7
8
8
DIST_DIR = os .path .abspath (os .path .join (os .path .dirname (__file__ ), '../dist' ))
9
9
@@ -26,6 +26,26 @@ def _check_cmake_install(virtualenv, tmpdir):
26
26
assert output [:len (expected )].lower () == expected .lower ()
27
27
28
28
29
+ @pytest .mark .skipif (not Path (DIST_DIR ).exists (), reason = "dist directory does not exist" )
30
+ def test_source_distribution (virtualenv , tmpdir ):
31
+ sdists = Path (DIST_DIR ).files (match = matchers .CaseInsensitive ("*.tar.gz" ))
32
+ if not sdists :
33
+ pytest .skip ("no source distribution available" )
34
+ assert len (sdists ) == 1
35
+
36
+ skbuild_configure_options = "-DCMAKE_JOB_POOL_COMPILE:STRING=compile"
37
+ skbuild_configure_options += " -DCMAKE_JOB_POOL_LINK:STRING=link"
38
+ skbuild_configure_options += " '-DCMAKE_JOB_POOLS:STRING=compile=4;link=3'"
39
+ if os .path .exists ("/usr/local/ssl" ):
40
+ skbuild_configure_options = "-DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl " + skbuild_configure_options
41
+
42
+ virtualenv .env ["SKBUILD_CONFIGURE_OPTIONS" ] = skbuild_configure_options
43
+ virtualenv .run ("pip install %s" % sdists [0 ])
44
+ assert "cmake" in virtualenv .installed_packages ()
45
+
46
+ _check_cmake_install (virtualenv , tmpdir )
47
+
48
+
29
49
@pytest .mark .skipif (not Path (DIST_DIR ).exists (), reason = "dist directory does not exist" )
30
50
def test_wheel (virtualenv , tmpdir ):
31
51
wheels = Path (DIST_DIR ).files (match = "*.whl" )
0 commit comments