[llvm-commits] [LNT] r154405 - in /lnt/trunk: lnt/formats/AppleOpenSSLReader.py lnt/formats/NightlytestReader.py lnt/formats/__init__.py tests/Formats/nightlytest.py

Daniel Dunbar daniel at zuster.org
Tue Apr 10 09:39:29 PDT 2012


Author: ddunbar
Date: Tue Apr 10 11:39:29 2012
New Revision: 154405

URL: http://llvm.org/viewvc/llvm-project?rev=154405&view=rev
Log:
Remove two old and unused formats.

Removed:
    lnt/trunk/lnt/formats/AppleOpenSSLReader.py
    lnt/trunk/lnt/formats/NightlytestReader.py
    lnt/trunk/tests/Formats/nightlytest.py
Modified:
    lnt/trunk/lnt/formats/__init__.py

Removed: lnt/trunk/lnt/formats/AppleOpenSSLReader.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/formats/AppleOpenSSLReader.py?rev=154404&view=auto
==============================================================================
--- lnt/trunk/lnt/formats/AppleOpenSSLReader.py (original)
+++ lnt/trunk/lnt/formats/AppleOpenSSLReader.py (removed)
@@ -1,111 +0,0 @@
-"""
-Converter for a custom format with the output of OpenSSL test runs.
-"""
-
-import os
-
-def parseOpenSSLFile(path):
-    data = open(path).read()
-    lines = list(open(path))
-    lnfields = [ln.strip().split(':') for ln in lines]
-    assert(lnfields[0][0] == '+H')
-    header = lnfields[0]
-    blockSizes = map(int, header[1:])
-
-    # Cipher -> [(Block Size,Value)*]
-    data = {}
-    for fields in lnfields[1:]:
-        # Ignore other fields
-        if fields[0] != '+F':
-            continue
-
-        name = fields[2]
-        countsPerBlock = fields[3:]
-        assert len(countsPerBlock) == len(blockSizes)
-        data[name] = [(b,float(c))
-                      for b,c in zip(blockSizes,countsPerBlock)]
-
-    return data
-
-def _matches_format(path_or_file):
-    # If this is a file, we definitely can't load it.
-    if not isinstance(path_or_file,str):
-        return False
-
-    # Assume an input matches this format if any of the key files exists.
-    return (os.path.exists(os.path.join(path_or_file, 'svn-revision')) or
-            os.path.exists(os.path.join(path_or_file, 'start.timestamp')) or
-            os.path.exists(os.path.join(path_or_file, 'finished.timestamp')))
-                     
-def _load_data(path):
-    # Look for svn-revision and timestamps.
-
-    llvmRevision = ''
-    startTime = endTime = ''
-
-    f = os.path.join(path, 'svn-revision')
-    if os.path.exists(f):
-        svnRevisionData = open(f).read()
-        assert(svnRevisionData[0] == 'r')
-        llvmRevision = int(svnRevisionData[1:])
-
-    f = os.path.join(path, 'start.timestamp')
-    if os.path.exists(f):
-        startTime = open(f).read().strip()
-
-    f = os.path.join(path, 'finished.timestamp')
-    if os.path.exists(f):
-        endTime = open(f).read().strip()
-
-    # Look for sub directories
-    openSSLData = []
-    for file in os.listdir(path):
-        p = os.path.join(path, file)
-        if os.path.isdir(p):
-            # Look for Tests/Apple.OpenSSL.64/speed.txt
-            p = os.path.join(p, 'Tests/Apple.OpenSSL.64/speed.txt')
-            if os.path.exists(p):
-                openSSLData.append((file, parseOpenSSLFile(p)))
-
-    basename = 'apple_openssl'
-
-    machine = { 'Name' : 'dgohman.apple.com',
-                'Info' : {  } }
-
-    run = { 'Start Time' : startTime,
-            'End Time' : endTime,
-            'Info' : { 'llvm-revision' : llvmRevision,
-                       'tag' : 'apple_openssl' } }
-
-    tests = []
-    groupInfo = []
-
-    for dirName,dirData in openSSLData:
-        # Demangle compiler & flags
-        if dirName.startswith('gcc'):
-            compiler = 'gcc'
-        elif dirName.startswith('llvm-gcc'):
-            compiler = 'llvm-gcc'
-        else:
-            raise ValueError,compiler
-        assert dirName[len(compiler)] == '-'
-        flags = dirName[len(compiler)+1:]
-
-        for cipher,values in dirData.items():
-            testName = basename + '.' + cipher + '.ips'
-            for block,value in values:
-                parameters = { 'blockSize' : block,
-                               'compiler' : compiler,
-                               'compiler_flags' : flags }
-                tests.append( { 'Name' : testName,
-                                'Info' : parameters,
-                                'Data' : [value] } )
-
-    return { 'Machine' : machine,
-             'Run' : run,
-             'Tests' : tests,
-             'Group Info' : groupInfo }
-
-format = { 'name' : 'apple_openssl',
-           'predicate' : _matches_format,
-           'read' : _load_data }

