source: XIOS/trunk/xios_test_suite/TEST_SUITE/run_test_local @ 1841

Last change on this file since 1841 was 1841, checked in by yushan, 22 months ago

XIOS test suite : update to hierarchical inputs

  • Property svn:executable set to *
File size: 3.2 KB
Line 
1#!/bin/bash
2
3source ../ARCH/arch-${arch}.env
4cd .. ; source load_env_local ; cd RUN_TEST_SUITE
5
6export machine_name=$xios_machine_name
7export machine_full_name=$xios_full_machine_name
8export xios_dir=$(bash -c "cd ../.. && pwd" 2>&1)
9
10export reference_file=xios_reference.tar.gz
11export reference_folder=xios_reference
12
13export build_dir=xios_test_suite/RUN_TEST_SUITE/build_${arch}_${mode}
14export xios_revision=$(svn info --show-item revision ../.. 2>&1)
15export relurl=$(svn info --show-item relative-url ../.. 2>&1)
16
17
18set -x
19
20echo "Start Building XIOS ... "
21bash -c "cd ../.. && ./make_xios --arch_path `pwd`/../ARCH --arch ${arch} --${mode} --build_dir ${build_dir} --job 16 &> /dev/null"
22export build_status=$?
23if [[ ${build_status} == 0 ]]
24then
25  echo "XIOS Build Finished. Start Unit Tests"
26else
27  echo "XIOS Build Failed. Skip Unit Tests"
28fi
29
30#----------- Fetch reference -----------
31cp ${xios_reference_dir}/${reference_file} ./
32tar -xzvf ${reference_file}
33
34rm -f ${reference_file}
35
36for i in $(ls ${reference_folder}/) 
37do
38  folder=${i%%}
39  bash -c "cd ${folder} && rm -rf config_*"
40  bash -c "cp -r ${reference_folder}/${folder}/config_* ./${folder}"
41done
42
43rm -rf ${reference_folder}
44
45
46rm -f plain_report.txt
47
48echo "#revision" ${xios_revision} >> plain_report.txt
49echo "#relurl" ${relurl} >> plain_report.txt
50echo "#machine" ${machine_name} >> plain_report.txt
51echo "#build_dir" ${xios_dir}/${build_dir} >> plain_report.txt
52echo "#arch" ${arch} >> plain_report.txt
53echo "#mode" ${mode} >> plain_report.txt
54
55if [[ ${build_status} == 0 ]]
56then
57
58rm -f setup.sh
59touch setup.sh
60>setup.sh
61for i in $(ls -d test_*/)
62do
63  cp setup.py ${i%%/} 
64  cp default_param.json ${i%%/} 
65  cp param_list.py ${i%%/}     
66  cp run_sub_test.sh ${i%%/}   
67  echo "bash -c \"cd " ${i%%/} " && python setup.py\" ">> setup.sh
68  echo "echo \"setup.py called from " ${i%%/} "\"">> setup.sh
69done
70
71export output=$(python user_config.py 2>&1 >/dev/null)
72
73if [ "$output" -ne 0 ]
74then
75        echo "user_config.py failed"
76        exit
77else
78        echo "user_config.py OK"
79fi
80
81
82cmake .
83ctest -V
84#ctest --output-on-failure
85make report
86
87rm -f test_*/setup.py
88rm -f test_*/run_sub_test.sh
89rm -f test_*/run_test_*.py
90rm -f test_*/CMakeLists.txt
91rm -f test_*/context_grid_dynamico.xml
92rm -f test_*/dynamico_grid.nc
93rm -f test_*/default_param.pyc
94rm -f test_*/user_param.pyc
95rm -f test_*/user_param.py.*
96
97rundir=${xios_test_suite_repository}/RUN
98mkdir -p $rundir ; CHMOD  $rundir
99mkdir -p ${rundir}/test_${machine_name} ; CHMOD ${rundir}/test_${machine_name}
100
101cp plain_report.txt ${rundir}/test_${machine_name}/test_${xios_revision}_${machine_name}_${arch}_${mode}.txt
102CHMOD ${rundir}/test_${machine_name}/test_${xios_revision}_${machine_name}_${arch}_${mode}.txt
103
104mkdir -p ${rundir}/def_files ;  CHMOD ${rundir}/RUN/def_files
105mkdir -p ${rundir}/def_files/${xios_revision} ;  CHMOD ${rundir}/def_files/${xios_revision}
106
107for i in $(ls -d test_*/)
108do
109  mkdir -p ${rundir}/def_files/${xios_revision}/${i%%}
110  cp ${i%%}/user_param.json ${rundir}/def_files/${xios_revision}/${i%%} 
111  for j in $(ls -d ${i%%/}/config_*)
112  do
113    mkdir -p ${rundir}/def_files/${xios_revision}/${j%%}
114    cp ${j%%}/setup/all_param.def ${rundir}/def_files/${xios_revision}/${j%%} 
115  done
116  CHMOD ${rundir}/def_files
117done
118
119fi
120
Note: See TracBrowser for help on using the repository browser.