# # MoleCuilder - creates and alters molecular systems # Copyright (C) 2008-2012 University of Bonn # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # ### 3. (un)select molecules by formula AT_SETUP([Selection - Molecule by formula]) AT_KEYWORDS([selection molecule select-molecules-by-formula]) regressionpath="${abs_top_srcdir}/tests/regression/Selection/Molecules/MoleculeByFormula" srcfile=mix.xyz testfile=test.xyz targetfile=water.xyz AT_CHECK([cp -n ${regressionpath}/pre/$srcfile $testfile], 0) AT_CHECK([../../molecuilder -i $testfile -I --select-molecules-by-formula H2O -s $targetfile], 0, [stdout], [stderr]) AT_CHECK([diff -I '.*Created by molecuilder.*' $targetfile ${regressionpath}/post/$targetfile], 0, [ignore], [ignore]) regressionpath="${abs_top_srcdir}/tests/regression/Selection/Molecules/MoleculeByFormula" srcfile=mix.xyz testfile=test.xyz targetfile=ethanol.xyz AT_CHECK([cp -n ${regressionpath}/pre/$srcfile $testfile], 0) AT_CHECK([../../molecuilder -i $testfile -I --select-molecules-by-formula "C2H5(OH)" -s $targetfile], 0, [stdout], [stderr]) AT_CHECK([diff -I '.*Created by molecuilder.*' $targetfile ${regressionpath}/post/$targetfile], 0, [ignore], [ignore]) regressionpath="${abs_top_srcdir}/tests/regression/Selection/Molecules/MoleculeByFormula" srcfile=mix.xyz testfile=test.xyz targetfile=benzene.xyz AT_CHECK([cp -n ${regressionpath}/pre/$srcfile $testfile], 0) AT_CHECK([../../molecuilder -i $testfile -I --select-molecules-by-formula C6H6 -s $targetfile], 0, [stdout], [stderr]) AT_CHECK([diff -I '.*Created by molecuilder.*' $targetfile ${regressionpath}/post/$targetfile], 0, [ignore], [ignore]) AT_CLEANUP AT_SETUP([Selection - Molecule by formula with Undo]) AT_KEYWORDS([selection molecule select-molecules-by-formula undo]) comparisonfile=empty.xyz regressionpath="${abs_top_srcdir}/tests/regression/Selection/Molecules/MoleculeByFormula" srcfile=mix.xyz testfile=test.xyz targetfile=empty1.xyz AT_CHECK([cp -n ${regressionpath}/pre/$srcfile $testfile], 0) AT_CHECK([../../molecuilder -i $testfile -I --select-molecules-by-formula H2O --undo -s $targetfile], 0, [stdout], [stderr]) AT_CHECK([diff -I '.*Created by molecuilder.*' $targetfile ${regressionpath}/post/$comparisonfile], 0, [ignore], [ignore]) regressionpath="${abs_top_srcdir}/tests/regression/Selection/Molecules/MoleculeByFormula" srcfile=mix.xyz testfile=test.xyz targetfile=empty2.xyz AT_CHECK([cp -n ${regressionpath}/pre/$srcfile $testfile], 0) AT_CHECK([../../molecuilder -i $testfile -I --select-molecules-by-formula "C2H5(OH)" --undo -s $targetfile], 0, [stdout], [stderr]) AT_CHECK([diff -I '.*Created by molecuilder.*' $targetfile ${regressionpath}/post/$comparisonfile], 0, [ignore], [ignore]) regressionpath="${abs_top_srcdir}/tests/regression/Selection/Molecules/MoleculeByFormula" srcfile=mix.xyz testfile=test.xyz targetfile=empty3.xyz AT_CHECK([cp -n ${regressionpath}/pre/$srcfile $testfile], 0) AT_CHECK([../../molecuilder -i $testfile -I --select-molecules-by-formula C6H6 --undo -s $targetfile], 0, [stdout], [stderr]) AT_CHECK([diff -I '.*Created by molecuilder.*' $targetfile ${regressionpath}/post/$comparisonfile], 0, [ignore], [ignore]) AT_CLEANUP AT_SETUP([Selection - Molecule by formula with Redo]) AT_KEYWORDS([selection molecule select-molecules-by-formula redo]) regressionpath="${abs_top_srcdir}/tests/regression/Selection/Molecules/MoleculeByFormula" srcfile=mix.xyz testfile=test.xyz targetfile=water.xyz AT_CHECK([cp -n ${regressionpath}/pre/$srcfile $testfile], 0) AT_CHECK([../../molecuilder -i $testfile -I --select-molecules-by-formula H2O --undo --redo -s $targetfile], 0, [stdout], [stderr]) AT_CHECK([diff -I '.*Created by molecuilder.*' $targetfile ${regressionpath}/post/$targetfile], 0, [ignore], [ignore]) regressionpath="${abs_top_srcdir}/tests/regression/Selection/Molecules/MoleculeByFormula" srcfile=mix.xyz testfile=test.xyz targetfile=ethanol.xyz AT_CHECK([cp -n ${regressionpath}/pre/$srcfile $testfile], 0) AT_CHECK([../../molecuilder -i $testfile -I --select-molecules-by-formula "C2H5(OH)" --undo --redo -s $targetfile], 0, [stdout], [stderr]) AT_CHECK([diff -I '.*Created by molecuilder.*' $targetfile ${regressionpath}/post/$targetfile], 0, [ignore], [ignore]) regressionpath="${abs_top_srcdir}/tests/regression/Selection/Molecules/MoleculeByFormula" srcfile=mix.xyz testfile=test.xyz targetfile=benzene.xyz AT_CHECK([cp -n ${regressionpath}/pre/$srcfile $testfile], 0) AT_CHECK([../../molecuilder -i $testfile -I --select-molecules-by-formula C6H6 --undo --redo -s $targetfile], 0, [stdout], [stderr]) AT_CHECK([diff -I '.*Created by molecuilder.*' $targetfile ${regressionpath}/post/$targetfile], 0, [ignore], [ignore]) AT_CLEANUP