[cfe-commits] r77072 - in /cfe/trunk/utils/test: MultiTestRunner.pyTestRunner.py

Daniel Dunbar daniel at zuster.org
Sat Jul 25 15:15:05 PDT 2009


On Sat, Jul 25, 2009 at 11:30 AM, Nuno Lopes<nunoplopes at sapo.pt> wrote:
> Hi,
>
> What's the problem with valgrind? It was working well last time I tried it
> (last week or so). Now you even have official support from valgrind for
> Darwin.. :)
> I think it's very helpful to be able to run the tests under valgrind.
> Although it takes a while, it's a cheap way to find bugs.

Nothing, valgrind is awesome! I don't think anyone uses it regularly,
and I wanted to cut out as many unused features so I could gut some
parts of the test runner. I fully plan on adding it back...

 - Daniel

> ----- Original Message -----
>>
>> Author: ddunbar
>> Date: Sat Jul 25 08:13:06 2009
>> New Revision: 77072
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=77072&view=rev
>> Log:
>> MultiTestRunner: Disable valgrind support for now, I don't feel like
>> maintaining
>> it currently.
>>
>> Modified:
>>   cfe/trunk/utils/test/MultiTestRunner.py
>>   cfe/trunk/utils/test/TestRunner.py
>>
>> Modified: cfe/trunk/utils/test/MultiTestRunner.py
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/test/MultiTestRunner.py?rev=77072&r1=77071&r2=77072&view=diff
>>
>>
>> ==============================================================================
>> --- cfe/trunk/utils/test/MultiTestRunner.py (original)
>> +++ cfe/trunk/utils/test/MultiTestRunner.py Sat Jul 25 08:13:06 2009
>> @@ -172,7 +172,6 @@
>>                startTime = time.time()
>>                code = TestRunner.runOneTest(path, command, output,
>> testname,
>>                                             opts.clang, opts.clangcc,
>> - useValgrind=opts.useValgrind,
>>                                             useDGCompat=opts.useDGCompat,
>>                                             useScript=opts.testScript,
>>                                             output=open(testresults,'w'))
>> @@ -267,6 +266,9 @@
>>
>>    if not args:
>>        parser.error('No inputs specified')
>> +    if opts.useValgrind:
>> +        parser.error('Support for running with valgrind is '
>> +                     'temporarily disabled')
>>
>>    if opts.clang is None:
>>        opts.clang = TestRunner.inferClang()
>>
>> Modified: cfe/trunk/utils/test/TestRunner.py
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/test/TestRunner.py?rev=77072&r1=77071&r2=77072&view=diff
>>
>>
>> ==============================================================================
>> --- cfe/trunk/utils/test/TestRunner.py (original)
>> +++ cfe/trunk/utils/test/TestRunner.py Sat Jul 25 08:13:06 2009
>> @@ -69,17 +69,10 @@
>>    f.close()
>>
>> def runOneTest(FILENAME, SUBST, OUTPUT, TESTNAME, CLANG, CLANGCC,
>> -               useValgrind=False,
>>               useDGCompat=False,
>>               useScript=None,
>>               output=sys.stdout):
>>    OUTPUT = os.path.abspath(OUTPUT)
>> -    if useValgrind:
>> -        VG_OUTPUT = '%s.vg'%(OUTPUT,)
>> -        os.system('rm -f %s.*'%(VG_OUTPUT))
>> -        VALGRIND = 'valgrind -q --tool=memcheck --leak-check=full
>> --trace-children=yes --log-file=%s.%%p'%(VG_OUTPUT)
>> -        CLANG    = '%s %s'%(VALGRIND, CLANG)
>> -        CLANGCC  = '%s %s'%(VALGRIND, CLANGCC)
>>
>>    # Create the output directory if it does not already exist.
>>    mkdir_p(os.path.dirname(OUTPUT))
>> @@ -174,9 +167,9 @@
>>    f = open(SCRIPT,'w')
>>    if kSystemName == 'Windows':
>>        f.write('\nif %ERRORLEVEL% NEQ 0 EXIT\n'.join(scriptLines))
>> -        f.write('\n')
>>    else:
>>        f.write(' &&\n'.join(scriptLines))
>> +    f.write('\n')
>>    f.close()
>>
>>    outputFile = open(OUTPUT,'w')
>> @@ -208,16 +201,7 @@
>>    if xfailLines:
>>        SCRIPT_STATUS = not SCRIPT_STATUS
>>
>> -    if useValgrind:
>> -        if kSystemName == 'Windows':
>> -            raise NotImplementedError,'Cannot run valgrind on windows'
>> -        else:
>> -            VG_OUTPUT = capture(['/bin/sh','-c','cat %s.*'%(VG_OUTPUT)])
>> -        VG_STATUS = len(VG_OUTPUT)
>> -    else:
>> -        VG_STATUS = 0
>> -
>> -    if SCRIPT_STATUS or VG_STATUS:
>> +    if SCRIPT_STATUS:
>>        print >>output, "******************** TEST '%s' FAILED!
>> ********************"%(TESTNAME,)
>>        print >>output, "Command: "
>>        output.writelines(scriptLines)
>> @@ -226,9 +210,6 @@
>>        else:
>>            print >>output, "Incorrect Output:"
>>        cat(OUTPUT, output)
>> -        if VG_STATUS:
>> -            print >>output, "Valgrind Output:"
>> -            print >>output, VG_OUTPUT
>>        print >>output, "******************** TEST '%s' FAILED!
>> ********************"%(TESTNAME,)
>>        output.flush()
>>        if xfailLines:
>> @@ -334,9 +315,6 @@
>>    parser.add_option("", "--clang-cc", dest="clangcc",
>>                      help="Program to use as \"clang-cc\"",
>>                      action="store", default=None)
>> -    parser.add_option("", "--vg", dest="useValgrind",
>> -                      help="Run tests under valgrind",
>> -                      action="store_true", default=False)
>>    parser.add_option("", "--dg", dest="useDGCompat",
>>                      help="Use llvm dejagnu compatibility mode",
>>                      action="store_true", default=False)
>> @@ -357,7 +335,6 @@
>>
>>        res = runOneTest(path, command, output, testname,
>>                         opts.clang, opts.clangcc,
>> -                         useValgrind=opts.useValgrind,
>>                         useDGCompat=opts.useDGCompat,
>>                         useScript=os.getenv("TEST_SCRIPT"))
>
>




More information about the cfe-commits mailing list