Exemplo n.º 1
0
def reprocess(target, source, umask=None):
    target = os.path.abspath(target)
    with utils.ChangeDir(source):
        if umask is not None:
            os.umask(umask)

        print('starting processing of all recipes')
        common.clean_output_dir(target)
        files = git.ls_tree('HEAD')

        # do a dry run to catch errors
        for f in files:
            file = ' '.join(f[3:])
            obj_id = f[2]

            if file.split('.')[-1] != 'rmd':
                continue

            r = common.process(obj_id, '/dev/null', settings.XSLT)

        # do a real run
        for f in files:
            file = f[3]
            obj_id = f[2]

            if file.split('.')[-1] != 'rmd':
                continue

            print('P {}'.format(file))
            common.process(obj_id, common.xml_filename(file, target),
                           settings.XSLT)

        print('finished processing of files')
Exemplo n.º 2
0
def reprocess(target, source, umask = None):
  target = os.path.abspath(target)
  with utils.ChangeDir(source):
    if umask is not None:
      os.umask(umask)

    print('starting processing of all recipes')
    common.clean_output_dir(target)
    files = git.ls_tree('HEAD')

    # do a dry run to catch errors
    for f in files:
      file = ' '.join(f[3:])
      obj_id = f[2]

      if file.split('.')[-1] != 'rmd':
        continue

      r = common.process(obj_id, '/dev/null', settings.XSLT)

    # do a real run
    for f in files:
      file = f[3]
      obj_id = f[2]

      if file.split('.')[-1] != 'rmd':
        continue

      print('P {}'.format(file))
      common.process(obj_id, common.xml_filename(file, target), settings.XSLT)

    print('finished processing of files')
Exemplo n.º 3
0
def main():
    os.umask(settings.UMASK)
    (ref, old, new) = sys.argv[1:4]

    print('starting processing of commit')

    cf = git.changed_files(old, new)

    # do a dry run to catch errors
    for f in cf:
        action = f[4]
        file = f[5]
        obj_id = f[3]

        if file.split('.')[-1] != settings.EXTENSION:
            continue

        if action == 'M' or action == 'A' or action == 'C':
            r = common.process(obj_id, '/dev/null', settings.XSLT)

    # do a real run
    for c in cf:
        action = c[4]
        file = c[5]
        obj_id = c[3]

        if file.split('.')[-1] != settings.EXTENSION:
            continue

        filename = common.xml_filename(file, settings.TARGET)

        if action == 'D':
            print('D {}'.format(file))
            try:
                os.remove(filename)
            except FileNotFoundError:
                print(
                    'file to be removed, but could not be found'.format(file))

        elif action == 'M' or action == 'A' or action == 'C':
            print('C {}'.format(file))
            common.process(obj_id, filename, settings.XSLT)

        else:
            print('unknown git status {} of <{}>'.format(action, file),
                  file=sys.stderr)

    index.update_index(settings.TARGET)
    index.update_json(settings.TARGET)

    print('finished processing of commits')
Exemplo n.º 4
0
def main():
    os.umask(settings.UMASK)
    (ref,old,new) = sys.argv[1:4]

    print('starting processing of commit')

    cf = git.changed_files(old,new)

    # do a dry run to catch errors
    for f in cf:
        action = f[4]
        file = f[5]
        obj_id = f[3]
        
        if file.split('.')[-1] != settings.EXTENSION:
            continue

        if action == 'M' or action == 'A' or action == 'C':
            r = common.process(obj_id, '/dev/null', settings.XSLT)

    # do a real run
    for c in cf:
        action = c[4]
        file = c[5]
        obj_id = c[3]
        
        if file.split('.')[-1] != settings.EXTENSION:
            continue

        filename = common.xml_filename(file, settings.TARGET)

        if action == 'D':
            print('D {}'.format(file))
            try:
                os.remove(filename)
            except FileNotFoundError:
                print('file to be removed, but could not be found'.format(file))

        elif action == 'M' or action == 'A' or action == 'C':
            print('C {}'.format(file))
            common.process(obj_id, filename, settings.XSLT)

        else:
            print('unknown git status {} of <{}>'.format(action, file), file=sys.stderr)

    index.update_index(settings.TARGET)
    index.update_json(settings.TARGET)

    print('finished processing of commits')
