Skip to content

Commit

Permalink
imp(Errors): writes errors to stderr
Browse files Browse the repository at this point in the history
Closes #154
  • Loading branch information
kbknapp committed Jul 11, 2015
1 parent 0aca29b commit cc76ab8
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 130 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ color = ["ansi_term"]
# for building with nightly and unstable features
unstable=[]

# for building with debug messages
debug=[]

[dependencies.strsim]
version = "0.4.0"
optional = true
Expand Down
12 changes: 9 additions & 3 deletions clap-tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,15 @@ def pass_fail(name, check, good):

def main():
for cmd, cmd_v in cmds.items():
proc = subprocess.Popen(cmd_v[0], shell=True, stdout=subprocess.PIPE, universal_newlines=True)
out = _ansi.sub('', proc.communicate()[0].strip())
pass_fail(cmd, out, cmd_v[1])
proc = subprocess.Popen(cmd_v[0], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
out, err = proc.communicate()
out = _ansi.sub('', out.strip())
err = _ansi.sub('', err.strip())
if out:
pass_fail(cmd, out, cmd_v[1])
else:
pass_fail(cmd, err, cmd_v[1])

if failed:
print('One or more tests failed')
return 1
Expand Down
Loading

0 comments on commit cc76ab8

Please sign in to comment.