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

Last change on this file since 1812 was 1812, checked in by ymipsl, 2 years ago

XIOS test suite : some update
YM

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