Return failure code on failure; DM-1027

I thought that an external script was an even worse solution.  I should ask the scons list if there's a better solution (a keyword arg?)

        R

> On 19 Aug 2014, at 04:30, ktlim <notifications@github.com> wrote:
> 
> In python/lsst/sconsUtils/scripts.py:
> 
> > +        #
> > +        if "tests" in [str(t) for t in BUILD_TARGETS]:
> > +            def __checkTestStatus( target, source, env ):
> > +                """See if any tests failed"""
> > +                import glob
> > +                nFailed = len(glob.glob(os.path.join(os.getcwd(), "tests", ".tests", "*.failed")))
> > +                if nFailed > 0:
> > +                    raise SCons.Errors.BuildError(errstr="%d tests failed" % nFailed)
> > +
> > +            checkTestStatus_command = state.env.Command('checkTestStatus', [], __checkTestStatus)
> > +
> > +            state.env.Depends(checkTestStatus_command, BUILD_TARGETS) # this is why the check runs last
> > +            BUILD_TARGETS.extend(checkTestStatus_command)
> > +            state.env.AlwaysBuild(checkTestStatus_command)
> > +            #
> > +            # We don't want to clutter up the output with our check for failed tests
> Can't you have the Command action be an actual shell script to look for and count the ".failed" files, thus enabling it to be "@"-prefixed?
> 
> —
> Reply to this email directly or view it on GitHub.