source: test_all.sh@ 7067bd6

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since 7067bd6 was e24c78, checked in by Tillmann Crueger <crueger@…>, 15 years ago

Made the full log script more readable

  • Property mode set to 100755
File size: 4.0 KB
Line 
1#!/bin/bash
2
3optimizations=("-O0"\
4 "-O1"\
5 "-O2"\
6 "-O3"\
7 "-Os");
8
9options=("" \
10 "-DLOG_OBSERVER" \
11 "-DNO_MEMDEBUG" \
12 "-DNO_CACHING" \
13 "-DNDEBUG" \
14 "-DNO_MEMDEBUG -DLOG_OBSERVER" \
15 "-DNO_CACHING -DLOG_OBSERVER" \
16 "-DNO_CACHING -DNO_MEMDEBUG" \
17 "-DNDEBUG -DNO_CACHING" \
18 "-DNO_CACHING -DNO_MEMDEBUG -DLOG_OBSERVER" \
19 );
20
21outfile="test.log";
22logfile="full.log";
23docheck=0;
24docheck_mem=0;
25if [ -n "$TMPDIR" ]
26then
27 tmpdir="$TMPDIR";
28else
29 tmpdir="/tmp";
30fi
31tmppattern="MolecuilderTest";
32
33function usage(){
34 echo "usage $0 options";
35 echo "";
36 echo "This script runs a full test for molecuilder, using several compilation options";
37 echo "";
38 echo "OPTIONS:";
39 echo " -h Show this message"
40 echo " -o <outfile> Outfile to use for test results";
41 echo " -f <logfile> File to use for output from commands";
42 echo " -s Short tests (no memcheck)";
43 echo " -c Only configure and compile (implies -s)";
44 echo " -O <opt-level> Only compile this optimization level";
45 echo " -t <tmpDir> Use tmpDir as temporary directory";
46 echo " -p <prefix> Prefix to use for directory names (standart MolecuilderTest)";
47}
48
49while getopts “ho:f:scO:t:p:” OPTION
50do
51 case $OPTION in
52 h)
53 usage;
54 exit 0;
55 ;;
56 o)
57 outfile="$OPTARG";
58 ;;
59 f)
60 logfile="$OPTARG";
61 ;;
62 s)
63 docheck_mem=1;
64 ;;
65 c)
66 docheck=1;
67 docheck_mem=1;
68 ;;
69 O)
70 optimizations=("-O$OPTARG");
71 ;;
72 t)
73 tmpdir="$OPTARG";
74 ;;
75 p)
76 tmppattern="$OPTARG";
77 ;;
78 ?)
79 usage;
80 exit 1;
81 ;;
82 esac
83done
84
85# test if all arguments were provided
86if [[ -z "$outfile" ]] || [[ -z "$logfile" ]] || [[ -z "$tmpdir" ]] || [[ -z "$tmppattern" ]]
87then
88 usage;
89 exit 1;
90fi
91
92# turn all relative paths into absolutes
93outfile=`realpath -s $outfile`;
94logfile=`realpath -s $logfile`;
95tmpdir=`realpath -s $tmpdir`;
96
97
98BOOST_ROOT=/opt/packages/boost;
99
100function configure(){
101 echo "Configuring";
102 CXXFLAGS="$2" $1/configure --prefix=$PWD >> $logfile 2>&1;
103}
104
105function compile(){
106 echo "Making";
107 make all install >>$logfile 2>&1;
108}
109
110function check(){
111 echo "Checking";
112 make check >> $logfile 2>&1;
113}
114
115function memcheck(){
116 echo "Valgrinding";
117 retval=0;
118 for test in src/unittests/*
119 do
120 if [ -x "$test" ]
121 then
122 echo -n " $test: " >> $outfile;
123 valgrind -v --error-exitcode=255 $test >> $logfile 2>&1;
124 if $?
125 then
126 echo "OK" >> $outfile
127 else
128 echo "FAIL" >> $outfile;
129 retval=1;
130 fi
131 fi
132 done
133 return $retval
134}
135
136function test(){
137
138 echo "Testing with \"$2\"";
139 echo "" >> $logfile;
140 echo "" >> $logfile;
141 echo "" >> $logfile;
142 echo "Testing with \"$2\"" >> $logfile;
143
144 echo -n " Configuring: " >> $outfile;
145 if configure "$1" "$2"
146 then
147 echo "OK" >> $outfile;
148 else
149 echo "FAIL" >> $outfile;
150 return;
151 fi
152
153 echo -n " Compiling: " >> $outfile;
154 if compile
155 then
156 echo "OK" >> $outfile;
157 else
158 echo "FAIL" >> $outfile;
159 return;
160 fi
161
162 if [ $docheck ]
163 then
164 echo -n " Running testsuite: " >> $outfile;
165 if check
166 then
167 echo "OK" >> $outfile;
168 else
169 echo "FAIL" >> $outfile;
170 return;
171 fi
172 fi
173
174 if [ $docheck_mem ]
175 then
176 echo " Checking memory Errors:..." >> $outfile;
177 if memcheck
178 then
179 echo " ...OK" >> $outfile
180 else
181 echo " ...FAIL" >> $outfile
182 return
183 fi
184 fi
185}
186
187
188
189function run(){
190 echo "Testing with \"$1\":" >> $outfile;
191 testdir=`mktemp -d --tmpdir=$tmpdir $tmppattern.XXXXXXXXXX`;
192 basedir=$PWD;
193 cd $testdir;
194 test "$basedir" "$1";
195 cd $basedir;
196 rm -rf $testdir;
197 echo "" >> $outfile;
198}
199
200
201echo -n "Full compilation test for Molecuilder started on " > $outfile;
202date >> $outfile;
203echo "" > $logfile;
204
205for optimization in "${optimizations[@]}"
206do
207 for option in "${options[@]}"
208 do
209 run "$optimization $option";
210 done
211done
212
213echo -n "Full compilation test for Molecuilder on " >> $outfile
214date >> $outfile
Note: See TracBrowser for help on using the repository browser.