Skip to content

Commit cc76ab8

Browse files
committed
imp(Errors): writes errors to stderr
Closes #154
1 parent 0aca29b commit cc76ab8

File tree

4 files changed

+150
-130
lines changed

4 files changed

+150
-130
lines changed

Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ color = ["ansi_term"]
2020
# for building with nightly and unstable features
2121
unstable=[]
2222

23+
# for building with debug messages
24+
debug=[]
25+
2326
[dependencies.strsim]
2427
version = "0.4.0"
2528
optional = true

clap-tests/run_tests.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,15 @@ def pass_fail(name, check, good):
298298

299299
def main():
300300
for cmd, cmd_v in cmds.items():
301-
proc = subprocess.Popen(cmd_v[0], shell=True, stdout=subprocess.PIPE, universal_newlines=True)
302-
out = _ansi.sub('', proc.communicate()[0].strip())
303-
pass_fail(cmd, out, cmd_v[1])
301+
proc = subprocess.Popen(cmd_v[0], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
302+
out, err = proc.communicate()
303+
out = _ansi.sub('', out.strip())
304+
err = _ansi.sub('', err.strip())
305+
if out:
306+
pass_fail(cmd, out, cmd_v[1])
307+
else:
308+
pass_fail(cmd, err, cmd_v[1])
309+
304310
if failed:
305311
print('One or more tests failed')
306312
return 1

0 commit comments

Comments
 (0)