Formal:
* Bonne chance pour votre test! (This is the most common and polite way to say it.)
* Je vous souhaite bonne chance pour votre examen. (This is a bit more formal and literally translates to "I wish you good luck for your exam.")
Informal:
* Bonne chance pour ton test! (This is used for someone you know well.)
* Bon courage pour ton examen! (This literally means "good courage" and expresses a wish for strength and determination.)
* T'as de la chance! (This is a more casual and playful way to say "you've got luck!")
You can also add a specific wish for success:
* J'espère que tu vas réussir! (I hope you succeed!)
Choose the expression that best suits the situation and your relationship with the person.