In this paper we describe an x-ray long trace profiler (XLTP) that takes an x-ray synchrotron beam as a wavefront reference. According to results of experiments conducted on the Optics Beamline at the ESRF, this instrument allows us to measure surface slope errors with precision and accuracy better than 25 nrad (rms) and 50 mad (rms), respectively, with a lateral resolution of 5 mm in the meridional and less than 1 mm in the sagittal direction. A very similar technique was developed to figure in situ mirrors mounted on mechanical benders into a stigmatic shape for microfocusing purposes. Micron spot sizes were achieved without difficulty and submicron precision should be possible. The technique is particularly useful if energy tunability is needed. The emphasis has been put on automation and speed of the measurement.