I've implemented this in a library and I'm sure others have as well. Are you sure, you want a language solution?
Basic principle: --- unittest { testCase("a testcase", { // actual test code here }); } ---Testcase registers the structure and the runtime just runs the unittest as is does today and than calls all closures registered during the unittest. Makes this fully backward compatible.