Index: doc/userguide/userguide.xml
===================================================================
--- doc/userguide/userguide.xml	(revision 9a9f8474316e2fa9a49ad0cd202d1a6f3ef10d84)
+++ doc/userguide/userguide.xml	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
@@ -1055,4 +1055,15 @@
           <para>As before, this is actually just an operation on all of the molecule&apos;s atoms, namely translating them.</para>
         </section>
+        <section xml:id="molecule.rotate-around-bond">
+          <title xml:id="molecule.rotate-around-bond.title">Rotate around bond </title>
+          <para>This rotates parts of a molecule around a given bond, i.e. the
+          bond vector becomes the rotation axis but only atoms on the side of
+          second atom get rotated. This naturally does not work for bonds in a
+          cycle.</para>
+          <programlisting>
+  ... --rotate-around-bond &quot;90&quot; \
+      --bond-side 0\
+   </programlisting>
+        </section>
         <section xml:id="molecule.rotate-around-self">
           <title xml:id="molecule.rotate-around-self.title">Rotate around self </title>
Index: src/Actions/GlobalListOfActions.hpp
===================================================================
--- src/Actions/GlobalListOfActions.hpp	(revision 9a9f8474316e2fa9a49ad0cd202d1a6f3ef10d84)
+++ src/Actions/GlobalListOfActions.hpp	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
@@ -83,4 +83,5 @@
   (MoleculeLoad) \
   (MoleculeRemove) \
+  (MoleculeRotateAroundBond) \
   (MoleculeRotateAroundSelfByAngle) \
   (MoleculeRotateToPrincipalAxisSystem) \
Index: src/Actions/Makefile.am
===================================================================
--- src/Actions/Makefile.am	(revision 9a9f8474316e2fa9a49ad0cd202d1a6f3ef10d84)
+++ src/Actions/Makefile.am	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
@@ -317,4 +317,5 @@
   Actions/MoleculeAction/LoadAction.cpp \
   Actions/MoleculeAction/RemoveAction.cpp \
+  Actions/MoleculeAction/RotateAroundBondAction.cpp \
   Actions/MoleculeAction/RotateAroundSelfByAngleAction.cpp \
   Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.cpp \
@@ -335,4 +336,5 @@
   Actions/MoleculeAction/LoadAction.hpp \
   Actions/MoleculeAction/RemoveAction.hpp \
+  Actions/MoleculeAction/RotateAroundBondAction.hpp \
   Actions/MoleculeAction/RotateAroundSelfByAngleAction.hpp \
   Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.hpp \
@@ -353,4 +355,5 @@
   Actions/MoleculeAction/LoadAction.def \
   Actions/MoleculeAction/RemoveAction.def \
+  Actions/MoleculeAction/RotateAroundBondAction.def \
   Actions/MoleculeAction/RotateAroundSelfByAngleAction.def \
   Actions/MoleculeAction/RotateToPrincipalAxisSystemAction.def \
