source: XIOS/trunk/xios_test_suite/TEST_SUITE/step3.py @ 1891

Last change on this file since 1891 was 1891, checked in by yushan, 4 years ago

trunk : commit for checking

File size: 1.3 KB
Line 
1import glob
2import sys
3import subprocess
4import os
5import json
6import itertools
7import copy
8
9mode=os.getenv("mode")
10arch=os.getenv("arch")
11svnr=os.getenv("svnR")
12repository=os.getenv("xios_test_suite_repository")
13
14def OSinfo(runthis):
15    red = lambda text: '\033[0;31m' + text + '\033[0m'
16    osstdout = subprocess.Popen(runthis, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True)
17    theInfo = osstdout.communicate()[0].strip()
18    if osstdout.returncode!=0:
19        print(red(runthis+" FAILED"))
20        print(theInfo)
21        sys.exit()
22    # else:
23    #     print(runthis+" OK")
24
25
26def get_default_param():
27    f=open("default_param.json", 'r')
28    default_param = json.load(f)
29    f.close()
30    return default_param[0]
31
32def nonblank_lines(f):
33    for l in f:
34        line = l.rstrip()
35        if line and not line.startswith("#"):
36            yield line
37
38def main():
39    print(svnr) 
40    print(repository)
41    test_folder_list = glob.glob('test_*')
42
43    for test_folder in test_folder_list:
44        OSinfo("cp "+test_folder+"/user_param.json "+repository+"/RUN/def_files/"+svnr+"/"+test_folder)
45        config_list = glob.glob(test_folder+"/CONFIG_*")
46        #print(*config_list, sep = "\n")
47       
48       
49                   
50
51if __name__== "__main__":
52  main()
Note: See TracBrowser for help on using the repository browser.