Fix errors

This commit is contained in:
Regen
2019-11-16 02:32:28 +09:00
parent 6b591f7146
commit d08448340e
3 changed files with 17 additions and 15 deletions

View File

@@ -50,7 +50,8 @@ class API(object):
proc = subprocess.run([self._cmake, self._build],
universal_newlines=True,
capture_output=True)
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
self.query_json.unlink()
self.query_json.parent.rmdir()
if proc.returncode != 0:
@@ -133,7 +134,8 @@ endforeach()
p = subprocess.run([self._cmake, '-P', tmplist],
cwd=cmake_files['paths']['source'],
universal_newlines=True,
capture_output=True)
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
if p.returncode != 0:
return

View File

@@ -1,18 +1,16 @@
import logging
import pytest
@pytest.fixture()
def cmake_build(shared_datadir):
from subprocess import run
from subprocess import run, PIPE
source = shared_datadir / 'cmake'
build = source / 'build'
build.mkdir()
p = run(['cmake', '-S', source, '-B', build],
check=True,
capture_output=True,
universal_newlines=True)
logging.debug(p.stdout)
logging.debug(p.stderr)
run(['cmake', source],
check=True,
cwd=build,
stdout=PIPE,
stderr=PIPE,
universal_newlines=True)
yield build

View File

@@ -43,8 +43,9 @@ def test_parse_commands(cmake_build):
api.parse_doc()
p = subprocess.run(['cmake', '--help-command-list'],
capture_output=True,
universal_newlines=True)
universal_newlines=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
commands = p.stdout.strip().split('\n')
for command in commands:
@@ -59,8 +60,9 @@ def test_parse_variables(cmake_build):
api.parse_doc()
p = subprocess.run(['cmake', '--help-variable-list'],
capture_output=True,
universal_newlines=True)
universal_newlines=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
variables = p.stdout.strip().split('\n')
for variable in variables: