[llvm-commits] [llvm] r110171 - /llvm/trunk/utils/lit/lit/TestRunner.py

Daniel Dunbar daniel at zuster.org
Wed Aug 4 00:36:56 PDT 2010


Hi Dan,

The problem with this change is that it becomes very non-obvious from
reading a test report why it is failing. Clang's tests don't have the
error-on-stderr property, so I always appreciate the reminder when
looking at a test report. I think it would make sense to make sure a
note about this ends up somewhere in the output.

 - Daniel

On Tue, Aug 3, 2010 at 5:12 PM, Dan Gohman <gohman at apple.com> wrote:
> Author: djg
> Date: Tue Aug  3 19:12:31 2010
> New Revision: 110171
>
> URL: http://llvm.org/viewvc/llvm-project?rev=110171&view=rev
> Log:
> Change the logic which interprets output on stderr as an error so that
> it doesn't modify the exit code or the stdout contents, and so that it
> doesn't clutter the output with "Command has output on stderr!".
>
> Modified:
>    llvm/trunk/utils/lit/lit/TestRunner.py
>
> Modified: llvm/trunk/utils/lit/lit/TestRunner.py
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestRunner.py?rev=110171&r1=110170&r2=110171&view=diff
> ==============================================================================
> --- llvm/trunk/utils/lit/lit/TestRunner.py (original)
> +++ llvm/trunk/utils/lit/lit/TestRunner.py Tue Aug  3 19:12:31 2010
> @@ -312,11 +312,6 @@
>         out,err,exitCode = executeCommand(command, cwd=cwd,
>                                           env=test.config.environment)
>
> -        # Tcl commands fail on standard error output.
> -        if err:
> -            exitCode = 1
> -            out = 'Command has output on stderr!\n\n' + out
> -
>         return out,err,exitCode
>     else:
>         results = []
> @@ -328,11 +323,6 @@
>
>     out = err = ''
>
> -    # Tcl commands fail on standard error output.
> -    if [True for _,_,err,res in results if err]:
> -        exitCode = 1
> -        out += 'Command has output on stderr!\n\n'
> -
>     for i,(cmd, cmd_out, cmd_err, res) in enumerate(results):
>         out += 'Command %d: %s\n' % (i, ' '.join('"%s"' % s for s in cmd.args))
>         out += 'Command %d Result: %r\n' % (i, res)
> @@ -521,12 +511,14 @@
>     if len(res) == 2:
>         return res
>
> +    # Test for failure. In addition to the exit code, Tcl commands fail
> +    # if there is any standard error output.
>     out,err,exitCode = res
>     if isXFail:
> -        ok = exitCode != 0
> +        ok = exitCode != 0 or err
>         status = Test.XFAIL if ok else Test.XPASS
>     else:
> -        ok = exitCode == 0
> +        ok = exitCode == 0 and not err
>         status = Test.PASS if ok else Test.FAIL
>
>     if ok:
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>




More information about the llvm-commits mailing list