The aim of this study was to examine the relationships between test emotions and their proximal and distal antecedents in the math domain as proposed by the control-value theory of achievement emotions, using structural equation modeling. More specifically, it investigates the mediating role of cognitive appraisals of control and value in the relationship between students’ social environment (teachers’ support and challenge in classroom interactions and parents’ attitudes towards learning and achievement) and test emotions of joy, hope, pride, relief, anger, anxiety, shame and hopelessness. The sample consisted of 365 high school students in Croatia (235 girls), with a mean age of 16 years. The study was conducted during regularly scheduled classes. The results of this study generally confirm the relationships and mediating mechanisms proposed by the control-value theory. Students’ cognitive control and value appraisals play a central and mediating role in the relationship between parents’ and teachers’ influences and test emotions.