-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestSuite_main.py
More file actions
executable file
·102 lines (64 loc) · 2.59 KB
/
Copy pathTestSuite_main.py
File metadata and controls
executable file
·102 lines (64 loc) · 2.59 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/python
__author__ = 'Jhan Srbinovsky'
# Build & Run various CABLE applications described in config file
# usage: ./TestSuite_main -f <config file>
#import python modules
import os
import sys
import subprocess
#import local, application specific modules
from TestSuite_input import Locate_cfg, Configfile_interpreter
from TestSuite_build import TestSuite_builder, CleanSlate
from TestSuite_run import TestSuite_runner
def main(argv):
# insert a break from the CLI for reading
print "\n"
###############################################################################
# Locate config file (ifile), log file (ofile)
# Defaults to using default.cfg as input, default.out as output (currently no output)
ifile = []
ofile = []
Locate_cfg( argv, ifile, ofile )
###############################################################################
# Read config file
# class to hold all config file input
class Configs(object):
def __init__(self):
# Declare flags as mutable:
self.mode = []
self.name = []
self.path = []
cfg = []
cfg = Configs()
# Read config file and fill cfg. class
Configfile_interpreter( ifile, cfg )
# Print what we are going to do cfg. class
print "Applications to be evaluated:"
for i in range( len( cfg.name ) ):
print "\n",cfg.name[i]
###############################################################################
# Test Applications specified in config file
print "\nSet up structure for building/running all Apps described in " + \
"config file. These will be cleaned up following execution of the TestSuite"
#Start with a clean slate
CleanSlate()
# Build Applications
TestSuite_builder( cfg )
# Run Applications
TestSuite_runner( cfg )
# we may simply be able to use run.ksh here
# worry about qsub later. first run on a single node
## here it may be easier to use ksh scripts
# for i in range( len( cfg.name ) ):
# cmd = ( "./TestSuite.ksh " + cfg.path[i] )
# p = subprocess.check_callPopen(cmd, stdout=subprocess.PIPE, shell=True)
#
#
###############################################################################
# Evaluate Success of Applications and write to ofile [default.out]
#Atm_Step: Timestep 2
# comment out if interactive
#################################################################################
if __name__ == "__main__":
main(sys.argv[1:])
################################################################################