From: <sv...@ww...> - 2004-09-25 21:29:36
|
Author: mkrose Date: 2004-09-25 14:29:26 -0700 (Sat, 25 Sep 2004) New Revision: 1246 Modified: trunk/CSP/SConstruct trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/SConscript trunk/CSP/SimData/SimData/Tests/TestSuites.py trunk/CSP/SimData/SimData/Tests/TypeTests.py Log: Add a tests build target for scons to run all unittests (currently only simdata). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1246 Modified: trunk/CSP/SConstruct =================================================================== --- trunk/CSP/SConstruct 2004-09-25 09:26:37 UTC (rev 1245) +++ trunk/CSP/SConstruct 2004-09-25 21:29:26 UTC (rev 1246) @@ -27,6 +27,7 @@ scons IndexServer build the master server needed for multiplayer scons all build everything scons dox generate doxygen documentation + scons test run unittests """ from tools import build Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-09-25 09:26:37 UTC (rev 1245) +++ trunk/CSP/SimData/CHANGES.current 2004-09-25 21:29:26 UTC (rev 1246) @@ -1,6 +1,10 @@ Version 0.4.0 (in progress) =========================== +2004-09-25: onsight + * Add scons build target 'test' which runs the simdata unittests + (so far). + 2004-09-24: onsight * Minor cleanups, mostly doxygen related. Modified: trunk/CSP/SimData/SConscript =================================================================== --- trunk/CSP/SimData/SConscript 2004-09-25 09:26:37 UTC (rev 1245) +++ trunk/CSP/SimData/SConscript 2004-09-25 21:29:26 UTC (rev 1246) @@ -37,4 +37,6 @@ build.BuildModules(env, MODULES) - +runtests_action = Action('python $SOURCE', lambda a,b,c: '\n<<Running SimData Tests>>') +runtests = env.Command('RUNTESTS', 'runtests.py', runtests_action, ENV={'SIMDATA_LOGPRIORITY': '4'}) +env.Alias('test', runtests) Modified: trunk/CSP/SimData/SimData/Tests/TestSuites.py =================================================================== --- trunk/CSP/SimData/SimData/Tests/TestSuites.py 2004-09-25 09:26:37 UTC (rev 1245) +++ trunk/CSP/SimData/SimData/Tests/TestSuites.py 2004-09-25 21:29:26 UTC (rev 1246) @@ -13,5 +13,5 @@ suites.append(suite) def Run(): - runner = unittest.TextTestRunner() + runner = unittest.TextTestRunner(descriptions=1, verbosity=2) runner.run(unittest.TestSuite(suites)) Modified: trunk/CSP/SimData/SimData/Tests/TypeTests.py =================================================================== --- trunk/CSP/SimData/SimData/Tests/TypeTests.py 2004-09-25 09:26:37 UTC (rev 1245) +++ trunk/CSP/SimData/SimData/Tests/TypeTests.py 2004-09-25 21:29:26 UTC (rev 1246) @@ -40,6 +40,7 @@ self.assertEqual(str(d), "1903/01/09 05:06:07z") self.assertEqual(d.typeString(), "type::SimDate") def testErrors(self): + """Test error handling for invalid dates and times""" def catch(code, err=1): caught = 0 try: @@ -61,6 +62,7 @@ catch("SimData.SimDate(2003, 2, 0, 22, 51, 7)") catch("SimData.SimDate(2003, 10, 32, 22, 51, 7)") def testRollover(self): + """Test date rollover.""" sd = SimData.SimDate test = self.assertEqual test(sd(2003, 3, 1, -1, -1, -1), sd(2003, 2, 28, 22, 58, 59)) |