From: <bao...@us...> - 2006-05-09 16:10:52
|
Revision: 101 Author: baoilleach Date: 2006-05-09 09:10:39 -0700 (Tue, 09 May 2006) ViewCVS: http://svn.sourceforge.net/cclib/?rev=101&view=rev Log Message: ----------- Adding some tests for the dimensions of aooverlaps and mocoeffs in restricted single point energy calculations -- what's the story with ADF though? Modified Paths: -------------- trunk/test/testall.py Modified: trunk/test/testall.py =================================================================== --- trunk/test/testall.py 2006-05-09 01:11:45 UTC (rev 100) +++ trunk/test/testall.py 2006-05-09 16:10:39 UTC (rev 101) @@ -2,6 +2,32 @@ from cclib.parser import GAMESS,G03,ADF,Jaguar from Numeric import array +class GenericSPTest(unittest.TestCase): + """Restricted single point calculations with MO coeffs and overlap info.""" + def testdimaooverlaps(self): + """Are the dims of the overlap matrix consistent with nbasis?""" + self.assertEquals(self.data.aooverlaps.shape,(self.data.nbasis,self.data.nbasis)) + + def testdimmocoeffs(self): + """Are the dimensions of mocoeffs equal to 1 x nindep x nbasis?""" + self.assertEquals(self.data.mocoeffs.shape,(1,self.data.nindep,self.data.nbasis)) + +class GaussianSPTest(GenericSPTest): + def setUp(self): + self.data = getfile(G03,"basicGaussian03","dvb_sp.out") + +class GamessUSSPTest(GenericSPTest): + def setUp(self): + self.data = getfile(GAMESS,"basicGAMESS-US","dvb_sp.out") + +class PCGamessSPTest(GenericSPTest): + def setUp(self): + self.data = getfile(GAMESS,"basicPCGAMESS","dvb_sp.out") + +class ADFSPTest(GenericSPTest): + def setUp(self): + self.data = getfile(ADF,"basicADF2004.01","dvb_sp_b.adfout") + class GenericGeoOptTest(unittest.TestCase): def testhomos(self): """Is the index of the homo equal to 34?""" @@ -106,6 +132,16 @@ errors += len(a.errors) failures += len(a.failures) + tests = [ GaussianSPTest, PCGamessSPTest, + GamessUSSPTest, ADFSPTest ] + for name,test in zip(names,tests): + print "\n**** Testing %s SP ****" % name + myunittest = unittest.makeSuite(test) + a = unittest.TextTestRunner(verbosity=2).run(myunittest) + total += a.testsRun + errors += len(a.errors) + failures += len(a.failures) + print "\n\n********* SUMMARY OF EVERYTHING **************" print "TOTAL: %d\tPASSED: %d\tFAILED: %d\tERRORS: %d" % (total,total-(errors+failures),failures,errors) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |