Example #1
0
File: s4.py Project: jineli/websee
def process(testpath):
    with open(testpath + '/description.txt') as f:
        total = 0
        fail = 0
        skip = 0
        total_time = 0
        total_rank = 0
        total_vp = 0
        for line in f:
            total += 1
            split = line.strip().split('\t')
            eid = split[1]
            expected_type = split[3].lower()
            expected_attribute = split[2].lower()
            expected_value = split[5].lower()
            path = split[8]
            expected_xpath = common.patch_xpath(split[7])
            sys.stdout.write("Test Case: {0}\n".format(path))
            sys.stdout.write("Expected: {0}\t{1}\n".format(
                expected_type, expected_attribute))
            if eid == 'no seeding':
                sys.stdout.write('Skip.\n')
                skip += 1
            else:
                (rank,
                 time) = parse_file(testpath + '/' + path + '/RCA_details.txt')
                sys.stdout.write("Time: {0} seconds\n".format(time))
                sys.stdout.write(str(rank) + '\n')
                vp = expected_type + ':' + expected_attribute
                if vp in rank:
                    index = rank.index(vp) + 1
                else:
                    index = len(rank) + 1
                sys.stdout.write("Rank: {0}\n".format(index))
                sys.stdout.write("Length: {0}\n".format(len(rank)))
                if time:
                    total_time += float(time)
                total_rank += float(index)
                total_vp += float(len(rank))
            sys.stdout.write('\n')
        sys.stdout.write('\n')
        sys.stdout.write('Failed Test Case: {0}\n'.format(fail))
        count = total - fail - skip
        sys.stdout.write('Total Test Case: {0}\n'.format(count))
        if count == 0:
            count = -1
        sys.stdout.write('Average Rank: {0:.2f}\n'.format(total_rank / count))
        sys.stdout.write('Average VP: {0:.2f}\n'.format(total_vp / count))
        sys.stdout.write('Average Running Time: {0:.2f} seconds\n'.format(
            total_time / count))
        return (total, total_rank / count, total_vp / count,
                total_time / count)
Example #2
0
def process(testpath):
  with open(testpath + '/description.txt') as f:
    for line in f:
      split = line.strip().split('\t')
      expected_type = split[3].lower()
      expected_vp = split[2].lower()
      expected_value = split[5].lower()
      path = split[8]
      expected_xpath = common.patch_xpath(split[7])
      (initial_dp, final_dp) = parse_sa(
          testpath + '/' + path + '/RCA_details.txt', expected_vp)
      if initial_dp:
        print testpath, path, expected_vp, initial_dp, final_dp
Example #3
0
def process(testpath):
    with open(testpath + '/description.txt') as f:
        for line in f:
            split = line.strip().split('\t')
            expected_type = split[3].lower()
            expected_vp = split[2].lower()
            expected_value = split[5].lower()
            path = split[8]
            expected_xpath = common.patch_xpath(split[7])
            (initial_dp,
             final_dp) = parse_sa(testpath + '/' + path + '/RCA_details.txt',
                                  expected_vp)
            if initial_dp:
                print testpath, path, expected_vp, initial_dp, final_dp
Example #4
0
File: s4.py Project: jineli/websee
def process(testpath):
    with open(testpath + "/description.txt") as f:
        total = 0
        fail = 0
        skip = 0
        total_time = 0
        total_rank = 0
        total_vp = 0
        for line in f:
            total += 1
            split = line.strip().split("\t")
            eid = split[1]
            expected_type = split[3].lower()
            expected_attribute = split[2].lower()
            expected_value = split[5].lower()
            path = split[8]
            expected_xpath = common.patch_xpath(split[7])
            sys.stdout.write("Test Case: {0}\n".format(path))
            sys.stdout.write("Expected: {0}\t{1}\n".format(expected_type, expected_attribute))
            if eid == "no seeding":
                sys.stdout.write("Skip.\n")
                skip += 1
            else:
                (rank, time) = parse_file(testpath + "/" + path + "/RCA_details.txt")
                sys.stdout.write("Time: {0} seconds\n".format(time))
                sys.stdout.write(str(rank) + "\n")
                vp = expected_type + ":" + expected_attribute
                if vp in rank:
                    index = rank.index(vp) + 1
                else:
                    index = len(rank) + 1
                sys.stdout.write("Rank: {0}\n".format(index))
                sys.stdout.write("Length: {0}\n".format(len(rank)))
                if time:
                    total_time += float(time)
                total_rank += float(index)
                total_vp += float(len(rank))
            sys.stdout.write("\n")
        sys.stdout.write("\n")
        sys.stdout.write("Failed Test Case: {0}\n".format(fail))
        count = total - fail - skip
        sys.stdout.write("Total Test Case: {0}\n".format(count))
        if count == 0:
            count = -1
        sys.stdout.write("Average Rank: {0:.2f}\n".format(total_rank / count))
        sys.stdout.write("Average VP: {0:.2f}\n".format(total_vp / count))
        sys.stdout.write("Average Running Time: {0:.2f} seconds\n".format(total_time / count))
        return (total, total_rank / count, total_vp / count, total_time / count)