Index: src/Actions/MoleculeAction/RotateAroundBondAction.cpp
===================================================================
--- src/Actions/MoleculeAction/RotateAroundBondAction.cpp	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
+++ src/Actions/MoleculeAction/RotateAroundBondAction.cpp	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
@@ -0,0 +1,157 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2017 Frederik Heber. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder 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 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder 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 MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * RotateAroundBondAction.cpp
+ *
+ *  Created on: Mar 22, 2017
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+//#include "CodePatterns/MemDebug.hpp"
+
+#include "Actions/MoleculeAction/RotateAroundBondAction.hpp"
+
+#include "CodePatterns/Assert.hpp"
+#include "CodePatterns/Log.hpp"
+
+#include "LinearAlgebra/Line.hpp"
+#include "LinearAlgebra/Plane.hpp"
+
+#include "Actions/UndoRedoHelpers.hpp"
+
+#include "Atom/atom.hpp"
+#include "Atom/AtomicInfo.hpp"
+#include "Bond/bond.hpp"
+#include "molecule.hpp"
+#include "World.hpp"
+#include "WorldTime.hpp"
+
+using namespace MoleCuilder;
+
+// and construct the stuff
+#include "RotateAroundBondAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+ActionState::ptr MoleculeRotateAroundBondAction::performCall()
+{
+  // check preconditions
+  const std::vector< atom *> atoms = World::getInstance().getSelectedAtoms();
+  if (atoms.size() != 2) {
+    STATUS("Exactly two atoms must be selected to specify a bond.");
+    return Action::failure;
+  }
+  if (!atoms[0]->IsBondedTo(WorldTime::getTime(), atoms[1])) {
+    STATUS("Two given atoms are not bonded.");
+    return Action::failure;
+  }
+  molecule *mol = World::getInstance().
+      getMolecule(MoleculeById(atoms[0]->getMolecule()->getId()));
+  if (mol != atoms[1]->getMolecule()) {
+    STATUS("The two selected atoms must belong to the same molecule.");
+    return Action::failure;
+  }
+
+  // gather undo information: store position of all atoms of molecule
+  std::vector<AtomicInfo> UndoInfo;
+  UndoInfo.reserve(mol->size());
+  {
+    for (molecule::const_iterator iter = const_cast<molecule const *>(mol)->begin();
+        iter != const_cast<molecule const *>(mol)->end();
+        ++iter) {
+      const atom * const Walker = *iter;
+      UndoInfo.push_back(AtomicInfo(*Walker));
+    }
+  }
+
+  // convert from degrees to radian
+  const double angle_radian = params.angle.get() * M_PI/180.;
+
+  // create the bond plane and mid-distance
+  Vector NormalVector = (atoms[0]->getPosition() - atoms[1]->getPosition());
+  NormalVector.Normalize();
+  const Vector OffsetVector = 0.5*(atoms[0]->getPosition() + atoms[1]->getPosition());
+  Plane bondplane(NormalVector, OffsetVector);
+  Line RotationAxis(OffsetVector, NormalVector);
+  // go through the molecule and rotate each atom relative two plane
+  for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) {
+    const Vector &position = (*iter)->getPosition();
+    const double signed_distance = bondplane.SignedDistance(position);
+    LOG(3, "DEBUG: Inspecting atom " << **iter << " at " << position);
+    if ((params.bondside.get() && (signed_distance > 0)) ||
+        (!params.bondside.get() && (signed_distance < 0))) {
+      LOG(4, "DEBUG: Rotating atom " << **iter << " by " << angle_radian
+          << " rad around " << RotationAxis);
+      (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), angle_radian));
+      LOG(4, "DEBUG: New position of atom " << **iter);
+      ASSERT( fabs(signed_distance - bondplane.SignedDistance(position)) < MYEPSILON,
+          "MoleculeRotateAroundBondAction::performCall() - signed distance was "
+          +toString(signed_distance)+" and is now "+toString(bondplane.SignedDistance(position)));
+    }
+  }
+
+  MoleculeRotateAroundBondState *UndoState =
+      new MoleculeRotateAroundBondState(UndoInfo, OffsetVector, NormalVector, mol, params);
+  return ActionState::ptr(UndoState);
+}
+
+ActionState::ptr MoleculeRotateAroundBondAction::performUndo(ActionState::ptr _state) {
+  MoleculeRotateAroundBondState *state = assert_cast<MoleculeRotateAroundBondState*>(_state.get());
+
+  // set stored old state
+  SetAtomsFromAtomicInfo(state->UndoInfo);
+
+  return ActionState::ptr(_state);
+}
+
+ActionState::ptr MoleculeRotateAroundBondAction::performRedo(ActionState::ptr _state){
+  MoleculeRotateAroundBondState *state = assert_cast<MoleculeRotateAroundBondState*>(_state.get());
+
+  // create the bond plane and mid-distance
+  Plane bondplane(state->NormalVector, state->OffsetVector);
+  Line RotationAxis(state->OffsetVector, state->NormalVector);
+  const double angle_radian = params.angle.get() * M_PI/180.;
+  // go through the molecule and rotate each atom relative two plane
+  for (molecule::iterator iter = state->mol->begin(); iter != state->mol->end(); ++iter) {
+    const Vector &position = (*iter)->getPosition();
+    if ((params.bondside.get() && (bondplane.SignedDistance(position) > 0)) ||
+        (!params.bondside.get() && (bondplane.SignedDistance(position) < 0))) {
+      (*iter)->setPosition(RotationAxis.rotateVector((*iter)->getPosition(), angle_radian));
+    }
+  }
+
+  return ActionState::ptr(_state);
+}
+
+bool MoleculeRotateAroundBondAction::canUndo() {
+  return true;
+}
+
+bool MoleculeRotateAroundBondAction::shouldUndo() {
+  return true;
+}
+/** =========== end of function ====================== */
Index: src/Actions/MoleculeAction/RotateAroundBondAction.def
===================================================================
--- src/Actions/MoleculeAction/RotateAroundBondAction.def	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
+++ src/Actions/MoleculeAction/RotateAroundBondAction.def	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
@@ -0,0 +1,38 @@
+/*
+ * StretchBondAction.def
+ *
+ *  Created on: Mar 22, 2017
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+
+#include "Parameters/Validators/DummyValidator.hpp"
+#include "Parameters/Validators/Specific/RotationAngleValidator.hpp"
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
+#define paramtypes (double)(bool)
+#define paramtokens ("rotate-around-bond")("bondside")
+#define paramdescriptions ("relative angle to rotate about")("which side of the bond to rotate")
+#define paramdefaults (NOPARAM_DEFAULT)(PARAM_DEFAULT(1))
+#define paramreferences (angle)(bondside)
+#define paramvalids \
+(RotationAngleValidator()) \
+(DummyValidator<bool>())
+
+#define statetypes (std::vector<AtomicInfo>)(const Vector)(const Vector)(molecule *)
+#define statereferences (UndoInfo)(OffsetVector)(NormalVector)(mol)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Molecule
+#define MENUNAME "molecule"
+#define MENUPOSITION 11
+#define ACTIONNAME RotateAroundBond
+#define TOKEN "rotate-around-bond"
+
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "rotate a part of a molecule around a specified bond by a given relative angle"
+#undef SHORTFORM
Index: src/Actions/MoleculeAction/RotateAroundBondAction.hpp
===================================================================
--- src/Actions/MoleculeAction/RotateAroundBondAction.hpp	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
+++ src/Actions/MoleculeAction/RotateAroundBondAction.hpp	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
@@ -0,0 +1,22 @@
+/*
+ * RotateAroundBondAction.hpp
+ *
+ *  Created on: Mar 22, 2017
+ *      Author: heber
+ */
+
+#ifndef ROTATEAROUNDBONDACTION_HPP
+#define ROTATEAROUNDBONDACTION_HPP
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "Actions/Action.hpp"
+
+#include "RotateAroundBondAction.def"
+#include "Action_impl_header.hpp"
+
+#endif // ROTATEAROUNDBONDACTION_HPP
Index: tests/Python/AllActions/options.dat
===================================================================
--- tests/Python/AllActions/options.dat	(revision 9a9f8474316e2fa9a49ad0cd202d1a6f3ef10d84)
+++ tests/Python/AllActions/options.dat	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
@@ -33,4 +33,5 @@
 bond-degree	"1"
 bond-file	"bond.dat"
