source: utils/developer/createGuiChecks.sh@ fae462

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 fae462 was fae462, checked in by Frederik Heber <heber@…>, 10 years ago

Added script file to generate guichecks testsuite from regression tests.

  • options-no-elements.db and options-empty-configs works with faulty arguments. This cannot be replicated with molecuildergui.
  • all load- and store-sessions removed due to (then) multiply occurrences of said action (we need store-session to create the script for molecuildergui).
  • dry-run will not cause errors, hence error code of script creation call must always be 0.
  • refreshes TESTSCRIPTS variable in Makefile.am.
  • Property mode set to 100755
File size: 2.9 KB
Line 
1#!/bin/bash
2
3test ! -z $1 || { echo "Usage: $0 <relative destdir>"; exit 255; }
4DIR=$1
5
6# false
7exceptions=(
8"testsuite-options-no-elements-db.at"
9"testsuite-options-invalid-commands.at"
10"testsuite-options-empty-configs.at"
11"testsuite-options-store-session-cli.at"
12"testsuite-options-store-session-python.at"
13"testsuite-options-load-session-python.at"
14"testsuite-options-dryrun.at"
15"testsuite-options-no-dryrun.at"
16"testsuite-options-dryrun-storesession.at"
17)
18
19# copy Makefile.am
20#cp Makefile.am $DIR
21#cp testsuite.at $DIR
22
23# go over all testsuite files
24for file in `find . -name 'testsuite*.at' | grep -v "/testsuite\.at"`; do
25 filename=`basename ${file} | sed -e "s#testsuite#session#" -e "s#\.at#.py#"`
26 basename=`basename $file`
27 dirname=`dirname $file`
28 found=0
29 for e in `seq 0 $((${#exceptions[*]}-1))`; do
30 if test "$basename" == "${exceptions[$e]}"; then
31 echo "${exceptions[$e]} is excluded."
32 found=1
33 fi
34 done
35 if test $found != 1; then
36 mkdir -p $DIR/$dirname
37 sed -e "s#\(AT_CHECK(\)\[../../molecuilder \([^]]*\)\][[:space:]]*,[[:space:]]*\([0-9]*\)\(.*\)#\1[../../molecuilder --dry-run \2 --no-dry-run --store-session $filename --session-type python], 0\4\nAT_CHECK([grep -v \"Command.*DryRun\" $filename >${filename/.py/_new.py}], 0, [ignore], [ignore])\n\1[../../molecuilderguitest ${filename/.py/_new.py}], \3\4#" -e "/^AT_CHECK(\[[a-z]*grep.*stdout/d" $file >$DIR/$file
38 else
39 rm -f $DIR/$file
40 fi
41done
42
43# grep and remove exceptions from all top-level testsuite files
44testscripts=""
45for file in `find . -name 'testsuite*.at' | grep -v "/testsuite\.at"`; do
46 basename=`basename $file`
47 found=1
48 while test $found == 1; do
49 found=0
50 for e in `seq 0 $((${#exceptions[*]}-1))`; do
51 grep -E "m4_include.*${exceptions[$e]}" $DIR/$file &>/dev/null
52 if test $? == 0; then
53 echo "${exceptions[$e]} is removed from $DIR/$file."
54 found=1
55 # remove from file
56 mv -f $DIR/$file $DIR/${file}.bak
57 cat <$DIR/${file}.bak | grep -v -E "m4_include.*${exceptions[$e]}" >$DIR/$file
58 rm -f $DIR/${file}.bak
59 fi
60 done
61 done
62 removed=0
63 for e in `seq 0 $((${#exceptions[*]}-1))`; do
64 if test "$basename" == "${exceptions[$e]}"; then
65 removed=1
66 fi
67 done
68 if test $removed == 0; then
69 # add to TESTSCRIPTS
70 if test -z "$testscripts"; then
71 testscripts="\t\$(srcdir)/${file}"
72 else
73 testscripts="${testscripts} \\\\\n\t\$(srcdir)/${file}"
74 fi
75 fi
76done
77
78# modify TESTSCRIPTS variable in Makefile.am
79startline=`grep -n "TESTSCRIPTS =" $DIR/Makefile.am | awk -F":" '{print $1}'`
80endline=`grep -n "DISTCLEANFILES =" $DIR/Makefile.am | awk -F":" '{print $1}'`
81mv $DIR/Makefile.am $DIR/Makefile.am.bak
82head -n $startline $DIR/Makefile.am.bak >$DIR/Makefile.am
83echo -e "\t\$(srcdir)/./Testlauncher/testsuite-testlauncher-works.at \\" >>$DIR/Makefile.am
84echo -e "${testscripts}" >>$DIR/Makefile.am
85echo -e -n "\n" >>$DIR/Makefile.am
86tail -n +${endline} $DIR/Makefile.am.bak >>$DIR/Makefile.am
87rm -f $DIR/Makefile.am.bak
88
89exit 0
Note: See TracBrowser for help on using the repository browser.