At the Diamond Light Source, adaptive bimorph mirrors are extensively used to focus synchrotron light. Piezo crystals embedded in each bimorph mirror expand or contract in response to applied voltages, enabling the curvature of the reflecting surface to adapt to the required form. However, high-grade metrology tools are needed to determine the optimal voltages. The Diamond Optics & Metrology group have implemented in situ (on the beamlines) and ex situ (in a metrology lab) methods of characterizing optical surfaces. For ex situ tests, a slope-measuring profiler (the Diamond-NOM (Nanometre Optical Metrology)) is employed. In situ, X-ray pencil beam scans, performed using an X-ray sensitive camera and software designed in-house, are used to correct optical slope errors. Ex situ and in situ data are shown to be in good agreement. Examples of in situ improvements in the focusing quality and deliberate defocusing are shown. The methods developed are also applicable to many other forms of adaptive optics.