From: Simon Strandgaard Date: 2004-04-13T07:59:13+09:00 Subject: Re: test / unit question: facility to mark some tests as "missing" or "incomplete" On Tue, 13 Apr 2004 03:02:29 +0900, Jim Weirich wrote: > Its Me said: >> I often find myself with some unit tests that run, and several more test >> that I know I really should write but simply can't right now. Being >> hopelessly forgetful and never reading my own comments, I would like some >> way to enter such missing tests as stubs, so that test/unit will give a >> "missing" or "incomplete" test message (but not count is as a test or >> assertion failure). >> >> Is this doable? Does it make sense to do something like this? > > Sometimes when I wish to disable a test for a bit, I will change the name > of a test from "test_xyz" to "xtest_xyz". A simple grep through the > project identifies all such tests for later fixup. I also uses 'x' prefix to identify disabled testcases ;-) If its many testcases I need to disable then I use 'undef test_xyz', so that the undef's is grouped, so I easily can see what is disabled. These can again easily be enabled all together by using a =begin, =end multiline comment. =begin undef test_zap2 undef test_zap3 # TODO: must fix undef test_zap4 undef test_zap5 =end Other times I move testcases to modules, and then do a 'include ExerciseSomething'.. then its very easy to enable/disable a big group of testcases. class TestSomething < Common::TestCase module ExerciseAlpha def test_alpha1; end def test_alpha2; end def test_alpha3; end end module ExerciseBeta def test_beta1; end def test_beta2; end def test_beta3; end end include ExerciseAlpha include ExerciseBeta end -- Simon Strandgaard