source: test_all.sh@ a9099d

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults 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_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 a9099d was 490038, checked in by Frederik Heber <heber@…>, 14 years ago

added --with-valgrind switch to configure script.

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