# Process with autom4te to create an -*- Autotest -*- test suite. AT_INIT([Molecular Builder]) # Checking if command line options are parsed correctly AT_BANNER([MoleCuilder - standard options]) AT_SETUP([Standard Options]) AT_CHECK([pwd],[ignore],[ignore]) AT_CHECK([../../molecuilder -v], 0, [stdout], [ignore]) AT_CHECK([fgrep molecuilder stdout], 0, [ignore], [ignore]) AT_CHECK([../../molecuilder -h], 0, [stdout], [ignore]) AT_CHECK([fgrep "Give this help screen" stdout], 0, [ignore], [ignore]) AT_CLEANUP AT_BANNER([MoleCuilder - simple command line tests]) AT_SETUP([Simple configuration]) # 1. create a fake element database with the only element we need 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 #Element Name Symbol Period Group Block Atomic Number AtomicWeight Covalent Radius vdW Radius Hydrogen H 1 1 s 1 1.008 0.23 1.09 ]) # 2. create some simplest molecular geometry AT_DATA([test.xyz], [[1 # test configuration, created by molecuilder test suite H 10. 10. 10. ]]) # 3. make sure config is empty and not remnant from last test with broken dirs AT_DATA([test.conf], []) AT_CHECK([../../molecuilder -e elements.db -p test.xyz test.conf], 0, [ignore], [ignore]) AT_CHECK([fgrep "Ion_Type1_1" test.conf], 0, [Ion_Type1_1 10.000000000 10.000000000 10.000000000 0 # Number in molecule 0 ], [ignore]) AT_CLEANUP AT_BANNER([MoleCuilder - Fragmentation test]) AT_SETUP([Fragmentation]) # 1. create a fake element database with the only two elements we need 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 #Element Name Symbol Period Group Block Atomic Number AtomicWeight Covalent Radius vdW Radius Hydrogen H 1 1 s 1 1.008 0.23 1.09 Carbon C 2 14 p 6 12.011 0.68 1.70 ]) # 2. create molecular geometry AT_DATA([test.xyz], [[11 # test configuration, created by molecuilder test suite C 9.782085945 3.275186040 3.535886037 C 8.532785963 4.158586027 3.535886037 C 7.283585982 3.275186040 3.535886037 H 9.782085945 2.645886050 2.645886050 H 9.782085945 2.645886050 4.425886024 H 10.672039608 3.904536878 3.535886037 H 8.532785963 4.787886018 2.645886050 H 8.532785963 4.787886018 4.425886024 H 6.393632318 3.904536877 3.535886037 H 7.283585982 2.645886050 2.645886050 H 7.283585982 2.645886050 4.425886024 ]]) # 3. make sure config is empty and not remnant from last test with broken dirs AT_DATA([test.conf], []) # 4. create the config and check it AT_CHECK([../../molecuilder -e elements.db -p test.xyz test.conf], 0, [ignore], [ignore]) AT_CHECK([fgrep "Ion_Type1_4" test.conf], 0, [Ion_Type1_4 8.532785963 4.787886018 2.645886050 0 # Number in molecule 6 ], [ignore]) AT_CHECK([fgrep "Ion_Type2_4" test.conf], 1, [ignore], [ignore]) # 5. fragment the molecule and check the number of configs AT_CHECK([../../molecuilder -e elements.db -f 1.55 2 A test.conf], 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_CHECK([../../molecuilder -e elements.db -f 1.55 2 A test.conf], 0, [ignore], [ignore], [mkdir new; mv BondFragment*.conf* new/]) AT_CHECK([mkdir new; mv BondFragment*.conf* new/], 0) # 6. compare both dirs by diff'ing AT_CHECK([diff -I '.*Created by molecuilder.*' std/ new/], 0, [], []) AT_CLEANUP