Exemplo n.º 5
0
#! /usr/local/bin/python
from common import process
import sys
task1=process(sys.argv[1])
print 'First:'
task1.dic_print(task1.get_first())
print 'Follow:'
#task1.dic_print(task1.get_follow())
Exemplo n.º 6
0
        test_case = m.group(1)
        test_set = m.group(2)
        result = m.group(3)
        fin_case = test_case
        icnt = 1

        if result == "pass":
            status = "PASS"
        else:
            status = "FAIL"

        #TODO: it will be better if the LAVA related testcases can be
        #      listed in execution time order in the final test report.
        while test_set + '.' + fin_case in test_results.keys():
            fin_case = test_case + '-' + str(icnt)
            icnt += 1

        if "_" in test_set:
            test_set = test_set.split('_')[1]

        test_results[test_set + '.' + fin_case] = status
        output_each.close()

        output_dir = '%s/result/%s/outputs' % (LOGDIR, test_set)
        make_dirs(output_dir)

        os.rename(result_dir + "/tmp.log", output_dir + "/%s.log" % fin_case)
        in_loop = 0

sys.exit(plib.process(test_results))
Exemplo n.º 7
0
#! /usr/local/bin/python
from copy import deepcopy
from common import process 
from common import Matrix
import sys
input=process(sys.argv[1])
first=input.get_first()
follow=input.get_follow()
product=input.get_production()
mx=Matrix()
ERROR='Grammar is not LL(1)!'
cons=1
trig=0
for A in product:
	for rhs in product[A]:
		f_buffer=input.se_first(rhs)
		t_f_buffer=deepcopy(f_buffer)
#		print '^^^',A,'|',rhs,'|',f_buffer
		if "epsilon" in t_f_buffer:
			t_f_buffer.remove("epsilon")
		for a in t_f_buffer:
			if mx.set(A,a,product[A][rhs])==0:
				print ERROR
				cons=0
				break
		if cons==1 and 'epsilon' in f_buffer:
			b_follow=deepcopy(follow[A])
			if "epsilon" in b_follow:
				b_follow.remove("epsilon")
			for b in b_follow:
				if mx.set(A,b,product[A][rhs])==0:
Exemplo n.º 8
0
#! /usr/local/bin/python
from copy import deepcopy
from common import process
from common import Matrix
import sys
input = process(sys.argv[1])
first = input.get_first()
follow = input.get_follow()
product = input.get_production()
mx = Matrix()
ERROR = 'Grammar is not LL(1)!'
cons = 1
trig = 0
for A in product:
    for rhs in product[A]:
        f_buffer = input.se_first(rhs)
        t_f_buffer = deepcopy(f_buffer)
        #		print '^^^',A,'|',rhs,'|',f_buffer
        if "epsilon" in t_f_buffer:
            t_f_buffer.remove("epsilon")
        for a in t_f_buffer:
            if mx.set(A, a, product[A][rhs]) == 0:
                print ERROR
                cons = 0
                break
        if cons == 1 and 'epsilon' in f_buffer:
            b_follow = deepcopy(follow[A])
            if "epsilon" in b_follow:
                b_follow.remove("epsilon")
            for b in b_follow:
                if mx.set(A, b, product[A][rhs]) == 0:
Exemplo n.º 9
0
#!/usr/bin/python
import os, re, sys
sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser')
import common as plib

regex_string = ".* Min\s+(\d+).*, Avg\s+(\d+), Max\s+(\d+)"
measurements = {}
matches = plib.parse_log(regex_string)

if matches:
	min_intervals = []
	avg_intervals = []
	max_intervals = []
	for thread in matches:
		min_intervals.append(float(thread[0]))
		avg_intervals.append(float(thread[1]))
		max_intervals.append(float(thread[2]))
	measurements['default.intervals'] = [
		{"name": "max_interval", "measure" : max(max_intervals)},
		{"name": "min_interval", "measure" : min(min_intervals)},
		{"name": "avg_interval", "measure" : sum(avg_intervals)/len(avg_intervals)}]

sys.exit(plib.process(measurements))