Autozone can plug in a tester and see why your check engine light is on but the test is not a complete test like an auto shop would do.
However I've found that I was able to fix my car by taking it to Autozone and having them plug in their check engine light tester and what they did was pulled the code that the computer was showing and it showed what caused it.
Sometimes it's as simple as a gas cap being loose, broke or not sealing properly and other times it can be a bad spark plug, ignition coil etc.
The check engine light has to be on though when you take the vehicle to Autozone for them to be able to diagnose the check engine light.