Index: tests/regression/Selection/Molecules/MoleculeByFormula/testsuite-selection-molecules-by-formula.at
===================================================================
--- tests/regression/Selection/Molecules/MoleculeByFormula/testsuite-selection-molecules-by-formula.at	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Molecules/MoleculeByFormula/testsuite-selection-molecules-by-formula.at	(revision 7c958e3f7ce548c4bf2fc8abe3caa46d9990fd56)
@@ -2,59 +2,180 @@
 
 
-AT_SETUP([Selection - Molecules by formula])
+AT_SETUP([Selection - Molecule by formula])
 AT_KEYWORDS([selection,molecule])
-# some variables before
-srcpath="Selection/Molecules/MoleculeByFormula"
+
+regressionpath="${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Molecules/MoleculeByFormula"
 srcfile=mix.xyz
-m4_include(CheckCommand.sh)
-# the tests
-check_command_output $srcpath $srcfile "water.xyz" "-I --select-molecules-by-formula H2O -s water.xyz"
-mv water.xyz water_a.xyz
-check_command_output $srcpath $srcfile "empty.xyz" "-I --select-molecules-by-formula H2O --undo -s empty.xyz"
-check_command_output $srcpath $srcfile "water.xyz" "-I --select-molecules-by-formula H2O --undo --redo -s water.xyz"
-mv water.xyz water_b.xyz
-AT_CHECK([diff -I '.*Created by molecuilder.*' water_a.xyz water_b.xyz], 0, [ignore], [ignore])
+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])
 
-check_command_output $srcpath $srcfile "ethanol.xyz" "-I --select-molecules-by-formula C2H5(OH) -s ethanol.xyz"
-mv ethanol.xyz ethanol_a.xyz
-check_command_output $srcpath $srcfile "empty.xyz" "-I --select-molecules-by-formula C2H5(OH) --undo -s empty.xyz"
-check_command_output $srcpath $srcfile "ethanol.xyz" "-I --select-molecules-by-formula C2H5(OH) --undo --redo -s ethanol.xyz"
-mv ethanol.xyz ethanol_b.xyz
-AT_CHECK([diff -I '.*Created by molecuilder.*' ethanol_a.xyz ethanol_b.xyz], 0, [ignore], [ignore])
+regressionpath="${abs_top_srcdir}/${AUTOTEST_PATH}/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])
 
-check_command_output $srcpath $srcfile "benzene.xyz" "-I --select-molecules-by-formula C6H6 -s benzene.xyz"
-mv benzene.xyz benzene_a.xyz
-check_command_output $srcpath $srcfile "empty.xyz" "-I --select-molecules-by-formula C6H6 --undo -s empty.xyz"
-check_command_output $srcpath $srcfile "benzene.xyz" "-I --select-molecules-by-formula C6H6 --undo --redo -s benzene.xyz"
-mv benzene.xyz benzene_b.xyz
-AT_CHECK([diff -I '.*Created by molecuilder.*' benzene_a.xyz benzene_b.xyz], 0, [ignore], [ignore])
+regressionpath="${abs_top_srcdir}/${AUTOTEST_PATH}/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([Unselection - Molecules by formula])
+
+AT_SETUP([Selection - Molecule by formula with Undo])
 AT_KEYWORDS([selection,molecule])
-# some variables before
-srcpath="Selection/Molecules/MoleculeByFormula"
+
+regressionpath="${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Molecules/MoleculeByFormula"
 srcfile=mix.xyz
-m4_include(CheckCommand.sh)
-# the tests
-check_command_output $srcpath $srcfile "water_missing.xyz" "-I --select-all-molecules --unselect-molecules-by-formula H2O -s water_missing.xyz"
-mv water_missing.xyz water_missing_a.xyz
-check_command_output $srcpath $srcfile "mix.xyz" "-I --select-all-molecules --unselect-molecules-by-formula H2O --undo -s mix.xyz"
-check_command_output $srcpath $srcfile "water_missing.xyz" "-I --select-all-molecules --unselect-molecules-by-formula H2O --undo --redo -s water_missing.xyz"
-mv water_missing.xyz water_missing_b.xyz
-AT_CHECK([diff -I '.*Created by molecuilder.*' water_missing_a.xyz water_missing_b.xyz], 0, [ignore], [ignore])
+testfile=test.xyz
+targetfile=empty.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/$targetfile], 0, [ignore], [ignore])
 
-check_command_output $srcpath $srcfile "ethanol_missing.xyz" "-I --select-all-molecules --unselect-molecules-by-formula C2H5(OH) -s ethanol_missing.xyz"
-mv ethanol_missing.xyz ethanol_missing_a.xyz
-check_command_output $srcpath $srcfile "mix.xyz" "-I --select-all-molecules --unselect-molecules-by-formula C2H5(OH) --undo -s mix.xyz"
-check_command_output $srcpath $srcfile "ethanol_missing.xyz" "-I --select-all-molecules --unselect-molecules-by-formula C2H5(OH) --undo --redo -s ethanol_missing.xyz"
-mv ethanol_missing.xyz ethanol_missing_b.xyz
-AT_CHECK([diff -I '.*Created by molecuilder.*' ethanol_missing_a.xyz ethanol_missing_b.xyz], 0, [ignore], [ignore])
+regressionpath="${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Molecules/MoleculeByFormula"
+srcfile=mix.xyz
+testfile=test.xyz
+targetfile=empty.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/$targetfile], 0, [ignore], [ignore])
 
