It's easy to waste a lot of time coding internal diagnostics that will never provide useful information. Realize that internal diagnostics have intrinsic limitations, but if carefully designed can yield some valuable information. Witness the ubiquitous PC's BIOS CPU tests. I wonder just how often failures are detected. On the PC an instruction test failure makes the code execute a HALT, causing the CPU to look just as dead as if the it never started.
More extensive error reporting with a defective CPU is a fool's dream.
Similarly, memory tests rely on operating memory to run - a high tech oxymoron that makes one question their value. Obviously, if the ROM is not functioning, then the program won't start and the diagnostic will not be invoked. The moral is to design diagnostics so to ensure that each test uses as few unproven components as possible. Some sort of timer will generate ticks for context switching. If the timer is an external component write a bit of code that checks the interrupt it generates.