source: test_all.sh@ 9d5ddf

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 9d5ddf was 7e0a6d, checked in by Tillmann Crueger <crueger@…>, 14 years ago

Re-Added test script to split up version of molecuilder

  • Property mode set to 100755
File size: 3.9 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 molecuilder/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
140 echo -n " Configuring: " >> $outfile;
141 if configure "$1" "$2"
142 then
143 echo "OK" >> $outfile;
144 else
145 echo "FAIL" >> $outfile;
146 return;
147 fi
148
149 echo -n " Compiling: " >> $outfile;
150 if compile
151 then
152 echo "OK" >> $outfile;
153 else
154 echo "FAIL" >> $outfile;
155 return;
156 fi
157
158 if [ $docheck ]
159 then
160 echo -n " Running testsuite: " >> $outfile;
161 if check
162 then
163 echo "OK" >> $outfile;
164 else
165 echo "FAIL" >> $outfile;
166 return;
167 fi
168 fi
169
170 if [ $docheck_mem ]
171 then
172 echo " Checking memory Errors:..." >> $outfile;
173 if memcheck
174 then
175 echo " ...OK" >> $outfile
176 else
177 echo " ...FAIL" >> $outfile
178 return
179 fi
180 fi
181}
182
183
184
185function run(){
186 echo "Testing with \"$1\":" >> $outfile;
187 testdir=`mktemp -d --tmpdir=$tmpdir $tmppattern.XXXXXXXXXX`;
188 basedir=$PWD;
189 cd $testdir;
190 test "$basedir" "$1";
191 cd $basedir;
192 rm -rf $testdir;
193 echo "" >> $outfile;
194}
195
196
197echo -n "Full compilation test for Molecuilder started on " > $outfile;
198date >> $outfile;
199echo "" > $logfile;
200
201for optimization in "${optimizations[@]}"
202do
203 for option in "${options[@]}"
204 do
205 run "$optimization $option";
206 done
207done
208
209echo -n "Full compilation test for Molecuilder on " >> $outfile
210date >> $outfile
Note: See TracBrowser for help on using the repository browser.