Changeset 490038


Ignore:
Timestamp:
Aug 17, 2010, 5:16:34 PM (14 years ago)
Author:
Frederik Heber <heber@…>
Branches:
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
Children:
2f6f51
Parents:
293afd
git-author:
Frederik Heber <heber@…> (08/17/10 14:14:34)
git-committer:
Frederik Heber <heber@…> (08/17/10 17:16:34)
Message:

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"
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    r293afd r490038  
    1515AC_PROG_CXX
    1616AC_PROG_CC
    17 # obselete by LT_INIT
    18 #AC_PROG_RANLIB
    1917AC_PROG_INSTALL
    2018AC_CHECK_PROG([LATEX],[latex],[latex],[:])
     
    8280fi
    8381
    84 # add replacement/saturation hydrogen or not
     82# use CppUnit TestRunner or not
    8583AC_ARG_ENABLE([ecut],AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient (default is no)]),
    8684              [enable_ecut=$enableval], [enable_ecut=no])
     
    8886  AC_DEFINE(HAVE_ECUT,1, ["Use ECut TestRunnerClient instead of our own."])
    8987  AC_SUBST(HAVE_ECUT)
     88fi
     89
     90# with valgrinding testsuite or not
     91AC_ARG_WITH([valgrind],AS_HELP_STRING([--with-valgrind],[Use Valgrind on the testsuite (default is no)]),
     92              [with_valgrind=$withval], [with_valgrind=no])
     93if test x"$with_valgrind" = xyes; then
     94  AC_CHECK_HEADER([valgrind/valgrind.h],
     95    [
     96      # check header
     97      AC_DEFINE(HAVE_VALGRIND_TESTSUITE,1, ["Use Valgrind to check the testsuite."])
     98      # check path
     99      AC_PATH_PROG(VALGRIND, [valgrind], [/bin/false])
     100      # set variables
     101      AC_SUBST(HAVE_VALGRIND_TESTSUITE)
     102      AC_SUBST(VALGRIND)
     103    ],
     104    [
     105      AC_MSG_ERROR(["Valgrind support requested but headers not available."])
     106    ]
     107  )
    90108fi
    91109
  • src/builder.cpp

    r293afd r490038  
    1616 *
    1717 *  MoleCuilder - to create and alter molecular systems
    18  *  Copyright (C) 2010  University Bonn
    19  *
    20  *  This program is free software; you can redistribute it and/or modify
    21  *  it under the terms of the GNU General Public License as published by
    22  *  the Free Software Foundation; either version 2 of the License, or
    23  *  (at your option) any later version.
    24  *
    25  *  This program is distributed in the hope that it will be useful,
    26  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    27  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    28  *  GNU General Public License for more details.
    29  *
    30  *  You should have received a copy of the GNU General Public License
    31  *  along with this program; if not, write to the Free Software
    32  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
     18 *  Copyright (C) 2010  University Bonn. All rights reserved.
    3319 *
    3420 */
     
    163149  cout << MOLECUILDERVERSION << endl;
    164150  cout << "MoleCuilder comes with ABSOLUTELY NO WARRANTY; for details type" << endl;
    165   cout << "`" << argv[0] << " --help-warranty'." << endl;
    166   cout << "This is free software, and you are welcome to redistribute it" << endl;
    167   cout << "under certain conditions; type `" << argv[0] << " --help-redistribute'" << endl;
    168   cout << "for details." << endl;
     151  cout << "`molecuilder --help-warranty'." << endl;
     152  cout << "`MoleCuilder - to create and alter molecular systems." << endl;
     153  cout << "Copyright (C) 2010  University Bonn. All rights reserved." << endl;
    169154
    170155  setVerbosity(0);
  • test_all.sh

    r293afd r490038  
    11#!/bin/bash
    22
    3 optimizations=("-O0"\
     3optimizations=("-g3"\
     4               "-O0"\
    45               "-O1"\
    56               "-O2"\
     
    4950}
    5051
     52function logdate()
     53{
     54  echo -e "Launched on `date`.\n\n" >> $logfile 2>&1;
     55}
     56
     57
    5158while getopts “ho:f:j:scO:t:p:” OPTION
    5259do
     
    105112function configure(){
    106113  echo "Configuring";
    107   CXXFLAGS="$2" $1/configure --prefix=$PWD >> $logfile 2>&1;
     114  $1/configure $3 --prefix=$PWD CXXFLAGS="-Wall $2" >> $logfile 2>&1;
    108115}
    109116
     
    134141    then
    135142      echo -n "    $test: " >> $outfile;
    136       valgrind -v --error-exitcode=255 $test >> $logfile 2>&1;
     143      valgrind -v --leak-check=full --leak-resolution=high --show-reachable=yes --error-exitcode=255 $test >> $logfile 2>&1;
    137144      if [ $? ]
    138145      then
     
    149156function test(){
    150157
    151   echo "Testing with \"$2\"";
     158  echo "Testing with \"$2 $3\"";
    152159  echo "" >> $logfile;
    153160  echo "" >> $logfile;
    154161  echo "" >> $logfile;
    155   echo "Testing with \"$2\"" >> $logfile;
    156 
    157   echo -n "  Configuring: " >> $outfile;
    158   if configure "$1" "$2"
     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"
    159172  then
    160173    echo "OK" >> $outfile;
     
    201214
    202215function run(){
    203   echo "Testing with \"$1\":" >> $outfile;
     216  echo "Testing with \"$1 $2\":" >> $outfile;
    204217  testdir=`mktemp -d --tmpdir=$tmpdir $tmppattern.XXXXXXXXXX`;
    205218  basedir=$PWD;
    206219  cd $testdir;
    207   test "$basedir" "$1";
     220  test "$basedir" "$1" "$2";
    208221  cd $basedir;
    209222  rm -rf $testdir;
     
    220233  for option in "${options[@]}"
    221234  do
    222     run "$optimization $option";
     235    run "$optimization" "$option";
    223236  done
    224237done
  • tests/regression/Makefile.am

    r293afd r490038  
    11AUTOM4TE = autom4te
    2 EXTRA_DIST = testsuite.at $(TESTSUITE) atlocal.in regression
     2EXTRA_DIST = \
     3        testsuite*.at \
     4        $(TESTSUITE) \
     5        atlocal.in \
     6        molecuider.in \
     7        Analysis \
     8        Domain \
     9        Filling \
     10        Fragmentation \
     11        Graph \
     12        Molecules \
     13        Simple_configuration \
     14        Tesselation
    315TESTSUITE = $(srcdir)/testsuite
    416
  • tests/regression/atlocal.in

    r293afd r490038  
    11prefix='@prefix@'
    22exec_prefix='@prefix@'
    3 topdir='@topdir@'
     3topdir='@abs_top_builddir@'
    44bindir='@bindir@'
     5valgrind='@VALGRIND@'
  • tests/regression/molecuilder.in

    r293afd r490038  
    33# wrapper for testing molecuilder
    44
    5 . ../../atconfig
     5. ../../atlocal
    66
    7 "${abs_top_builddir}/src/molecuilder" \
    8         ${1+"$@"}
     7if test ! -z ${valgrind}
     8then
     9G_SLICE=always-malloc G_DEBUG=gc-friendly \
     10libtool --mode=execute \
     11${valgrind} -v \
     12--log-file=valgrind.log \
     13--time-stamp=yes \
     14--error-exitcode=255 \
     15--leak-check=full \
     16--leak-resolution=high \
     17--num-callers=20 \
     18--track-origins=yes \
     19--show-reachable=yes \
     20"${topdir}/src/molecuilder" \
     21${1+"$@"}
     22else
     23"${topdir}/src/molecuilder" \
     24${1+"$@"}
     25fi
     26
    927status=$?
    1028
Note: See TracChangeset for help on using the changeset viewer.