OpenCores
URL https://opencores.org/ocsvn/tv80/tv80/trunk

Subversion Repositories tv80

[/] [tv80/] [trunk/] [scripts/] [regression] - Blame information for rev 89

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 63 ghutchis
#!/usr/bin/env python
2
# Copyright (c) 2004 Guy Hutchison (ghutchis@opencores.org)
3
#
4
# Permission is hereby granted, free of charge, to any person obtaining a
5
# copy of this software and associated documentation files (the "Software"),
6
# to deal in the Software without restriction, including without limitation
7
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
# and/or sell copies of the Software, and to permit persons to whom the
9
# Software is furnished to do so, subject to the following conditions:
10
#
11
# The above copyright notice and this permission notice shall be included
12
# in all copies or substantial portions of the Software.
13
#
14
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
 
22
import sys, os, getopt
23
 
24
test_list = ["bintr", "blk_mem_inst", "blk_out_inst", "hello",
25
             "fib", "otir", "nwtest"]
26
status = {}
27
 
28
def run_tests (test_list):
29
    for test_name in test_list:
30
        os.system ("scripts/run %s" % test_name)
31
 
32
def check_results (test_list):
33
    print "%-20s %s" % ("Test", "Status")
34
    for test_name in test_list:
35
        try:
36
            testh = open ("logs/%s.log" % test_name, "r")
37
            status[test_name] = "crashed"
38
 
39
            testl = testh.readline()
40
            while (testl != ''):
41
                if (testl.find ("TEST PASSED")):
42
                    status[test_name] = "passed"
43
                elif (testl.find ("TEST FAILED")):
44
                    status[test_name] = "failed"
45
                testl = testh.readline()
46
 
47
        except:
48
            status[test_name] = "no log file"
49
 
50
        print "%-20s %s" % (test_name, status[test_name])
51
 
52
def print_help():
53
    print "Usage: regression [-rch]"
54
    print "  -r : run regression"
55
    print "  -c : check results and print report"
56
    print "  -h : option help (this list)"
57
 
58
(options, args) = getopt.getopt (sys.argv[1:], "rc")
59
 
60
run = 0
61
check = 0
62
for option in options:
63
    if (option[0] == "-r"):
64
        run = 1
65
    if (option[0] == "-c"):
66
        check = 1
67
    if (option[0] == "-h"):
68
        print_help()
69
        sys.exit (0)
70
 
71
if (not run and not check):
72
    print_help()
73
    sys.exit(0)
74
 
75
if (run):
76
    run_tests (test_list)
77
if (check):
78
    check_results (test_list)
79
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.