This paper describes our work on formation flight control of unmanned aerial vehicles (UAVs). A formation flight test system from theory to actual flight is developed to narrow the gap between the theory and the practice. Firstly, a leader-follower based 3D formation control algorithm is designed and validated via numerical simulation. Secondly, the method is embedded realized in our autopilot, then a hardware-in-the-loop simulation subsystem is constructed to further test the algorithm by combining the autopilot with a realistic flight simulator X-Plane. The interface and protocol between the autopilot and X-plane are designed same with that of the formation flight test platform. Consequently, the autopilot passed the validation in the hardware-in-the-loop simulation can be directly moved on to the formation flight test platform. Finally, results of the numerical simulation, hardware-in-the-loop simulation and actual flight tests are presented to illustrate the performance of the entire formation flight test system and the proposed methodology.