We introduce a novel learning-based approach to synthesize safe and robust\ncontrollers for autonomous Cyber-Physical Systems and, at the same time, to\ngenerate challenging tests. This procedure combines formal methods for model\nverification with Generative Adversarial Networks. The method learns two Neural\nNetworks: the first one aims at generating troubling scenarios for the\ncontroller, while the second one aims at enforcing the safety constraints. We\ntest the proposed method on a variety of case studies.\n