[f3cba6] | 1 | # Process with autom4te to create an -*- Autotest -*- test suite.
|
---|
[ebcade] | 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.
|
---|
[f3cba6] | 5 |
|
---|
| 6 | AT_INIT([Molecular Builder])
|
---|
| 7 |
|
---|
| 8 | # Checking if command line options are parsed correctly
|
---|
| 9 | AT_BANNER([MoleCuilder - standard options])
|
---|
| 10 | AT_SETUP([Standard Options])
|
---|
[ebcade] | 11 | AT_KEYWORDS([options])
|
---|
[f3cba6] | 12 | AT_CHECK([pwd],[ignore],[ignore])
|
---|
| 13 | AT_CHECK([../../molecuilder -v], 0, [stdout], [ignore])
|
---|
[482373] | 14 | AT_CHECK([fgrep olecuilder stdout], 0, [ignore], [ignore])
|
---|
[f3cba6] | 15 | AT_CHECK([../../molecuilder -h], 0, [stdout], [ignore])
|
---|
| 16 | AT_CHECK([fgrep "Give this help screen" stdout], 0, [ignore], [ignore])
|
---|
[482373] | 17 | AT_CHECK([../../molecuilder -e], 255, [ignore], [stderr])
|
---|
[f00693] | 18 | AT_CHECK([fgrep "Not enough or invalid arguments" stderr], 0, [ignore], [ignore])
|
---|
| 19 | AT_CHECK([../../molecuilder test.conf], 0, [stdout], [stderr])
|
---|
| 20 | AT_CHECK([fgrep "Element list loading failed" stdout], 0, [ignore], [ignore])
|
---|
[f3cba6] | 21 | AT_CLEANUP
|
---|
| 22 |
|
---|
[ebcade] | 23 |
|
---|
[ab3a0e] | 24 | AT_BANNER([MoleCuilder - molecular config creation from xyz file and atom adding])
|
---|
[ebcade] | 25 | AT_KEYWORDS([Atom handling])
|
---|
| 26 | # 1. create some simplest molecular geometry
|
---|
| 27 | AT_SETUP([Simple configuration - xyz file generation])
|
---|
[f3cba6] | 28 | AT_DATA([test.xyz], [[1
|
---|
| 29 | # test configuration, created by molecuilder test suite
|
---|
| 30 | H 10. 10. 10.
|
---|
| 31 | ]])
|
---|
[ebcade] | 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])
|
---|
[c26f44] | 39 | AT_CHECK([fgrep "Ion_Type1_1" test.conf], 0, [Ion_Type1_1 10.000000000 10.000000000 10.000000000 0 # molecule nr 0
|
---|
[f3cba6] | 40 | ], [ignore])
|
---|
[ebcade] | 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)
|
---|
[482373] | 80 | AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -t], 255, [ignore], [stderr])
|
---|
| 81 | AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
|
---|
| 82 | AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -s -b -E -c -b -a -U -T -u], 255, [ignore], [stderr])
|
---|
| 83 | AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
|
---|
| 84 | AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -b -E -c -b -a -U -T -u], 255, [ignore], [stderr])
|
---|
| 85 | AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
|
---|
| 86 | AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -E -c -b -a -U -T -u], 255, [ignore], [stderr])
|
---|
| 87 | AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
|
---|
| 88 | AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -c -b -a -U -T -u], 255, [ignore], [stderr])
|
---|
| 89 | AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
|
---|
| 90 | AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -b -a -U -T -u], 255, [ignore], [stderr])
|
---|
| 91 | AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
|
---|
| 92 | AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -a -U -T -u], 255, [ignore], [stderr])
|
---|
| 93 | AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
|
---|
| 94 | AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -U -T -u], 255, [ignore], [stderr])
|
---|
| 95 | AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
|
---|
| 96 | AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -T -u], 255, [ignore], [stderr])
|
---|
| 97 | AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
|
---|
| 98 | AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -u], 255, [ignore], [stderr])
|
---|
| 99 | AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore])
|
---|
[f3cba6] | 100 | AT_CLEANUP
|
---|
| 101 |
|
---|
[ebcade] | 102 |
|
---|
| 103 | AT_BANNER([MoleCuilder - Graph routines test])
|
---|
| 104 | AT_KEYWORDS([graph])
|
---|
| 105 | AT_SETUP([Graph - DFS analysis])
|
---|
| 106 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Graph/1/pre/test.conf .], 0)
|
---|
[482373] | 107 | AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -vvv -D 2.], 0, [stdout], [stderr])
|
---|
[ebcade] | 108 | AT_CHECK([fgrep -c "No rings were detected in the molecular structure." stdout], 0, [1
|
---|
| 109 | ], [ignore])
|
---|
| 110 | AT_CLEANUP
|
---|
| 111 |
|
---|
[ab3a0e] | 112 | AT_BANNER([MoleCuilder - Fragmentation and Re-fragmentation test])
|
---|
[ebcade] | 113 | AT_KEYWORDS([fragmentation])
|
---|
| 114 | # 1. check config
|
---|
| 115 | AT_SETUP([Fragmentation - Checking present config])
|
---|
| 116 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Fragmentation/1/pre/test.conf .], 0)
|
---|
[c26f44] | 117 | AT_CHECK([fgrep "Ion_Type1_4" test.conf], 0, [Ion_Type1_4 8.532785963 4.787886018 2.645886050 0 # molecule nr 6
|
---|
[3c1dfb] | 118 | ], [ignore])
|
---|
| 119 | AT_CHECK([fgrep "Ion_Type2_4" test.conf], 1, [ignore], [ignore])
|
---|
[ebcade] | 120 | AT_CLEANUP
|
---|
| 121 | # 2. fragment the molecule and check the number of configs
|
---|
| 122 | AT_SETUP([Fragmentation - Fragmentation])
|
---|
| 123 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Fragmentation/2/pre/test.conf .], 0)
|
---|
| 124 | AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -f 1.55 2], 0, [ignore], [ignore], [mkdir std; mv BondFragment*.conf* std/])
|
---|
[3c1dfb] | 125 | AT_CHECK([mkdir std; mv BondFragment*.conf* std/], 0)
|
---|
| 126 | AT_CHECK([ls -l std/BondFragment*.conf | wc -l], 0, [5
|
---|
| 127 | ], [ignore])
|
---|
[ebcade] | 128 | AT_CLEANUP
|
---|
| 129 | # 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)
|
---|
| 130 | AT_SETUP([Fragmentation - Fragmentation is at MaxOrder])
|
---|
| 131 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Fragmentation/3/pre/* .], 0)
|
---|
| 132 | AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -f 1.55 2], 2, [ignore], [ignore], [mkdir new; mv BondFragment*.conf* new/])
|
---|
[3c1dfb] | 133 | AT_CHECK([mkdir new; mv BondFragment*.conf* new/], 0)
|
---|
| 134 | AT_CLEANUP
|
---|
[f3cba6] | 135 |
|
---|
[ebcade] | 136 |
|
---|
| 137 | AT_BANNER([MoleCuilder - Tesselation test])
|
---|
| 138 | AT_KEYWORDS([Tesselation])
|
---|
| 139 | # 1. Non convex tesselation
|
---|
| 140 | AT_SETUP([Tesselation - Non-Convex Envelope])
|
---|
| 141 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/1/pre/* .], 0)
|
---|
| 142 | AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -N 4. NonConvexEnvelope], 0, [stdout], [stderr])
|
---|
| 143 | AT_CHECK([file=NonConvexEnvelope.dat; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/1/post/$file], 0, [ignore], [ignore])
|
---|
| 144 | AT_CHECK([file=NonConvexEnvelope.r3d; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/1/post/$file], 0, [ignore], [ignore])
|
---|
| 145 | AT_CLEANUP
|
---|
| 146 |
|
---|
| 147 | # 2. convex tesselation (where the non-convex is already convex)
|
---|
| 148 | AT_SETUP([Tesselation - Convex Envelope])
|
---|
| 149 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/2/pre/* .], 0)
|
---|
| 150 | AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -o ConvexEnvelope NonConvexEnvelope], 0, [stdout], [stderr])
|
---|
| 151 | AT_CHECK([file=ConvexEnvelope.dat; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/2/post/$file], 0, [ignore], [ignore])
|
---|
| 152 | AT_CHECK([file=ConvexEnvelope.r3d; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/2/post/$file], 0, [ignore], [ignore])
|
---|
[482373] | 153 | AT_CHECK([fgrep "tesselated volume area is 16.4016 angstrom^3" stdout], 0, [ignore], [ignore])
|
---|
[ebcade] | 154 | AT_CHECK([diff ConvexEnvelope.dat NonConvexEnvelope.dat], 0, [ignore], [ignore])
|
---|
| 155 | AT_CLEANUP
|
---|
| 156 |
|
---|
| 157 | # 3. Big Non convex tesselation
|
---|
| 158 | AT_SETUP([Tesselation - Big non-Convex Envelope])
|
---|
| 159 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/3/pre/* .], 0)
|
---|
| 160 | AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -N 4. NonConvexEnvelope], 0, [stdout], [stderr])
|
---|
| 161 | AT_CHECK([file=NonConvexEnvelope.dat; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/3/post/$file], 0, [ignore], [ignore])
|
---|
| 162 | AT_CHECK([file=NonConvexEnvelope.r3d; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/3/post/$file], 0, [ignore], [ignore])
|
---|
| 163 | AT_CLEANUP
|
---|
| 164 |
|
---|
| 165 | # 4. Big convex tesselation - is not working yet
|
---|
| 166 | #AT_SETUP([Tesselation - big convex Envelope])
|
---|
| 167 | #AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/4/pre/* .], 0)
|
---|
| 168 | #AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -o ConvexEnvelope NonConvexEnvelope], 0, [stdout], [stderr])
|
---|
| 169 | #AT_CHECK([file=ConvexEnvelope.dat; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/4/post/$file], 0, [ignore], [ignore])
|
---|
| 170 | #AT_CHECK([file=ConvexEnvelope.r3d; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/4/post/$file], 0, [ignore], [ignore])
|
---|
[482373] | 171 | #AT_CHECK([fgrep "tesselated volume area is 16.4016 angstrom^3" stdout], 0, [ignore], [ignore])
|
---|
[ebcade] | 172 | #AT_CLEANUP
|
---|
| 173 |
|
---|