here is an article that talks about the testing procedures and as LRSIII indicated, they do attempt to account for aerodynamics, rolling resistance, etc.
https://jalopnik.com/how-fuel-economy-is-measured-and-why-you-get-different-1716232721
without those adjustments one would get truly crazy...