Ignore:
Timestamp:
04/12/12 09:41:11 (2 years ago)
Author:
jdsiiro
Message:
  • Cleaning up the separation of "normal" output and "warning/error" output. Warnings and errors now go to stderr (where they belong, see #3924).
  • Removing debugging output accidentally left in code
File:
1 edited

Legend:

Unmodified
Added
Removed
  • gcovr/trunk/scripts/gcovr

    r2764 r2765  
    2525# For more information, see the FAST README.txt file. 
    2626# 
    27 # $Revision 2764 $ 
    28 # $Date 2012-04-11 17:11:06 -0700 (Wed, 11 Apr 2012) $ 
     27# $Revision 2765 $ 
     28# $Date 2012-04-12 09:41:11 -0700 (Thu, 12 Apr 2012) $ 
    2929# _________________________________________________________________________ 
    3030# 
     
    4444 
    4545__version__ = "2.4-prerelease" 
    46 src_revision = "$Revision 2764 $" 
     46src_revision = "$Revision 2765 $" 
    4747gcov_cmd = "gcov" 
    4848 
     
    210210            if match_found: 
    211211                sys.stderr.write( 
    212                     "ERROR: violating fundamental assumption while walking " 
     212                    "(ERROR) violating fundamental assumption while walking " 
    213213                    "directory tree.\n\tPlease report this to the gcovr " 
    214214                    "developers.\n" ) 
     
    415415            #first_record=True 
    416416        else: 
    417             sys.stdout.write("UNKNOWN LINE DATA: %s\n" % tmp) 
     417            sys.stderr.write( 
     418                "(WARNING) Unrecognized GCOV output: '%s'\n" 
     419                "\tThis is indicitive of a gcov output parse error.\n" 
     420                "\tPlease report this to the gcovr developers." % tmp ) 
    418421    # 
    419422    # If the file is already in covdata, then we 
     
    586589         
    587590    if not Done: 
    588         sys.stdout.write("GCOV produced the following errors processing %s:\n   %s" \ 
    589               "(gcovr could not infer a working directory " \ 
    590               "that resolved it.)\n" % ( filename, "   ".join(errors) )) 
     591        sys.stderr.write( 
     592            "(WARNING) GCOV produced the following errors processing %s:\n" 
     593            "\t   %s"  
     594            "\t(gcovr could not infer a working directory that resolved it.)\n" 
     595            % ( filename, "\t   ".join(errors) ) ) 
    591596 
    592597# 
     
    791796            elif cwd.startswith(d): 
    792797                i = 1 
    793                 sys.stdout.write(d+'\n') 
    794                 sys.stdout.write(os.path.join(*tuple([cwd]+['..']*i)) + '\n') 
    795798                while normpath(d) != \ 
    796799                          normpath(os.path.join(*tuple([cwd]+['..']*i))): 
     
    906909(options, args) = parser.parse_args(args=sys.argv) 
    907910if options.version: 
    908     sys.stdout.write("gcovr %s\n" % (version_str(),)) 
    909     sys.stdout.write("\n") 
    910     sys.stdout.write("Copyright (2008) Sandia Corporation. Under the terms of Contract \n") 
    911     sys.stdout.write("DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government \n") 
    912     sys.stdout.write("retains certain rights in this software.\n") 
     911    sys.stdout.write( 
     912        "gcovr %s\n" 
     913        "\n" 
     914        "Copyright (2008) Sandia Corporation. Under the terms of Contract\n" 
     915        "DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government\n" 
     916        "retains certain rights in this software.\n" 
     917        % (version_str(),) ) 
    913918    sys.exit(0) 
    914919if options.objdir: 
    915     if normpath(options.objdir) != options.objdir.replace('/',os.sep): 
    916         sys.stdout.write("WARNING: relative referencing in --object-directory; this could\n") 
    917         sys.stdout.write("         cause strange errors when gcovr attempts to identify\n") 
    918         sys.stdout.write("         the original gcc working directory.\n") 
     920    tmp = options.objdir.replace('/',os.sep).replace('\\',os.sep) 
     921    while os.sep+os.sep in tmp: 
     922        tmp = tmp.replace(os.sep+os.sep, os.sep) 
     923    if normpath(options.objdir) != tmp: 
     924        sys.stderr.write( 
     925            "(WARNING) relative referencing in --object-directory.\n" 
     926            "\tthis could cause strange errors when gcovr attempts to\n" 
     927            "\tidentify the original gcc working directory.\n") 
    919928# 
    920929# Setup filters 
     
    926935elif options.root is not None: 
    927936    if not options.root: 
    928         sys.stderr.write("ERROR: empty --root option.\n" 
    929                          "   Root specifies the path to the root directory of your project: " 
    930                          "cannot be an empty string.\n") 
     937        sys.stderr.write( 
     938            "(ERROR) empty --root option.\n" 
     939            "\tRoot specifies the path to the root directory of your project\n" 
     940            "\tand cannot be an empty string.\n") 
    931941        sys.exit(1) 
    932942    options.filter = re.compile(re.escape(os.path.abspath(options.root)+os.sep)) 
Note: See TracChangeset for help on using the changeset viewer.