We are interested in testing psi = 0 against an alternative in the presence of some nuisance parameter X. The usual procedure for such problems is to use a test statistic that is a function of the data only. Let q(lambda) denote the p-value at a given value lambda. If q(lambda) does not depend on lambda, then in principle we can apply this procedure. However, a major difficulty that arises in many situations is that q(lambda) depends on lambda and therefore cannot be used as a p-value. In such cases, the usual approach is to define the p-value as the supremum of q(lambda) over the nuisance parameter space. Because this approach ignores sample information about lambda, it may be unnecessarily conservative; this is a serious problem in order restricted inference. To overcome this, I propose the following. Obtain, say, a 99% confidence region for lambda under the null hypothesis. Now, for a given lambda, let T(lambda) be a test statistic and r(lambda) be the p-value, The test procedure is to reject the null hypothesis if {0.01 + supremum of r(lambda) over the 99% confidence region for lambda} is less than the nominal level such as 0.05. In contrast to the usual procedure, an attractive feature of this procedure is that it allows us to choose a test statistic as a function of lambda. A data example is used to illustrate the procedure, and in a simulation study I observed that this test performed better than the traditional conservative procedure. Although this approach was originally developed for order restricted inference problems, the main results have wide applicability.