Changeset d78b15 for test_all.sh


Ignore:
Timestamp:
Jul 7, 2010, 5:19:35 PM (15 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:
56f4af
Parents:
d6f4d5
git-author:
Tillmann Crueger <crueger@…> (06/24/10 11:24:49)
git-committer:
Frederik Heber <heber@…> (07/07/10 17:19:35)
Message:

Added several options to test script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test_all.sh

    rd6f4d5 rd78b15  
    1919        );
    2020
    21 outfile=$PWD/"test.log";
     21outfile="test.log";
     22logfile="full.log";
     23docheck=0;
     24docheck_mem=0;
     25
     26function usage(){
     27  echo "usage $0 options";
     28  echo "";
     29  echo "This script runs a full test for molecuilder, using several compilation options";
     30  echo "";
     31  echo "OPTIONS:";
     32  echo "  -h                    Show this message"
     33  echo "  -o <outfile>          Outfile to use for test results";
     34  echo "  -f <logfile>          File to use for output from commands";
     35  echo "  -s                    Short tests (no memcheck)";
     36  echo "  -c                    Only configure and compile (implies -s)";
     37  echo "  -O <opt-level>        Only compile this optimization level";
     38}
     39
     40while getopts “ho:f:scO:” OPTION
     41do
     42  case $OPTION in
     43   h)
     44      usage;
     45      exit 0;
     46      ;;
     47   o)
     48     outfile=$OPTARG;
     49     ;;
     50   f)
     51     logfile=$OPTARG;
     52     ;;
     53   s)
     54     docheck_mem=1;
     55     ;;
     56   c)
     57     docheck=1;
     58     docheck_mem=1;
     59     ;;
     60   O)
     61     optimizations=("-O$OPTARG");
     62     ;;
     63   ?)
     64     usage;
     65     exit 1;
     66     ;;
     67  esac
     68done
     69
     70if [[ -z $outfile ]] || [[ -z $logfile ]]
     71then
     72  usage;
     73  exit 1;
     74fi
     75
     76outfile=`realpath -s $outfile`;
     77logfile=`realpath -s $logfile`;
     78
    2279
    2380BOOST_ROOT=/opt/packages/boost;
     
    2582function configure(){
    2683  echo "Configuring";
    27   CXXFLAGS="$2" $1/configure --prefix=$PWD;
     84  CXXFLAGS="$2" $1/configure --prefix=$PWD >> $logfile 2>&1;
    2885}
    2986
    3087function compile(){
    3188  echo "Making";
    32   make all install;
     89  make all install >>$logfile 2>&1;
    3390}
    3491
    3592function check(){
    3693  echo "Checking";
    37   make check;
     94  make check >> $logfile 2>&1;
    3895}
    3996
    4097function memcheck(){
     98  echo "Valgrinding";
    4199  retval=0;
    42100  for test in molecuilder/src/unittests/*
     
    45103    then
    46104      echo -n "    $test: " >> $outfile;
    47       if valgrind -v --error-exitcode=255 $test
     105      valgrind -v --error-exitcode=255 $test >> $logfile 2>&1;
     106      if $?
    48107      then
    49108        echo "OK" >> $outfile
     
    54113    fi
    55114  done
    56   return retval
     115  return $retval
    57116}
    58117
    59118function test(){
     119
     120  echo "Testing with \"$2\"";
    60121
    61122  echo -n "  Configuring: " >> $outfile;
     
    77138  fi
    78139
    79   echo -n "  Running testsuite: " >> $outfile;
    80   if check
     140  if docheck
    81141  then
    82     echo "OK" >> $outfile;
    83   else
    84     echo "FAIL" >> $outfile;
    85     return;
     142    echo -n "  Running testsuite: " >> $outfile;
     143    if check
     144    then
     145      echo "OK" >> $outfile;
     146    else
     147      echo "FAIL" >> $outfile;
     148      return;
     149    fi
    86150  fi
    87151
    88   echo  "  Checking memory Errors:..." >> $outfile;
    89   if memcheck
     152  if docheck_mem
    90153  then
    91     echo "  ...OK" >> $outfile
    92   else
    93     echo "  ...FAIL" >> $outfile
    94     return
     154    echo  "  Checking memory Errors:..." >> $outfile;
     155    if memcheck
     156    then
     157      echo "  ...OK" >> $outfile
     158    else
     159      echo "  ...FAIL" >> $outfile
     160      return
     161    fi
    95162  fi
    96163}
     
    112179echo -n "Full compilation test for Molecuilder started on " > $outfile;
    113180date >> $outfile;
     181echo "" >> $logfile;
    114182
    115183for optimization in "${optimizations[@]}"
Note: See TracChangeset for help on using the changeset viewer.