# # MoleCuilder - creates and alters molecular systems # Copyright (C) 2021 Frederik Heber # # 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 . # ### undo mark AT_SETUP([Standard Options - undo mark]) AT_KEYWORDS([options undo-mark]) # simple call AT_CHECK([../../molecuilder --dry-run --set-undo-mark 1 --undo-till-mark --no-dry-run --store-session session-options-undo-mark.py --session-type python], 0, [ignore], [ignore]) AT_CHECK([grep -v "Command.*DryRun" session-options-undo-mark.py >session-options-undo-mark_new.py], 0, [ignore], [ignore]) AT_CHECK([../../molecuilderguitest session-options-undo-mark_new.py], 0, [ignore], [ignore]) # add an atom prior to undo-mark AT_CHECK([../../molecuilder --dry-run -i test-simple-prior.conf --add-atom 1 --domain-position "5,5,5" --set-undo-mark 1 --undo-till-mark --no-dry-run --store-session session-options-undo-mark.py --session-type python], 0, [stdout], [ignore]) AT_CHECK([grep -v "Command.*DryRun" session-options-undo-mark.py >session-options-undo-mark_new.py], 0, [ignore], [ignore]) AT_CHECK([../../molecuilderguitest session-options-undo-mark_new.py], 0, [stdout], [ignore]) AT_CHECK([grep -q "^Ion_Type" test-simple-prior.conf], 0, [ignore], [ignore]) # add an atom after to undo-mark AT_CHECK([../../molecuilder --dry-run -i test-simple-after.conf --set-undo-mark 1 --add-atom 1 --domain-position "5,5,5" --undo-till-mark --no-dry-run --store-session session-options-undo-mark.py --session-type python], 0, [stdout], [ignore]) AT_CHECK([grep -v "Command.*DryRun" session-options-undo-mark.py >session-options-undo-mark_new.py], 0, [ignore], [ignore]) AT_CHECK([../../molecuilderguitest session-options-undo-mark_new.py], 0, [stdout], [ignore]) AT_CHECK([grep -q "^Ion_Type" test-simple-after.conf], 1, [ignore], [ignore]) # add an atom and select after undo-mark: both undone AT_CHECK([../../molecuilder --dry-run -i test-simple-two-undo.conf --set-undo-mark 1 --add-atom 1 --domain-position "5,5,5" --select-all-atoms --undo-till-mark --no-dry-run --store-session session-options-undo-mark.py --session-type python], 0, [stdout], [ignore]) AT_CHECK([grep -v "Command.*DryRun" session-options-undo-mark.py >session-options-undo-mark_new.py], 0, [ignore], [ignore]) AT_CHECK([../../molecuilderguitest session-options-undo-mark_new.py], 0, [stdout], [ignore]) AT_CHECK([grep -q "^Ion_Type" test-simple-two-undo.conf], 1, [ignore], [ignore]) # input file with added atom: undo all (input has no undo) AT_CHECK([../../molecuilder --dry-run --set-undo-mark 1 --input hydrogen.xyz --add-atom 1 --domain-position "5,5,5" --undo-till-mark --select-all-atoms --no-dry-run --store-session session-options-undo-mark.py --session-type python], 0, [stdout], [ignore]) AT_CHECK([grep -v "Command.*DryRun" session-options-undo-mark.py >session-options-undo-mark_new.py], 0, [ignore], [ignore]) AT_CHECK([../../molecuilderguitest session-options-undo-mark_new.py], 0, [stdout], [ignore]) # input file with added atom, then undo-mark: nothing undone AT_CHECK([../../molecuilder --dry-run --input hydrogen.xyz --add-atom 1 --domain-position "5,5,5" --set-undo-mark 1 --undo-till-mark --no-dry-run --store-session session-options-undo-mark.py --session-type python], 0, [stdout], [ignore]) AT_CHECK([grep -v "Command.*DryRun" session-options-undo-mark.py >session-options-undo-mark_new.py], 0, [ignore], [ignore]) AT_CHECK([../../molecuilderguitest session-options-undo-mark_new.py], 0, [stdout], [ignore]) AT_CHECK([grep -q "H" hydrogen.xyz], 0, [ignore], [ignore]) AT_CLEANUP