Index: tests/regression/Selection/Molecules/MoleculeByOrder/post/empty.xyz
===================================================================
--- tests/regression/Selection/Molecules/MoleculeByOrder/post/empty.xyz	(revision aa04aec0a6f98bba03446ef81b876c0dee5f6db8)
+++ tests/regression/Selection/Molecules/MoleculeByOrder/post/empty.xyz	(revision aa04aec0a6f98bba03446ef81b876c0dee5f6db8)
@@ -0,0 +1,2 @@
+0
+	Created by molecuilder for select-molecule-by-id test
Index: tests/regression/Selection/Molecules/MoleculeByOrder/post/twowater.xyz
===================================================================
--- tests/regression/Selection/Molecules/MoleculeByOrder/post/twowater.xyz	(revision aa04aec0a6f98bba03446ef81b876c0dee5f6db8)
+++ tests/regression/Selection/Molecules/MoleculeByOrder/post/twowater.xyz	(revision aa04aec0a6f98bba03446ef81b876c0dee5f6db8)
@@ -0,0 +1,8 @@
+6
+	Created by molecuilder for select-molecule-by-order test
+O	0	0	0.504284
+H	0.758602	0	1.00857
+H	0.758602	0	0
+O	0	0	3.36143
+H	0.758602	0	3.86571
+H	0.758602	0	2.85714
Index: tests/regression/Selection/Molecules/MoleculeByOrder/post/water_id0.xyz
===================================================================
--- tests/regression/Selection/Molecules/MoleculeByOrder/post/water_id0.xyz	(revision aa04aec0a6f98bba03446ef81b876c0dee5f6db8)
+++ tests/regression/Selection/Molecules/MoleculeByOrder/post/water_id0.xyz	(revision aa04aec0a6f98bba03446ef81b876c0dee5f6db8)
@@ -0,0 +1,5 @@
+3
+	Created by molecuilder for select-molecule-by-order test
+O	0	0	0.504284
+H	0.758602	0	1.00857
+H	0.758602	0	0
Index: tests/regression/Selection/Molecules/MoleculeByOrder/post/water_id1.xyz
===================================================================
--- tests/regression/Selection/Molecules/MoleculeByOrder/post/water_id1.xyz	(revision aa04aec0a6f98bba03446ef81b876c0dee5f6db8)
+++ tests/regression/Selection/Molecules/MoleculeByOrder/post/water_id1.xyz	(revision aa04aec0a6f98bba03446ef81b876c0dee5f6db8)
@@ -0,0 +1,5 @@
+3
+	Created by molecuilder for select-molecule-by-order test
+O	0	0	3.36143
+H	0.758602	0	3.86571
+H	0.758602	0	2.85714
Index: tests/regression/Selection/Molecules/MoleculeByOrder/pre/twowater.xyz
===================================================================
--- tests/regression/Selection/Molecules/MoleculeByOrder/pre/twowater.xyz	(revision aa04aec0a6f98bba03446ef81b876c0dee5f6db8)
+++ tests/regression/Selection/Molecules/MoleculeByOrder/pre/twowater.xyz	(revision aa04aec0a6f98bba03446ef81b876c0dee5f6db8)
@@ -0,0 +1,8 @@
+6
+	Created by molecuilder for select-molecule-by-order test
+O	0	0	0.504284
+H	0.758602	0	1.00857
+H	0.758602	0	0
+O	0	0	3.36143
+H	0.758602	0	3.86571
+H	0.758602	0	2.85714
Index: tests/regression/Selection/Molecules/MoleculeByOrder/testsuite-selection-molecule-by-order.at
===================================================================
--- tests/regression/Selection/Molecules/MoleculeByOrder/testsuite-selection-molecule-by-order.at	(revision aa04aec0a6f98bba03446ef81b876c0dee5f6db8)
+++ tests/regression/Selection/Molecules/MoleculeByOrder/testsuite-selection-molecule-by-order.at	(revision aa04aec0a6f98bba03446ef81b876c0dee5f6db8)
@@ -0,0 +1,86 @@
+### (un)select molecules by order
+
+
+AT_SETUP([Selection - Molecule by order, forward])
+AT_KEYWORDS([selection,molecule])
+# some variables before
+srcpath="Selection/Molecules/MoleculeByOrder"
+srcfile=twowater.xyz
+m4_include(CheckCommand.sh)
+# the tests
+check_command_output $srcpath $srcfile "water_id0.xyz" "-I --select-molecule-by-order 1 -s water_id0.xyz"
+check_command_output $srcpath $srcfile "water_id1.xyz" "-I --select-molecule-by-order 2 -s water_id1.xyz"
+mv water_id0.xyz water_id0_a.xyz
+mv water_id1.xyz water_id1_a.xyz
+check_command_output $srcpath $srcfile "empty.xyz" "-I --select-molecule-by-order 1 --undo -s empty.xyz"
+check_command_output $srcpath $srcfile "empty.xyz" "-I --select-molecule-by-order 2 --undo -s empty.xyz"
+check_command_output $srcpath $srcfile "water_id0.xyz" "-I --select-molecule-by-order 1 --undo --redo -s water_id0.xyz"
+check_command_output $srcpath $srcfile "water_id1.xyz" "-I --select-molecule-by-order 2 --undo --redo -s water_id1.xyz"
+mv water_id0.xyz water_id0_b.xyz
+mv water_id1.xyz water_id1_b.xyz
+AT_CHECK([diff -I '.*Created by molecuilder.*' water_id0_a.xyz water_id0_b.xyz], 0, [ignore], [ignore])
+AT_CHECK([diff -I '.*Created by molecuilder.*' water_id1_a.xyz water_id1_b.xyz], 0, [ignore], [ignore])
+AT_CLEANUP
+
+AT_SETUP([Selection - Molecule by order, backward])
+AT_KEYWORDS([selection,molecule])
+# some variables before
+srcpath="Selection/Molecules/MoleculeByOrder"
+srcfile=twowater.xyz
+m4_include(CheckCommand.sh)
+# the tests
+check_command_output $srcpath $srcfile "water_id0.xyz" "-I --select-molecule-by-order -2 -s water_id0.xyz"
+check_command_output $srcpath $srcfile "water_id1.xyz" "-I --select-molecule-by-order -1 -s water_id1.xyz"
+mv water_id0.xyz water_id0_a.xyz
+mv water_id1.xyz water_id1_a.xyz
+check_command_output $srcpath $srcfile "empty.xyz" "-I --select-molecule-by-order -2 --undo -s empty.xyz"
+check_command_output $srcpath $srcfile "empty.xyz" "-I --select-molecule-by-order -1 --undo -s empty.xyz"
+check_command_output $srcpath $srcfile "water_id0.xyz" "-I --select-molecule-by-order -2 --undo --redo -s water_id0.xyz"
+check_command_output $srcpath $srcfile "water_id1.xyz" "-I --select-molecule-by-order -1 --undo --redo -s water_id1.xyz"
+mv water_id0.xyz water_id0_b.xyz
+mv water_id1.xyz water_id1_b.xyz
+AT_CHECK([diff -I '.*Created by molecuilder.*' water_id0_a.xyz water_id0_b.xyz], 0, [ignore], [ignore])
+AT_CHECK([diff -I '.*Created by molecuilder.*' water_id1_a.xyz water_id1_b.xyz], 0, [ignore], [ignore])
+AT_CLEANUP
+
+AT_SETUP([Unselection - Molecule by order, forward])
+AT_KEYWORDS([selection,molecule])
+# some variables before
+srcpath="Selection/Molecules/MoleculeByOrder"
+srcfile=twowater.xyz
+m4_include(CheckCommand.sh)
+# the tests
+check_command_output $srcpath $srcfile "water_id1.xyz" "-I --select-all-molecules --unselect-molecule-by-order 1 -s water_id1.xyz"
+check_command_output $srcpath $srcfile "water_id0.xyz" "-I --select-all-molecules --unselect-molecule-by-order 2 -s water_id0.xyz"
+mv water_id1.xyz water_id1_a.xyz
+mv water_id0.xyz water_id0_a.xyz
+check_command_output $srcpath $srcfile "twowater.xyz" "-I --select-all-molecules --unselect-molecule-by-order 1 --undo -s twowater.xyz"
+check_command_output $srcpath $srcfile "twowater.xyz" "-I --select-all-molecules --unselect-molecule-by-order 2 --undo -s twowater.xyz"
+check_command_output $srcpath $srcfile "water_id1.xyz" "-I --select-all-molecules --unselect-molecule-by-order 1 --undo --redo -s water_id1.xyz"
+check_command_output $srcpath $srcfile "water_id0.xyz" "-I --select-all-molecules --unselect-molecule-by-order 2 --undo --redo -s water_id0.xyz"
+mv water_id0.xyz water_id0_b.xyz
+mv water_id1.xyz water_id1_b.xyz
+AT_CHECK([diff -I '.*Created by molecuilder.*' water_id0_a.xyz water_id0_b.xyz], 0, [ignore], [ignore])
+AT_CHECK([diff -I '.*Created by molecuilder.*' water_id1_a.xyz water_id1_b.xyz], 0, [ignore], [ignore])
+AT_CLEANUP
+
+AT_SETUP([Unselection - Molecule by order, backward])
+AT_KEYWORDS([selection,molecule])
+# some variables before
+srcpath="Selection/Molecules/MoleculeByOrder"
+srcfile=twowater.xyz
+m4_include(CheckCommand.sh)
+# the tests
+check_command_output $srcpath $srcfile "water_id1.xyz" "-I --select-all-molecules --unselect-molecule-by-order -2 -s water_id1.xyz"
+check_command_output $srcpath $srcfile "water_id0.xyz" "-I --select-all-molecules --unselect-molecule-by-order -1 -s water_id0.xyz"
+mv water_id1.xyz water_id1_a.xyz
+mv water_id0.xyz water_id0_a.xyz
+check_command_output $srcpath $srcfile "twowater.xyz" "-I --select-all-molecules --unselect-molecule-by-order -2 --undo -s twowater.xyz"
+check_command_output $srcpath $srcfile "twowater.xyz" "-I --select-all-molecules --unselect-molecule-by-order -1 --undo -s twowater.xyz"
+check_command_output $srcpath $srcfile "water_id1.xyz" "-I --select-all-molecules --unselect-molecule-by-order -2 --undo --redo -s water_id1.xyz"
+check_command_output $srcpath $srcfile "water_id0.xyz" "-I --select-all-molecules --unselect-molecule-by-order -1 --undo --redo -s water_id0.xyz"
+mv water_id0.xyz water_id0_b.xyz
+mv water_id1.xyz water_id1_b.xyz
+AT_CHECK([diff -I '.*Created by molecuilder.*' water_id0_a.xyz water_id0_b.xyz], 0, [ignore], [ignore])
+AT_CHECK([diff -I '.*Created by molecuilder.*' water_id1_a.xyz water_id1_b.xyz], 0, [ignore], [ignore])
+AT_CLEANUP
Index: tests/regression/Selection/Molecules/testsuite-selection-molecules.at
===================================================================
--- tests/regression/Selection/Molecules/testsuite-selection-molecules.at	(revision aa04aec0a6f98bba03446ef81b876c0dee5f6db8)
+++ tests/regression/Selection/Molecules/testsuite-selection-molecules.at	(revision aa04aec0a6f98bba03446ef81b876c0dee5f6db8)
@@ -0,0 +1,24 @@
+AT_BANNER([MoleCuilder - Molecule selections])
+
+### Molecules ###
+
+# (un)select all molecules
+m4_include(Selection/Molecules/AllMolecules/testsuite-selection-all-molecules.at)
+
+# clear molecule selection
+m4_include(Selection/Molecules/ClearMolecules/testsuite-selection-clear-molecules.at)
+
+# (un)select molecules by formula
+m4_include(Selection/Molecules/MoleculeByFormula/testsuite-selection-molecules-by-formula.at)
+
+# (un)select molecule by id
+m4_include(Selection/Molecules/MoleculeById/testsuite-selection-molecule-by-id.at)
+
+# (un)select molecule by name
+m4_include(Selection/Molecules/MoleculeByName/testsuite-selection-molecules-by-name.at)
+
+# (un)select molecule by order
+m4_include(Selection/Molecules/MoleculeByOrder/testsuite-selection-molecule-by-order.at)
+
+# (un)select molecule from atom selection
+m4_include(Selection/Molecules/MoleculeOfAtom/testsuite-selection-atoms-molecules.at)
