# # MoleCuilder - creates and alters molecular systems # Copyright (C) 2017 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 . # ### Rotate around bond AT_SETUP([Molecules - Rotate around bond]) AT_KEYWORDS([molecules rotate-around-bond]) file=test-90-true.pdb AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Molecules/RotateAroundBond/pre/test.pdb $file], 0) AT_CHECK([chmod u+w $file], 0) AT_CHECK([../../molecuilder -i $file --select-atom-by-element C --rotate-around-bond 90.], 0, [stdout], [stderr]) AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Molecules/RotateAroundBond/post/$file], 0, [ignore], [ignore]) file=test-195-true.pdb AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Molecules/RotateAroundBond/pre/test.pdb $file], 0) AT_CHECK([chmod u+w $file], 0) AT_CHECK([../../molecuilder -i $file --select-atom-by-element C --rotate-around-bond 195.], 0, [stdout], [stderr]) AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Molecules/RotateAroundBond/post/$file], 0, [ignore], [ignore]) file=test-95-false.pdb AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Molecules/RotateAroundBond/pre/test.pdb $file], 0) AT_CHECK([chmod u+w $file], 0) AT_CHECK([../../molecuilder -i $file --select-atom-by-element C --rotate-around-bond 95. --bondside 0], 0, [stdout], [stderr]) AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Molecules/RotateAroundBond/post/$file], 0, [ignore], [ignore]) AT_CLEANUP AT_SETUP([Molecules - Rotate around bond with Undo]) AT_KEYWORDS([molecules rotate-around-bond undo]) file=test.pdb AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Molecules/RotateAroundBond/pre/test.pdb $file], 0) AT_CHECK([chmod u+w $file], 0) AT_CHECK([../../molecuilder -i $file --select-atom-by-element C --rotate-around-bond 90. --undo], 0, [stdout], [stderr]) AT_CHECK([diff -I '.*reated by molecuilder.*' -I 'CONECT.*' $file ${abs_top_srcdir}/tests/regression/Molecules/RotateAroundBond/pre/test.pdb], 0, [ignore], [ignore]) file=test-95-false.pdb AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Molecules/RotateAroundBond/pre/test.pdb $file], 0) AT_CHECK([chmod u+w $file], 0) AT_CHECK([../../molecuilder -i $file --select-atom-by-element C --rotate-around-bond 95. --bondside 0 --undo], 0, [stdout], [stderr]) AT_CHECK([diff -I '.*reated by molecuilder.*' -I 'CONECT.*' $file ${abs_top_srcdir}/tests/regression/Molecules/RotateAroundBond/pre/test.pdb], 0, [ignore], [ignore]) AT_CLEANUP AT_SETUP([Molecules - Rotate around bond with Redo]) AT_KEYWORDS([molecules rotate-around-bond redo]) file=test-90-true.pdb AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Molecules/RotateAroundBond/pre/test.pdb $file], 0) AT_CHECK([chmod u+w $file], 0) AT_CHECK([../../molecuilder -i $file --select-atom-by-element C --rotate-around-bond 90. --undo --redo], 0, [stdout], [stderr]) AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Molecules/RotateAroundBond/post/$file], 0, [ignore], [ignore]) file=test-95-false.pdb AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Molecules/RotateAroundBond/pre/test.pdb $file], 0) AT_CHECK([chmod u+w $file], 0) AT_CHECK([../../molecuilder -i $file --select-atom-by-element C --rotate-around-bond 95. --bondside 0 --undo --redo], 0, [stdout], [stderr]) AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Molecules/RotateAroundBond/post/$file], 0, [ignore], [ignore]) AT_CLEANUP AT_SETUP([Molecules - Rotate around bond fails for cycles]) AT_KEYWORDS([molecules rotate-around-bond cycle]) file=test_cycle.pdb AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Molecules/RotateAroundBond/pre/test_cycle.pdb $file], 0) AT_CHECK([chmod u+w $file], 0) AT_CHECK([../../molecuilder -i $file --select-atom-by-id 1 2 --rotate-around-bond 90.], 5, [stdout], [stderr]) AT_CLEANUP AT_SETUP([Molecules - Rotate around bond on almost complete cycle]) AT_KEYWORDS([molecules rotate-around-bond]) file=benzene_90degree.pdb AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Molecules/RotateAroundBond/pre/benzene.pdb $file], 0) AT_CHECK([chmod u+w $file], 0) AT_CHECK([../../molecuilder -i $file --select-atom-by-order -1 -6 --remove-atom --select-atom-by-id 3 5 --rotate-around-bond 90.], 0, [stdout], [stderr]) AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Molecules/RotateAroundBond/post/$file], 0, [ignore], [ignore]) AT_CLEANUP