Removed: lnt/trunk/lnt/formats/NightlytestReader.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/formats/NightlytestReader.py?rev=154404&view=auto
==============================================================================
--- lnt/trunk/lnt/formats/NightlytestReader.py (original)
+++ lnt/trunk/lnt/formats/NightlytestReader.py (removed)
@@ -1,233 +0,0 @@
-"""
-Data converter from the llvm/utils/NewNightlyTest.pl report file format
-(*-sentdata.txt) to the LNT plist format.
-"""
-
-import re
-
-kDataKeyStart = re.compile('(.*)  =>(.*)')
-
-def _matches_format(path_or_file):
-    if isinstance(path_or_file, str):
-        path_or_file = open(path_or_file)
-
-    # Assume this is in nightlytes format if the first line matches the
-    # key-value format.
-    for ln in path_or_file:
-        m = kDataKeyStart.match(ln)
-        if m:
-            return True
-        return False
-
-        
-def _load_data(path_or_file):
-    def parseDGResults(text):
-        results = {}
-        if 'Dejagnu skipped by user choice' in text:
-            return results
-        for ln in text.strip().split('\n'):
-            result,value = ln.split(':',1)
-            results[result] = results.get(result,[])
-            results[result].append(value)
-        return results
-
-    if isinstance(path_or_file, str):
-        path_or_file = open(path_or_file)
-
-    basename = 'nightlytest'
-
-    # Guess the format (server side or client side) based on the first
-    # character.
-    f = path_or_file
-    isServerSide = (f.read(1) == '\'')
-    f.seek(0)
-
-    data = {}
-
-    current = None
-    inData = False
-    for ln in f:
-        if inData:
-            if ln == 'EOD\n':
-                inData = False
-            else:
-                data[current] += ln
-            continue
-
-        m = kDataKeyStart.match(ln)
-        if m:
-            current,value = m.groups()
-            if isServerSide:
-                assert current[0] == current[-1] == "'"
-                current = current[1:-1]
-                assert value[0] == value[1] == ' '
-                value = value[2:]
-                if value == '<<EOD':
-                    value = ''
-                    inData = True
-                else:
-                    assert value[0] == value[-2] == '"'
-                    assert value[-1] == ','
-                    value = value[1:-2]
-            data[current] = value
-        elif isServerSide:
-            assert ln == ',\n'
-        else:
-            assert current is not None
-            data[current] += ln
-
-    # Things we are ignoring for now
-    data.pop('a_file_sizes')
-    data.pop('all_tests')
-    data.pop('build_data')
-    data.pop('cvs_dir_count')
-    data.pop('cvs_file_count')
-    data.pop('cvsaddedfiles')
-    data.pop('cvsmodifiedfiles')
-    data.pop('cvsremovedfiles')
-    data.pop('cvsusercommitlist')
-    data.pop('cvsuserupdatelist')
-    data.pop('dejagnutests_log')
-    data.pop('expfail_tests')
-    data.pop('lines_of_code')
-    data.pop('llcbeta_options')
-    data.pop('new_tests')
-    data.pop('o_file_sizes')
-    data.pop('passing_tests')
-    data.pop('removed_tests')
-    data.pop('target_triple')
-    data.pop('unexpfail_tests')
-    data.pop('warnings')
-    data.pop('warnings_added')
-    data.pop('warnings_removed')
-
-    starttime = data.pop('starttime').strip()
-    endtime = data.pop('endtime').strip()
-
-    nickname = data.pop('nickname').strip()
-    machine_data = data.pop('machine_data').strip()
-    buildstatus = data.pop('buildstatus').strip()
-    configtime_user = data.pop('configtime_cpu')
-    configtime_wall = data.pop('configtime_wall')
-    checkouttime_user = data.pop('cvscheckouttime_cpu')
-    checkouttime_wall = data.pop('cvscheckouttime_wall')
-    dgtime_user = data.pop('dejagnutime_cpu')
-    dgtime_wall = data.pop('dejagnutime_wall')
-    buildtime_wall = float(data.pop('buildtime_wall').strip())
-    buildtime_user = float(data.pop('buildtime_cpu').strip())
-    gcc_version = data.pop('gcc_version')
-    dejagnutests_results = data.pop('dejagnutests_results')
-    multisource = data.pop('multisource_programstable')
-    singlesource = data.pop('singlesource_programstable')
-    externals = data.pop('externalsource_programstable')
-
-    assert not data.keys()
-
-    machine = { 'Name' : nickname,
-                'Info' : { 'gcc_version' : gcc_version } }
-    for ln in machine_data.split('\n'):
-        ln = ln.strip()
-        if not ln:
-            continue
-        assert ':' in ln
-        key,value = ln.split(':',1)
-        machine['Info'][key] = value
-
-    # We definitely don't want these in the machine data.
-    if 'time' in machine['Info']:
-        machine['Info'].pop('time')
-    if 'date' in machine['Info']:
-        machine['Info'].pop('date')
-
-    run = { 'Start Time' : starttime,
-            'End Time' : endtime,
-            'Info' : { 'tag' : 'nightlytest' } }
-
-    tests = []
-
-    # llvm-test doesn't provide this
-    infoData = {}
-
-    # Summary test information
-    tests.append( { 'Name' : basename + '.Summary.configtime.wall',
-                    'Info' : infoData,
-                    'Data' : [configtime_wall] } )
-    tests.append( { 'Name' : basename + '.Summary.configtime.user',
-                    'Info' : infoData,
-                    'Data' : [configtime_user] } )
-    tests.append( { 'Name' : basename + '.Summary.checkouttime.wall',
-                    'Info' : infoData,
-                    'Data' : [checkouttime_wall] } )
-    tests.append( { 'Name' : basename + '.Summary.checkouttime.user',
-                    'Info' : infoData,
-                    'Data' : [checkouttime_user] } )
-    tests.append( { 'Name' : basename + '.Summary.buildtime.wall',
-                    'Info' : infoData,
-                    'Data' : [buildtime_wall] } )
-    tests.append( { 'Name' : basename + '.Summary.buildtime.user',
-                    'Info' : infoData,
-                    'Data' : [buildtime_user] } )
-    tests.append( { 'Name' : basename + '.Summary.dgtime.wall',
-                    'Info' : infoData,
-                    'Data' : [dgtime_wall] } )
-    tests.append( { 'Name' : basename + '.Summary.dgtime.user',
-                    'Info' : infoData,
-                    'Data' : [dgtime_user] } )
-    tests.append( { 'Name' : basename + '.Summary.buildstatus',
-                    'Info' : infoData,
-                    'Data' : [buildstatus == 'OK'] } )
-
-    # DejaGNU Info
-    results = parseDGResults(dejagnutests_results)
-    for name in ('PASS', 'FAIL', 'XPASS', 'XFAIL'):
-        tests.append( { 'Name' : basename + '.DejaGNU.' + name,
-                        'Info' : infoData,
-                        'Data' : [len(results.get(name,[]))] } )
-
-    # llvm-test results
-    for groupname,data in (('SingleSource', singlesource),
-                           ('MultiSource', multisource),
-                           ('Externals', externals)):
-        lines = data.split('\n')
-        header = lines[0].strip().split(',')
-        for ln in lines[1:]:
-            ln = ln.strip()
-            if not ln:
-                continue
-            entry = dict([(k,v.strip())
-                           for k,v in zip(header, ln.split(','))])
-            testname = basename + '.%s/%s' % (groupname,
-                                              entry['Program'].replace('.','_'))
-
-            for name,key,tname in (('gcc.compile', 'GCCAS', 'time'),
-                                   ('bc.compile', 'Bytecode', 'size'),
-                                   ('llc.compile', 'LLC compile', 'time'),
-                                   ('llc-beta.compile', 'LLC-BETA compile', 'time'),
-                                   ('jit.compile', 'JIT codegen', 'time'),
-                                   ('gcc.exec', 'GCC', 'time'),
-                                   ('cbe.exec', 'CBE', 'time'),
-                                   ('llc.exec', 'LLC', 'time'),
-                                   ('llc-beta.exec', 'LLC-BETA', 'time'),
-                                   ('jit.exec', 'JIT', 'time'),
-                             ):
-                time = entry[key]
-                if time == '*':
-                    tests.append( { 'Name' : testname + '.%s.success' % name,
-                                    'Info' : infoData,
-                                    'Data' : [0] } )
-                else:
-                    tests.append( { 'Name' : testname + '.%s.success' % name,
-                                    'Info' : infoData,
-                                    'Data' : [1] } )
-                    tests.append( { 'Name' : testname + '.%s.%s' % (name, tname),
-                                    'Info' : infoData,
-                                    'Data' : [float(time)] } )
-        pass
-
-    return { 'Machine' : machine,
-             'Run' : run,
-             'Tests' : tests }
-
-format = { 'name' : 'nightlytest',
-           'predicate' : _matches_format,
-           'read' : _load_data }

