File: lapack_testing.py

package info (click to toggle)
magma 2.9.0%2Bds-3
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid
  • size: 83,556 kB
  • sloc: cpp: 709,115; fortran: 121,916; ansic: 32,343; python: 25,603; f90: 15,208; makefile: 945; xml: 253; csh: 232; sh: 203; perl: 104
file content (40 lines) | stat: -rwxr-xr-x 1,142 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#! /usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys

filename = "testing_results.txt"

# erase the file if it exists
f = open(filename, "w")
f.close()

# Add current directory to the path for subshells of this shell
# Allows the popen to find local files in both windows and unix
os.environ["PATH"] += ":."

print
print '---------------- LAPACK LIN Testing with MAGMA ----------------'
print
print '-- Detailed results are stored in', filename

dtypes = (
    ("s", "d", "c", "z"),
    ("Single", "Double", "Complex", "Double Complex"),
)
for dtype in range( len( dtypes[0] )):
    letter = dtypes[0][dtype]
    name   = dtypes[1][dtype]
    print
    print "------------------------- %s ------------------------" % name
    print
    sys.stdout.flush() # make sure progress of testing is shown
    f = open(filename, "a")
    test1 = os.popen("xlintst%s < %stest.in" % (letter, letter))
    for line in test1.readlines():
        f.write( line )
        if "passed"   in line : print line,
        if "failed"   in line : print "\n Failure =======>", line
        if "recorded" in line : print "\n ===>", line
    f.close()