# Process with autom4te to create an -*- Autotest -*- test suite. # # see regression/... subdirs wherein for each of the cases and each check (enumerated) is a pre and post dir. # In pre initial files are placed, in post results can be found to be checked by diff in this testsuite. AT_INIT([Molecular Builder]) # Checking if command line options are parsed correctly AT_BANNER([MoleCuilder - standard options]) AT_SETUP([Standard Options]) AT_KEYWORDS([options]) AT_CHECK([pwd],[ignore],[ignore]) AT_CHECK([../../molecuilder -v], 0, [stdout], [ignore]) AT_CHECK([fgrep olecuilder stdout], 0, [ignore], [ignore]) AT_CHECK([../../molecuilder -h], 0, [stdout], [ignore]) AT_CHECK([fgrep "Give this help screen" stdout], 0, [ignore], [ignore]) AT_CHECK([../../molecuilder -e], 255, [ignore], [stderr]) AT_CHECK([fgrep "Not enough or invalid arguments" stderr], 0, [ignore], [ignore]) AT_CHECK([../../molecuilder test.conf], 0, [stdout], [stderr]) AT_CHECK([fgrep "Element list loading failed" stdout], 0, [ignore], [ignore]) AT_CLEANUP AT_BANNER([MoleCuilder - molecular config creation from xyz file and atom adding]) AT_KEYWORDS([Atom handling]) # 1. create some simplest molecular geometry AT_SETUP([Simple configuration - xyz file generation]) AT_DATA([test.xyz], [[1 # test configuration, created by molecuilder test suite H 10. 10. 10. ]]) AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/1/post/$file], 0, [ignore], [ignore]) AT_CLEANUP # 2. parsing an xyz AT_SETUP([Simple configuration - parsing xyz file]) AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/2/pre/test.xyz .], 0) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -p test.xyz], 0, [ignore], [ignore]) AT_CHECK([fgrep "Ion_Type1_1" test.conf], 0, [Ion_Type1_1 10.000000000 10.000000000 10.000000000 0 # molecule nr 0 ], [ignore]) AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/2/post/$file], 0, [ignore], [ignore]) AT_CHECK([file=test.conf.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/2/post/$file], 0, [ignore], [ignore]) 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]) # 3. add atom AT_CLEANUP AT_SETUP([Simple configuration - adding atom]) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -a 1 10. 10. 10.], 0, [ignore], [ignore]) AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/3/post/$file], 0, [ignore], [ignore]) AT_CHECK([file=test.conf.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/3/post/$file], 0, [ignore], [ignore]) 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]) AT_CLEANUP # 4. change the element AT_SETUP([Simple configuration - Changing element]) AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/4/pre/test.conf test.conf], 0) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -E 0 6], 0, [ignore], [ignore]) AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/4/post/$file], 0, [ignore], [ignore]) AT_CLEANUP # 5. remove atom AT_SETUP([Simple configuration - Atom removal]) AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/5/pre/test.conf .], 0) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -r 0], 0, [ignore], [ignore]) AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/5/post/$file], 0, [ignore], [ignore]) AT_CHECK([file=test.conf.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/5/post/$file], 0, [ignore], [ignore]) 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]) AT_CLEANUP # 6. test some more configuration that all desire parameters and count how many complain AT_SETUP([Simple configuration - invalid commands on empty configs]) AT_CHECK([../../molecuilder empty.conf -e ${abs_top_srcdir}/src/ -t -s -b -E -c -b -a -U -T -u], 255, [ignore], [stderr]) AT_CHECK([fgrep -c "Not enough or invalid" stderr], 0, [1 ], [ignore]) AT_CLEANUP # 7. test some more configuration that all need parameters and count how many complain AT_SETUP([Simple configuration - invalid commands on present configs]) AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Simple_configuration/7/pre/test.conf .], 0) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -t], 255, [ignore], [stderr]) AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore]) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -s -b -E -c -b -a -U -T -u], 255, [ignore], [stderr]) AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore]) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -b -E -c -b -a -U -T -u], 255, [ignore], [stderr]) AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore]) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -E -c -b -a -U -T -u], 255, [ignore], [stderr]) AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore]) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -c -b -a -U -T -u], 255, [ignore], [stderr]) AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore]) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -b -a -U -T -u], 255, [ignore], [stderr]) AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore]) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -a -U -T -u], 255, [ignore], [stderr]) AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore]) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -U -T -u], 255, [ignore], [stderr]) AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore]) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -T -u], 255, [ignore], [stderr]) AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore]) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -u], 255, [ignore], [stderr]) AT_CHECK([fgrep -c "CRITICAL: Not enough or invalid" stderr], 0, [ignore], [ignore]) AT_CLEANUP AT_BANNER([MoleCuilder - Graph routines test]) AT_KEYWORDS([graph]) AT_SETUP([Graph - DFS analysis]) AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Graph/1/pre/test.conf .], 0) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -vvv -D 2.], 0, [stdout], [stderr]) AT_CHECK([fgrep -c "No rings were detected in the molecular structure." stdout], 0, [1 ], [ignore]) AT_CLEANUP AT_BANNER([MoleCuilder - Fragmentation and Re-fragmentation test]) AT_KEYWORDS([fragmentation]) # 1. check config AT_SETUP([Fragmentation - Checking present config]) AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Fragmentation/1/pre/test.conf .], 0) AT_CHECK([fgrep "Ion_Type1_4" test.conf], 0, [Ion_Type1_4 8.532785963 4.787886018 2.645886050 0 # molecule nr 6 ], [ignore]) AT_CHECK([fgrep "Ion_Type2_4" test.conf], 1, [ignore], [ignore]) AT_CLEANUP # 2. fragment the molecule and check the number of configs AT_SETUP([Fragmentation - Fragmentation]) AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Fragmentation/2/pre/test.conf .], 0) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -f 1.55 2], 0, [ignore], [ignore], [mkdir std; mv BondFragment*.conf* std/]) AT_CHECK([mkdir std; mv BondFragment*.conf* std/], 0) AT_CHECK([ls -l std/BondFragment*.conf | wc -l], 0, [5 ], [ignore]) AT_CLEANUP # 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) AT_SETUP([Fragmentation - Fragmentation is at MaxOrder]) AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Fragmentation/3/pre/* .], 0) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -f 1.55 2], 2, [ignore], [ignore], [mkdir new; mv BondFragment*.conf* new/]) AT_CHECK([mkdir new; mv BondFragment*.conf* new/], 0) AT_CLEANUP AT_BANNER([MoleCuilder - Tesselation test]) AT_KEYWORDS([Tesselation]) # 1. Non convex tesselation AT_SETUP([Tesselation - Non-Convex Envelope]) AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/1/pre/* .], 0) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -N 4. NonConvexEnvelope], 0, [stdout], [stderr]) AT_CHECK([file=NonConvexEnvelope.dat; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/1/post/$file], 0, [ignore], [ignore]) AT_CHECK([file=NonConvexEnvelope.r3d; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/1/post/$file], 0, [ignore], [ignore]) AT_CLEANUP # 2. convex tesselation (where the non-convex is already convex) AT_SETUP([Tesselation - Convex Envelope]) AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/2/pre/* .], 0) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -o ConvexEnvelope NonConvexEnvelope], 0, [stdout], [stderr]) AT_CHECK([file=ConvexEnvelope.dat; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/2/post/$file], 0, [ignore], [ignore]) AT_CHECK([file=ConvexEnvelope.r3d; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/2/post/$file], 0, [ignore], [ignore]) AT_CHECK([fgrep "tesselated volume area is 16.4016 angstrom^3" stdout], 0, [ignore], [ignore]) AT_CHECK([diff ConvexEnvelope.dat NonConvexEnvelope.dat], 0, [ignore], [ignore]) AT_CLEANUP # 3. Big Non convex tesselation AT_SETUP([Tesselation - Big non-Convex Envelope]) AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/3/pre/* .], 0) AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -N 4. NonConvexEnvelope], 0, [stdout], [stderr]) AT_CHECK([file=NonConvexEnvelope.dat; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/3/post/$file], 0, [ignore], [ignore]) AT_CHECK([file=NonConvexEnvelope.r3d; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/3/post/$file], 0, [ignore], [ignore]) AT_CLEANUP # 4. Big convex tesselation - is not working yet #AT_SETUP([Tesselation - big convex Envelope]) #AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/4/pre/* .], 0) #AT_CHECK([../../molecuilder test.conf -e ${abs_top_srcdir}/src/ -o ConvexEnvelope NonConvexEnvelope], 0, [stdout], [stderr]) #AT_CHECK([file=ConvexEnvelope.dat; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/4/post/$file], 0, [ignore], [ignore]) #AT_CHECK([file=ConvexEnvelope.r3d; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/regression/Tesselation/4/post/$file], 0, [ignore], [ignore]) #AT_CHECK([fgrep "tesselated volume area is 16.4016 angstrom^3" stdout], 0, [ignore], [ignore]) #AT_CLEANUP