Modified: lnt/trunk/lnt/formats/__init__.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/formats/__init__.py?rev=154405&r1=154404&r2=154405&view=diff
==============================================================================
--- lnt/trunk/lnt/formats/__init__.py (original)
+++ lnt/trunk/lnt/formats/__init__.py Tue Apr 10 11:39:29 2012
@@ -7,13 +7,10 @@
 Python object to write, and the path_or_file to write to.
 """
 
-from AppleOpenSSLReader import format as apple_openssl
-from NightlytestReader import format as nightlytest
 from PlistFormat import format as plist
 from JSONFormat import format as json
 
-# FIXME: Lazy loading would be nice.
-formats = [plist, json, nightlytest, apple_openssl]
+formats = [plist, json]
 formats_by_name = dict((f['name'], f) for f in formats)
 format_names = formats_by_name.keys()
 

Removed: lnt/trunk/tests/Formats/nightlytest.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/Formats/nightlytest.py?rev=154404&view=auto
==============================================================================
--- lnt/trunk/tests/Formats/nightlytest.py (original)
+++ lnt/trunk/tests/Formats/nightlytest.py (removed)
@@ -1,6 +0,0 @@
-# RUN: lnt convert --to=json %S/Inputs/test.nightlytest %t
-# RUN: FileCheck %s < %t
-
-# We are just checking the conversion, not validating the format.
-# CHECK: "Machine":
-# CHECK: "Tests": [





More information about the llvm-commits mailing list