mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/build_test_better_errors' into 'master'
test(build_system): print failed command and output when test fails See merge request espressif/esp-idf!32962
This commit is contained in:
commit
f789b4eb45
@ -90,10 +90,17 @@ def run_idf_py(*args: str,
|
|||||||
]
|
]
|
||||||
cmd += args # type: ignore
|
cmd += args # type: ignore
|
||||||
logging.debug('running {} in {}'.format(' '.join(cmd), workdir))
|
logging.debug('running {} in {}'.format(' '.join(cmd), workdir))
|
||||||
return subprocess.run(
|
try:
|
||||||
cmd, env=env, cwd=workdir,
|
return subprocess.run(
|
||||||
check=check, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
cmd, env=env, cwd=workdir,
|
||||||
text=True, encoding='utf-8', errors='backslashreplace', input=input_str)
|
check=check, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||||
|
text=True, encoding='utf-8', errors='backslashreplace', input=input_str)
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
logging.error('The following idf.py command has failed: {}'.format(' '.join(cmd)))
|
||||||
|
logging.error('Working directory: {}'.format(workdir))
|
||||||
|
logging.error('Stdout: {}'.format(e.stdout))
|
||||||
|
logging.error('Stderr: {}'.format(e.stderr))
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
def run_cmake(*cmake_args: str,
|
def run_cmake(*cmake_args: str,
|
||||||
@ -120,10 +127,17 @@ def run_cmake(*cmake_args: str,
|
|||||||
cmd = ['cmake'] + list(cmake_args)
|
cmd = ['cmake'] + list(cmake_args)
|
||||||
|
|
||||||
logging.debug('running {} in {}'.format(' '.join(cmd), build_dir))
|
logging.debug('running {} in {}'.format(' '.join(cmd), build_dir))
|
||||||
return subprocess.run(
|
try:
|
||||||
cmd, env=env, cwd=build_dir,
|
return subprocess.run(
|
||||||
check=check, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
cmd, env=env, cwd=build_dir,
|
||||||
text=True, encoding='utf-8', errors='backslashreplace')
|
check=check, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||||
|
text=True, encoding='utf-8', errors='backslashreplace')
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
logging.error('The following cmake command has failed: {}'.format(' '.join(cmd)))
|
||||||
|
logging.error('Working directory: {}'.format(workdir))
|
||||||
|
logging.error('Stdout: {}'.format(e.stdout))
|
||||||
|
logging.error('Stderr: {}'.format(e.stderr))
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
def run_cmake_and_build(*cmake_args: str, env: typing.Optional[EnvDict] = None) -> None:
|
def run_cmake_and_build(*cmake_args: str, env: typing.Optional[EnvDict] = None) -> None:
|
||||||
|
Loading…
Reference in New Issue
Block a user