Last change
on this file since 2393 was
1844,
checked in by yushan, 5 years ago
|
dev_trunk_omp : add xios_test_suite folder
|
File size:
1.2 KB
|
Line | |
---|
1 | import os |
---|
2 | import sys |
---|
3 | import subprocess |
---|
4 | |
---|
5 | def main(): |
---|
6 | |
---|
7 | |
---|
8 | dirpath = os.getcwd() |
---|
9 | my_list = os.listdir(dirpath) |
---|
10 | |
---|
11 | test_list=[] |
---|
12 | for folder in my_list: |
---|
13 | if folder.startswith("test_"): |
---|
14 | test_list.append(folder) |
---|
15 | FNULL = open(os.devnull, 'w') |
---|
16 | retcode = subprocess.call(['bash', 'setup.sh'], stdout=FNULL, stderr=subprocess.STDOUT) |
---|
17 | if retcode!=0: |
---|
18 | print("setup.sh failed") |
---|
19 | print >> sys.stderr, retcode |
---|
20 | sys.exit() |
---|
21 | |
---|
22 | |
---|
23 | f=open("CMakeLists.txt", "w") |
---|
24 | |
---|
25 | f.write("####################################\n") |
---|
26 | f.write("# file generated by user_config.py #\n") |
---|
27 | f.write("# DO NOT modify #\n") |
---|
28 | f.write("####################################\n\n") |
---|
29 | |
---|
30 | f.write("cmake_minimum_required(VERSION 2.8.12.2)\n\n") |
---|
31 | f.write("project(generic_testcase)\n\n") |
---|
32 | f.write("enable_testing()\n\n") |
---|
33 | |
---|
34 | for x in range(len(test_list)): |
---|
35 | f.write("add_subdirectory(" + test_list[x]+ ")\n") |
---|
36 | |
---|
37 | f.write("\n") |
---|
38 | f.write("add_custom_target(\"report\")\n\n") |
---|
39 | f.write("add_custom_command(TARGET \"report\" \n") |
---|
40 | f.write(" POST_BUILD\n") |
---|
41 | f.write(" COMMAND rm -f report.txt\n") |
---|
42 | f.write(" COMMAND rm -f report.html\n") |
---|
43 | f.write(" )\n\n") |
---|
44 | f.close |
---|
45 | |
---|
46 | print >> sys.stderr, 0 |
---|
47 | sys.exit() |
---|
48 | |
---|
49 | if __name__== "__main__": |
---|
50 | main() |
---|
Note: See
TracBrowser
for help on using the repository browser.