source: test_all.sh@ 215b89

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 215b89 was c644a5, checked in by Frederik Heber <heber@…>, 14 years ago

test_all.sh now accepts "-j" to allow for parallel compiling, autotests used parallel-tests testdriver.

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