same way the auto manufaturers do. in a controlled lab environment. I seen the test done on autos once. In a HUGE warehouse, with a concrete floor polished so smooth it was hard to walk on. the whole place climate controlled, car driven with windows up, A/C off, a steady 55mph and in a circle probably the size of a nascar track. Dont know if it still done that way, but back when govt standards started hitting hard it was.
Seen kinda same thing with engine builders and dyno runs. Engine in an enclosed PRESSURIZED room. basically making anything they tested in there into a blown/turbo'd engine. feed the room the engine in with 10psi 'boost' and air temp of 65degrees its amazing the HP number you can get.
in the real world, as Joe Isuzu put it "downhill in a hurricane"