Another thumbs up for splashing cold water on your face. I once had to do this on a long drive. I could barely keep my eyes open. I stopped, splashed the cold water on, drank some cold water, and perked up.
But also bring brain- and energy-boosting snacks. An apple is GREAT for a quick perk (try it one day while you're falling asleep at your desk, and you will be impressed with the results). I usually follow it with a granola bar or some other carb, because for some reason apples make me hungry.
In general, go easy on the carbs because they will make you sleepy and affect concentration. If your test is in the morning, have eggs, a piece of toast, and some fruit or fruit juice for breakfast. If your test is in the afternoon, have a tuna sandwich and a piece of fruit for lunch. I have found that if I have a bagel in the morning or pasta at lunch I am dragging hard, but with a higher protein meal, I am alert and mentally really sharp. I do my best thinking then.
Don't do the energy drink thing, though, or especially anything like a Red Bull. They can make you hyper and the crash can be wicked. A good quick burst is peanut M&Ms...just enough sugar to perk you up, protein to balance it out, and fat to keep hunger at bay.