private void checkStackPointerValue(EmulatorTestRunner testRunner) {
		Program program = testRunner.getProgram();
		Register spReg = compilerSpec.getStackPointer();
		if (spReg != null) {
			RegisterValue spValue = testRunner.getRegisterValue(spReg);
			long stackOffset = spValue.getUnsignedValue().longValue();
			if (stackOffset == 0) { // default uninitialized value is 0
				initStackPointer(testRunner, spReg);
			}
			AddressSpace stackSpace = compilerSpec.getStackBaseSpace();
			if (stackSpace != null) {
				Address stackPtr = stackSpace.getAddress(stackOffset);
				if (program.getMemory().getLoadedAndInitializedAddressSet().contains(stackPtr)) {
					fail("Stack pointer defined within initialized memory region: " + stackPtr);
				}
			}
		}
	}
Single unit test which handles named test group specified during test
instantiation.
Ghidra/Features/Base/src/main/java/ghidra/test/processors/support/ProcessorEmulatorTestAdapter.java