Wiki
Show
Ignore:
Timestamp:
03/12/10 09:25:11 (2 years ago)
Author:
Chuck.Esterbrook
Message:

An above error about numeric types indicates that you may want to set the default numeric type with "@number [expectedType]" in a source file or "cobra -number:[expectedType]" at the command line.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cobra/trunk/Source/TestifyRunner.cobra

    r2252 r2315  
    419419            index = firstLine.indexOf('.warning.') 
    420420            warning = firstLine.substring(index+9).trim.toLower 
    421             return _testifyHeadWarning(warning, compilerVerbosity, fileNames, options, verbose)  
     421            return _testifyHeadWarning(warning, false, compilerVerbosity, fileNames, options, verbose)  
     422 
     423        if firstLineInsensitive.startsWith('#.warning-lax.') 
     424            # deprecated: put warnings on the lines where they occur. the "hasInlineMessages" code above will detect them. 
     425            index = firstLine.indexOf('.warning-lax.') 
     426            warning = firstLine.substring(index+13).trim.toLower 
     427            return _testifyHeadWarning(warning, true, compilerVerbosity, fileNames, options, verbose)  
    422428 
    423429        return _testifyStd(compilerVerbosity, fileNames, options, verbose) 
     
    509515                return 0 
    510516                 
    511             if firstLineInsensitive.startsWith('#.error.') or firstLineInsensitive.startsWith('#.warning.') 
     517            if firstLineInsensitive.startsWith('#.error.') or firstLineInsensitive.startsWith('#.warning.') or firstLineInsensitive.startsWith('#.warning-lax.') 
    512518                # these are handled below 
    513519                break 
     
    639645        return 1 
    640646 
    641     def _testifyHeadWarning(warning as String, compilerVerbosity as int, fileNames as IList<of String>, 
     647    def _testifyHeadWarning(warning as String, lax as bool, compilerVerbosity as int, fileNames as IList<of String>, 
    642648                            options as OptionValues, verbose as bool) as int  
    643649        # TODO: the following code both checks for warnings to be thrown as well as going through a list of warnings. Seems like it should just need to do one or the other. 
     
    646652            c.testifyFilesNamed(fileNames, options, _resultsWriter to !, verbose) 
    647653        catch StopCompilation 
    648             print 'Expecting warning substring: "[warning]"' 
    649             print 'But got errors.' 
    650             .failed 
    651             return 0 
     654            if not lax 
     655                print 'Expecting warning substring: "[warning]"' 
     656                print 'But got errors.' 
     657                .failed 
     658                return 0 
    652659        catch exc as Exception 
    653660            print 'Internal exception: [exc]'