+bondside	"1"
 bond-table	"table.dat"
 calculate-bounding-box	""
@@ -159,4 +160,5 @@
 repeat-box	"1 1 1"
 reset	1
+rotate-around-bond	"90."
 rotate-around-origin	"180."
 rotate-around-origin	"20."
Index: tests/regression/Makefile.am
===================================================================
--- tests/regression/Makefile.am	(revision 9a9f8474316e2fa9a49ad0cd202d1a6f3ef10d84)
+++ tests/regression/Makefile.am	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
@@ -133,4 +133,5 @@
 	$(srcdir)/Molecules/LinearInterpolationofTrajectories/testsuite-molecules-linear-interpolation-of-trajectories.at \
 	$(srcdir)/Molecules/Remove/testsuite-molecules-remove.at \
+	$(srcdir)/Molecules/RotateAroundBond/testsuite-molecules-rotate-around-bond.at \
 	$(srcdir)/Molecules/RotateAroundOrigin/testsuite-molecules-rotate-around-origin.at \
 	$(srcdir)/Molecules/RotateAroundSelf/testsuite-molecules-rotate-around-self.at \
Index: tests/regression/Molecules/RotateAroundBond/post/test-195-true.pdb
===================================================================
--- tests/regression/Molecules/RotateAroundBond/post/test-195-true.pdb	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
+++ tests/regression/Molecules/RotateAroundBond/post/test-195-true.pdb	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
@@ -0,0 +1,18 @@
+REMARK created by molecuilder on Wed Mar 22 16:38:34 2017, time step 0
+ATOM      1 C01 0non 01          9.300  10.000  10.000  0.00  0.00           C 0
+ATOM      2 C02 0non 01         10.700  10.000  10.000  0.00  0.00           C 0
+ATOM      3 H01 0non 01          8.902   8.913   9.709  0.00  0.00           H 0
+ATOM      4 H02 0non 01          8.902  10.795   9.205  0.00  0.00           H 0
+ATOM      5 H03 0non 01          8.902  10.291  11.086  0.00  0.00           H 0
+ATOM      6 H04 0non 01         11.098  11.125  10.000  0.00  0.00           H 0
+ATOM      7 H05 0non 01         11.098   9.438   9.026  0.00  0.00           H 0
+ATOM      8 H06 0non 01         11.098   9.438  10.974  0.00  0.00           H 0
+CONECT    1    3    2    5    4                                                 
+CONECT    2    1    6    8    7                                                 
+CONECT    3    1                                                                
+CONECT    4    1                                                                
+CONECT    5    1                                                                
+CONECT    6    2                                                                
+CONECT    7    2                                                                
+CONECT    8    2                                                                
+END
Index: tests/regression/Molecules/RotateAroundBond/post/test-90-true.pdb
===================================================================
--- tests/regression/Molecules/RotateAroundBond/post/test-90-true.pdb	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
+++ tests/regression/Molecules/RotateAroundBond/post/test-90-true.pdb	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
@@ -0,0 +1,18 @@
+REMARK created by molecuilder on Wed Mar 22 16:37:10 2017, time step 0
+ATOM      1 C01 0non 01          9.300  10.000  10.000  0.00  0.00           C 0
+ATOM      2 C02 0non 01         10.700  10.000  10.000  0.00  0.00           C 0
+ATOM      3 H01 0non 01          8.902  10.000  11.125  0.00  0.00           H 0
+ATOM      4 H02 0non 01          8.902   9.026   9.438  0.00  0.00           H 0
+ATOM      5 H03 0non 01          8.902  10.974   9.438  0.00  0.00           H 0
+ATOM      6 H04 0non 01         11.098  11.125  10.000  0.00  0.00           H 0
+ATOM      7 H05 0non 01         11.098   9.438   9.026  0.00  0.00           H 0
+ATOM      8 H06 0non 01         11.098   9.438  10.974  0.00  0.00           H 0
+CONECT    1    3    2    5    4                                                 
+CONECT    2    1    6    8    7                                                 
+CONECT    3    1                                                                
+CONECT    4    1                                                                
+CONECT    5    1                                                                
+CONECT    6    2                                                                
+CONECT    7    2                                                                
+CONECT    8    2                                                                
+END
Index: tests/regression/Molecules/RotateAroundBond/post/test-95-false.pdb
===================================================================
--- tests/regression/Molecules/RotateAroundBond/post/test-95-false.pdb	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
+++ tests/regression/Molecules/RotateAroundBond/post/test-95-false.pdb	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
@@ -0,0 +1,18 @@
+REMARK created by molecuilder on Wed Mar 22 16:38:48 2017, time step 0
+ATOM      1 C01 0non 01          9.300  10.000  10.000  0.00  0.00           C 0
+ATOM      2 C02 0non 01         10.700  10.000  10.000  0.00  0.00           C 0
+ATOM      3 H01 0non 01          8.902  11.125  10.000  0.00  0.00           H 0
+ATOM      4 H02 0non 01          8.902   9.438  10.974  0.00  0.00           H 0
+ATOM      5 H03 0non 01          8.902   9.438   9.026  0.00  0.00           H 0
+ATOM      6 H04 0non 01         11.098   9.902  11.121  0.00  0.00           H 0
+ATOM      7 H05 0non 01         11.098  11.019   9.525  0.00  0.00           H 0
+ATOM      8 H06 0non 01         11.098   9.079   9.355  0.00  0.00           H 0
+CONECT    1    3    2    5    4                                                 
+CONECT    2    1    6    8    7                                                 
+CONECT    3    1                                                                
+CONECT    4    1                                                                
+CONECT    5    1                                                                
+CONECT    6    2                                                                
+CONECT    7    2                                                                
+CONECT    8    2                                                                
+END
Index: tests/regression/Molecules/RotateAroundBond/pre/test.pdb
===================================================================
--- tests/regression/Molecules/RotateAroundBond/pre/test.pdb	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
+++ tests/regression/Molecules/RotateAroundBond/pre/test.pdb	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
@@ -0,0 +1,18 @@
+REMARK created by molecuilder on Wed Mar 22 16:02:29 2017, time step 0
+ATOM      1 C01 0non 01          9.300  10.000  10.000  0.00  0.00           C 0
+ATOM      2 C02 0non 01         10.700  10.000  10.000  0.00  0.00           C 0
+ATOM      3 H01 0non 01          8.902  11.125  10.000  0.00  0.00           H 0
+ATOM      4 H02 0non 01          8.902   9.438  10.974  0.00  0.00           H 0
+ATOM      5 H03 0non 01          8.902   9.438   9.026  0.00  0.00           H 0
+ATOM      6 H04 0non 01         11.098  11.125  10.000  0.00  0.00           H 0
+ATOM      7 H05 0non 01         11.098   9.438   9.026  0.00  0.00           H 0
+ATOM      8 H06 0non 01         11.098   9.438  10.974  0.00  0.00           H 0
+CONECT    1    3    2    5    4                                                 
+CONECT    2    6    8    7    1                                                 
+CONECT    3    1                                                                
+CONECT    4    1                                                                
+CONECT    5    1                                                                
+CONECT    6    2                                                                
+CONECT    7    2                                                                
+CONECT    8    2                                                                
+END
Index: tests/regression/Molecules/RotateAroundBond/testsuite-molecules-rotate-around-bond.at
===================================================================
--- tests/regression/Molecules/RotateAroundBond/testsuite-molecules-rotate-around-bond.at	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
+++ tests/regression/Molecules/RotateAroundBond/testsuite-molecules-rotate-around-bond.at	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
@@ -0,0 +1,77 @@
+#
+#    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 <http://www.gnu.org/licenses/>.
+#
+### 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
Index: tests/regression/Molecules/testsuite-molecules.at
===================================================================
--- tests/regression/Molecules/testsuite-molecules.at	(revision 9a9f8474316e2fa9a49ad0cd202d1a6f3ef10d84)
+++ tests/regression/Molecules/testsuite-molecules.at	(revision 788dceaed9acbcd89e4092b24f3b9345e53d82e3)
@@ -60,4 +60,7 @@
 m4_include([Molecules/RotateToPrincipalAxisSystem/testsuite-molecules-rotate-to-principal-axis-system.at])
 
+# rotate around one of its bond
+m4_include([Molecules/RotateAroundBond/testsuite-molecules-rotate-around-bond.at])
+
 # Rotate around origin
 m4_include([Molecules/RotateAroundOrigin/testsuite-molecules-rotate-around-origin.at])