-check_command_output $srcpath $srcfile "benzene_missing.xyz" "-I --select-all-molecules --unselect-molecules-by-formula C6H6 -s benzene_missing.xyz"
-mv benzene_missing.xyz benzene_missing_a.xyz
-check_command_output $srcpath $srcfile "mix.xyz" "-I --select-all-molecules --unselect-molecules-by-formula C6H6 --undo -s mix.xyz"
-check_command_output $srcpath $srcfile "benzene_missing.xyz" "-I --select-all-molecules --unselect-molecules-by-formula C6H6 --undo --redo -s benzene_missing.xyz"
-mv benzene_missing.xyz benzene_missing_b.xyz
-AT_CHECK([diff -I '.*Created by molecuilder.*' benzene_missing_a.xyz benzene_missing_b.xyz], 0, [ignore], [ignore])
+regressionpath="${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Molecules/MoleculeByFormula"
+srcfile=mix.xyz
+testfile=test.xyz
+targetfile=empty.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/$targetfile], 0, [ignore], [ignore])
+
 AT_CLEANUP
+
+
+AT_SETUP([Selection - Molecule by formula with Redo])
+AT_KEYWORDS([selection,molecule])
+
+regressionpath="${abs_top_srcdir}/${AUTOTEST_PATH}/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}/${AUTOTEST_PATH}/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}/${AUTOTEST_PATH}/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
+
+
+AT_SETUP([Unselection - Molecule by formula])
+AT_KEYWORDS([selection,molecule])
+
+regressionpath="${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Molecules/MoleculeByFormula"
+srcfile=mix.xyz
+testfile=test.xyz
+targetfile=water_missing.xyz
+AT_CHECK([cp -n ${regressionpath}/pre/$srcfile $testfile], 0)
+AT_CHECK([../../molecuilder -i $testfile -I --select-all-molecules --unselect-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}/${AUTOTEST_PATH}/Selection/Molecules/MoleculeByFormula"
+srcfile=mix.xyz
+testfile=test.xyz
+targetfile=ethanol_missing.xyz
+AT_CHECK([cp -n ${regressionpath}/pre/$srcfile $testfile], 0)
+AT_CHECK([../../molecuilder -i $testfile -I --select-all-molecules --unselect-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}/${AUTOTEST_PATH}/Selection/Molecules/MoleculeByFormula"
+srcfile=mix.xyz
+testfile=test.xyz
+targetfile=benzene_missing.xyz
+AT_CHECK([cp -n ${regressionpath}/pre/$srcfile $testfile], 0)
+AT_CHECK([../../molecuilder -i $testfile -I --select-all-molecules --unselect-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([Unselection - Molecule by formula with Undo])
+AT_KEYWORDS([selection,molecule])
+
+regressionpath="${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Molecules/MoleculeByFormula"
+srcfile=mix.xyz
+testfile=test.xyz
+targetfile=mix.xyz
+AT_CHECK([cp -n ${regressionpath}/pre/$srcfile $testfile], 0)
+AT_CHECK([../../molecuilder -i $testfile -I --select-all-molecules --unselect-molecules-by-formula H2O --undo -s $targetfile], 0, [stdout], [stderr])
+AT_CHECK([diff -I '.*Created by molecuilder.*' $targetfile ${regressionpath}/post/$targetfile], 0, [ignore], [ignore])
+
+regressionpath="${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Molecules/MoleculeByFormula"
+srcfile=mix.xyz
+testfile=test.xyz
+targetfile=mix.xyz
+AT_CHECK([cp -n ${regressionpath}/pre/$srcfile $testfile], 0)
+AT_CHECK([../../molecuilder -i $testfile -I --select-all-molecules --unselect-molecules-by-formula "C2H5(OH)" --undo -s $targetfile], 0, [stdout], [stderr])
+AT_CHECK([diff -I '.*Created by molecuilder.*' $targetfile ${regressionpath}/post/$targetfile], 0, [ignore], [ignore])
+
+regressionpath="${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Molecules/MoleculeByFormula"
+srcfile=mix.xyz
+testfile=test.xyz
+targetfile=mix.xyz
+AT_CHECK([cp -n ${regressionpath}/pre/$srcfile $testfile], 0)
+AT_CHECK([../../molecuilder -i $testfile -I --select-all-molecules --unselect-molecules-by-formula C6H6 --undo -s $targetfile], 0, [stdout], [stderr])
+AT_CHECK([diff -I '.*Created by molecuilder.*' $targetfile ${regressionpath}/post/$targetfile], 0, [ignore], [ignore])
+
+AT_CLEANUP
+
+
+AT_SETUP([Unselection - Molecule by formula with Redo])
+AT_KEYWORDS([selection,molecule])
+
+regressionpath="${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Molecules/MoleculeByFormula"
+srcfile=mix.xyz
+testfile=test.xyz
+targetfile=water_missing.xyz
+AT_CHECK([cp -n ${regressionpath}/pre/$srcfile $testfile], 0)
+AT_CHECK([../../molecuilder -i $testfile -I --select-all-molecules --unselect-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}/${AUTOTEST_PATH}/Selection/Molecules/MoleculeByFormula"
+srcfile=mix.xyz
+testfile=test.xyz
+targetfile=ethanol_missing.xyz
+AT_CHECK([cp -n ${regressionpath}/pre/$srcfile $testfile], 0)
+AT_CHECK([../../molecuilder -i $testfile -I --select-all-molecules --unselect-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}/${AUTOTEST_PATH}/Selection/Molecules/MoleculeByFormula"
+srcfile=mix.xyz
+testfile=test.xyz
+targetfile=benzene_missing.xyz
+AT_CHECK([cp -n ${regressionpath}/pre/$srcfile $testfile], 0)
+AT_CHECK([../../molecuilder -i $testfile -I --select-all-molecules --unselect-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
