A new test is derived for the hypothesis that a regression function has a prescribed parametric form. Unlike many recent proposals, this test does not depend on arbitrarily chosen smoothing parameters. In fact, the test statistic is itself a smoothing parameter which is selected to minimize an estimated risk function. The exact distribution of the test statistic is obtained when the error terms in the regression model are Gaussian, while the large sample distribution is derived for more general settings. It is shown that the proposed test is consistent against fixed alternatives and can detect local alternatives that converge to the null hypothesis at the rate $1/\sqrt n$, where $n$ is the sample size. More importantly, the test is shown by example to have an ability to adapt to the alternative at hand.