Changes in tests/testsuite.at [6ac7ee:ebcade]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/testsuite.at
r6ac7ee rebcade 1 1 # Process with autom4te to create an -*- Autotest -*- test suite. 2 2 # 3 # see regression/... subdirs wherein for each of the cases and each check (enumerated) is a pre and post dir. 4 # In pre initial files are placed, in post results can be found to be checked by diff in this testsuite. 3 5 4 6 AT_INIT([Molecular Builder]) … … 7 9 AT_BANNER([MoleCuilder - standard options]) 8 10 AT_SETUP([Standard Options]) 11 AT_KEYWORDS([options]) 9 12 AT_CHECK([pwd],[ignore],[ignore]) 10 13 AT_CHECK([../../molecuilder -v], 0, [stdout], [ignore]) … … 18 21 AT_CLEANUP 19 22 23 20 24 AT_BANNER([MoleCuilder - molecular config creation from xyz file and atom adding]) 21 AT_SETUP([Simple configuration]) 22 # 1. create a fake element database with the only element we need 23 AT_DATA([elements.db],[# Covalent radius of each element in Angstroem from CSD (binding is: [Rcov(A)+Rcov(B)-t,Rcov(A)+Rcov(B)+t] with t = 0.4A 24 #Element Name Symbol Period Group Block Atomic Number AtomicWeight Covalent Radius vdW Radius 25 Hydrogen H 1 1 s 1 1.008 0.23 1.09 26 ]) 27 # 2. create some simplest molecular geometry 25 AT_KEYWORDS([Atom handling]) 26 # 1. create some simplest molecular geometry 27 AT_SETUP([Simple configuration - xyz file generation]) 28 28 AT_DATA([test.xyz], [[1 29 29 # test configuration, created by molecuilder test suite 30 30 H 10. 10. 10. 31 31 ]]) 32 # 3. make sure config is empty and not remnant from last test with broken dirs 33 AT_DATA([test.conf], []) 34 AT_CHECK([../../molecuilder test.conf -e ./ -p test.xyz], 0, [ignore], [ignore]) 35 AT_CHECK([fgrep "Ion_Type1_1" test.conf], 0, [Ion_Type1_1 10.000000000 10.000000000 10.000000000 0 # Number in molecule 0 32 AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/1/post/$file], 0, [ignore], [ignore]) 33 AT_CLEANUP 34 35 # 2. parsing an xyz 36 AT_SETUP([Simple configuration - parsing xyz file]) 37 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/2/pre/test.xyz .], 0) 38 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -p test.xyz], 0, [ignore], [ignore]) 39 AT_CHECK([fgrep "Ion_Type1_1" test.conf], 0, [Ion_Type1_1 10.000000000 10.000000000 10.000000000 0 # molecule nr 0 36 40 ], [ignore]) 37 AT_CHECK([cp test.conf main_pcp_linux], 0, [ignore], [ignore]) 38 AT_DATA([input], [aa 10. 10. 10. 1 39 s 40 q 41 ]) 42 AT_CHECK([../../molecuilder -e ./ <input], 0, [ignore], [ignore]) 43 AT_CHECK([diff main_pcp_linux test.conf], 0, [ignore], [ignore]) 44 # 4. test some more configuration 45 AT_CHECK([../../molecuilder test.conf -e ./ -t -s -b -F -E -c -b -a -U -T -u], 0, [ignore], [stderr]) 46 AT_CHECK([fgrep -c "Not enough or invalid" stderr], 0, [10 41 AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/2/post/$file], 0, [ignore], [ignore]) 42 AT_CHECK([file=test.conf.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/2/post/$file], 0, [ignore], [ignore]) 43 AT_CHECK([file=test.conf.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/2/post/$file], 0, [ignore], [ignore]) 44 45 # 3. add atom 46 AT_CLEANUP 47 AT_SETUP([Simple configuration - adding atom]) 48 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -a 1 10. 10. 10.], 0, [ignore], [ignore]) 49 AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/3/post/$file], 0, [ignore], [ignore]) 50 AT_CHECK([file=test.conf.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/3/post/$file], 0, [ignore], [ignore]) 51 AT_CHECK([file=test.conf.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/3/post/$file], 0, [ignore], [ignore]) 52 AT_CLEANUP 53 54 # 4. change the element 55 AT_SETUP([Simple configuration - Changing element]) 56 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/4/pre/test.conf test.conf], 0) 57 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -E 0 6], 0, [ignore], [ignore]) 58 AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/4/post/$file], 0, [ignore], [ignore]) 59 AT_CLEANUP 60 61 # 5. remove atom 62 AT_SETUP([Simple configuration - Atom removal]) 63 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/5/pre/test.conf .], 0) 64 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -r 0], 0, [ignore], [ignore]) 65 AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/5/post/$file], 0, [ignore], [ignore]) 66 AT_CHECK([file=test.conf.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/5/post/$file], 0, [ignore], [ignore]) 67 AT_CHECK([file=test.conf.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/5/post/$file], 0, [ignore], [ignore]) 68 AT_CLEANUP 69 70 # 6. test some more configuration that all desire parameters and count how many complain 71 AT_SETUP([Simple configuration - invalid commands on empty configs]) 72 AT_CHECK([../../molecuilder empty.conf -e ${abs_top_srcdir}/src/ -t -s -b -E -c -b -a -U -T -u], 255, [ignore], [stderr]) 73 AT_CHECK([fgrep -c "Not enough or invalid" stderr], 0, [1 74 ], [ignore]) 75 AT_CLEANUP 76 77 # 7. test some more configuration that all need parameters and count how many complain 78 AT_SETUP([Simple configuration - invalid commands on present configs]) 79 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/7/pre/test.conf .], 0) 80 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -t -s -b -E -c -b -a -U -T -u], 255, [ignore], [stderr]) 81 AT_CHECK([fgrep -c "Not enough or invalid" stderr], 0, [9 82 ], [ignore]) 83 AT_CLEANUP 84 85 86 AT_BANNER([MoleCuilder - Graph routines test]) 87 AT_KEYWORDS([graph]) 88 AT_SETUP([Graph - DFS analysis]) 89 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Graph/1/pre/test.conf .], 0) 90 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -D 2.], 0, [stdout], [stderr]) 91 AT_CHECK([fgrep -c "No rings were detected in the molecular structure." stdout], 0, [1 47 92 ], [ignore]) 48 93 AT_CLEANUP 49 94 50 95 AT_BANNER([MoleCuilder - Fragmentation and Re-fragmentation test]) 51 AT_SETUP([Fragmentation]) 52 # 1. create a fake element database with the only two elements we need 53 AT_DATA([elements.db],[# Covalent radius of each element in Angstroem from CSD (binding is: [Rcov(A)+Rcov(B)-t,Rcov(A)+Rcov(B)+t] with t = 0.4A 54 #Element Name Symbol Period Group Block Atomic Number AtomicWeight Covalent Radius vdW Radius 55 Hydrogen H 1 1 s 1 1.008 0.23 1.09 56 Carbon C 2 14 p 6 12.011 0.68 1.70 57 ]) 58 # 2. create molecular geometry 59 AT_DATA([test.xyz], [[11 60 # test configuration, created by molecuilder test suite 61 C 9.782085945 3.275186040 3.535886037 62 C 8.532785963 4.158586027 3.535886037 63 C 7.283585982 3.275186040 3.535886037 64 H 9.782085945 2.645886050 2.645886050 65 H 9.782085945 2.645886050 4.425886024 66 H 10.672039608 3.904536878 3.535886037 67 H 8.532785963 4.787886018 2.645886050 68 H 8.532785963 4.787886018 4.425886024 69 H 6.393632318 3.904536877 3.535886037 70 H 7.283585982 2.645886050 2.645886050 71 H 7.283585982 2.645886050 4.425886024 72 ]]) 73 # 3. make sure config is empty and not remnant from last test with broken dirs 74 AT_DATA([test.conf], []) 75 # 4. create the config and check it 76 AT_CHECK([../../molecuilder test.conf -e ./ -p test.xyz], 0, [ignore], [ignore]) 77 AT_CHECK([fgrep "Ion_Type1_4" test.conf], 0, [Ion_Type1_4 8.532785963 4.787886018 2.645886050 0 # Number in molecule 6 96 AT_KEYWORDS([fragmentation]) 97 # 1. check config 98 AT_SETUP([Fragmentation - Checking present config]) 99 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Fragmentation/1/pre/test.conf .], 0) 100 AT_CHECK([fgrep "Ion_Type1_4" test.conf], 0, [Ion_Type1_4 8.532785963 4.787886018 2.645886050 0 # molecule nr 6 78 101 ], [ignore]) 79 102 AT_CHECK([fgrep "Ion_Type2_4" test.conf], 1, [ignore], [ignore]) 80 # 5. fragment the molecule and check the number of configs 81 AT_CHECK([../../molecuilder test.conf -e ./ -f 1.55 2], 0, [ignore], [ignore], [mkdir std; mv BondFragment*.conf* std/]) 103 AT_CLEANUP 104 # 2. fragment the molecule and check the number of configs 105 AT_SETUP([Fragmentation - Fragmentation]) 106 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Fragmentation/2/pre/test.conf .], 0) 107 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -f 1.55 2], 0, [ignore], [ignore], [mkdir std; mv BondFragment*.conf* std/]) 82 108 AT_CHECK([mkdir std; mv BondFragment*.conf* std/], 0) 83 109 AT_CHECK([ls -l std/BondFragment*.conf | wc -l], 0, [5 84 110 ], [ignore]) 85 # 3a. check whether parsing of BondFragment files and re-rwriting config files is working (exit code is 2 as we don't need to continue wrt to ...OrderAtSite) 86 AT_CHECK([../../molecuilder test.conf -e ./ -f 1.55 2], 2, [ignore], [ignore], [mkdir new; mv BondFragment*.conf* new/]) 111 AT_CLEANUP 112 # 3. check whether parsing of BondFragment files and re-rwriting config files is working (exit code is 2 as we don't need to continue wrt to ...OrderAtSite) 113 AT_SETUP([Fragmentation - Fragmentation is at MaxOrder]) 114 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Fragmentation/3/pre/* .], 0) 115 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -f 1.55 2], 2, [ignore], [ignore], [mkdir new; mv BondFragment*.conf* new/]) 87 116 AT_CHECK([mkdir new; mv BondFragment*.conf* new/], 0) 88 # 6. compare both dirs by diff'ing89 AT_CHECK([diff -I '.*Created by molecuilder.*' std/ new/], 0, [], [])90 117 AT_CLEANUP 91 118 119 120 AT_BANNER([MoleCuilder - Tesselation test]) 121 AT_KEYWORDS([Tesselation]) 122 # 1. Non convex tesselation 123 AT_SETUP([Tesselation - Non-Convex Envelope]) 124 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/1/pre/* .], 0) 125 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -N 4. NonConvexEnvelope], 0, [stdout], [stderr]) 126 AT_CHECK([file=NonConvexEnvelope.dat; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/1/post/$file], 0, [ignore], [ignore]) 127 AT_CHECK([file=NonConvexEnvelope.r3d; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/1/post/$file], 0, [ignore], [ignore]) 128 AT_CLEANUP 129 130 # 2. convex tesselation (where the non-convex is already convex) 131 AT_SETUP([Tesselation - Convex Envelope]) 132 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/2/pre/* .], 0) 133 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -o ConvexEnvelope NonConvexEnvelope], 0, [stdout], [stderr]) 134 AT_CHECK([file=ConvexEnvelope.dat; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/2/post/$file], 0, [ignore], [ignore]) 135 AT_CHECK([file=ConvexEnvelope.r3d; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/2/post/$file], 0, [ignore], [ignore]) 136 AT_CHECK([fgrep "RESULT: The summed volume is 16.401577 angstrom^3" stdout], 0, [ignore], [ignore]) 137 AT_CHECK([diff ConvexEnvelope.dat NonConvexEnvelope.dat], 0, [ignore], [ignore]) 138 AT_CLEANUP 139 140 # 3. Big Non convex tesselation 141 AT_SETUP([Tesselation - Big non-Convex Envelope]) 142 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/3/pre/* .], 0) 143 AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -N 4. NonConvexEnvelope], 0, [stdout], [stderr]) 144 AT_CHECK([file=NonConvexEnvelope.dat; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/3/post/$file], 0, [ignore], [ignore]) 145 AT_CHECK([file=NonConvexEnvelope.r3d; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/3/post/$file], 0, [ignore], [ignore]) 146 AT_CLEANUP 147 148 # 4. Big convex tesselation - is not working yet 149 #AT_SETUP([Tesselation - big convex Envelope]) 150 #AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/4/pre/* .], 0) 151 #AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -o ConvexEnvelope NonConvexEnvelope], 0, [stdout], [stderr]) 152 #AT_CHECK([file=ConvexEnvelope.dat; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/4/post/$file], 0, [ignore], [ignore]) 153 #AT_CHECK([file=ConvexEnvelope.r3d; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/4/post/$file], 0, [ignore], [ignore]) 154 #AT_CHECK([fgrep "RESULT: The summed volume is 16.401577 angstrom^3" stdout], 0, [ignore], [ignore]) 155 #AT_CLEANUP 156
Note:
See TracChangeset
for help on using the changeset viewer.