The oral glucose tolerance test can diagnose diabetes, gestational diabetes, and prediabetes. You need to stop eating and drinking 8 to 12 hours before the test, but you might be allowed some water.