source: XIOS/trunk/xios_test_suite/TEST_SUITE/run_test @ 1836

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

XIOS test suite : add write permission to test_irene folder

  • Property svn:executable set to *
File size: 3.1 KB
Line 
1#!/bin/bash
2
3source ../ARCH/arch-${arch}.env
4cd .. ; source load_env ; 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 run_sub_test.sh ${i%%/}   
65  echo "bash -c \"cd " ${i%%/} " && python setup.py\" ">> setup.sh
66  echo "echo \"setup.py called from " ${i%%/} "\"">> setup.sh
67done
68
69export output=$(python user_config.py 2>&1 >/dev/null)
70
71if [ "$output" -ne 0 ]
72then
73        echo "user_config.py failed"
74        exit
75else
76        echo "user_config.py OK"
77fi
78
79
80cmake .
81ctest -V
82#ctest --output-on-failure
83make report
84
85rm -f test_*/setup.py
86rm -f test_*/run_sub_test.sh
87rm -f test_*/run_test_*.py
88rm -f test_*/CMakeLists.txt
89rm -f test_*/context_grid_dynamico.xml
90rm -f test_*/dynamico_grid.nc
91rm -f test_*/default_param.pyc
92rm -f test_*/user_param.pyc
93rm -f test_*/user_param.py.*
94
95rundir=${xios_test_suite_repository}/RUN
96mkdir -p $rundir ; CHMOD  $rundir
97mkdir -p ${rundir}/test_${machine_name} ; CHMOD ${rundir}/test_${machine_name}
98
99cp plain_report.txt ${rundir}/test_${machine_name}/test_${xios_revision}_${machine_name}_${arch}_${mode}.txt
100CHMOD ${rundir}/test_${machine_name}/test_${xios_revision}_${machine_name}_${arch}_${mode}.txt
101
102mkdir -p ${rundir}/def_files ;  CHMOD ${rundir}/RUN/def_files
103mkdir -p ${rundir}/def_files/${xios_revision} ;  CHMOD ${rundir}/def_files/${xios_revision}
104
105for i in $(ls -d test_*/)
106do
107  mkdir -p ${rundir}/def_files/${xios_revision}/${i%%}
108  cp ${i%%}/user_params.def ${rundir}/def_files/${xios_revision}/${i%%}     
109  for j in $(ls -d ${i%%/}/config_*)
110  do
111    mkdir -p ${rundir}/def_files/${xios_revision}/${j%%}
112    cp ${j%%}/setup/all_param.def ${rundir}/def_files/${xios_revision}/${j%%} 
113  done
114  CHMOD ${rundir}/def_files
115done
116
117fi
118
Note: See TracBrowser for help on using the repository browser.