The automatic generation of a hierarchical self-test architecture for boards with Boundary Scan Test (BST) is described, based on a test processor specifically designed to implement the basic operations required to control the BST infrastructure. An ATPG module generates the ROM containing the test program, allowing a single-chip self-test solution with minimal design-for-testability overhead. The same test processor may be used wilhout internal ROM, when a single-chip solution is not desirable.