def run(self): self.run_command('build') buildcmd = self.get_finalized_command('build') sys.path.insert(0, buildcmd.build_lib) if self.calculators is not None: calculators = self.calculators.split(',') elif 'ASE_CALCULATORS' in os.environ: calculators = os.environ['ASE_CALCULATORS'].split(',') else: calculators = [] from ase.test import test as _test testdir = '%s/testase-tempfiles' % buildcmd.build_base origcwd = os.getcwd() if os.path.isdir(testdir): shutil.rmtree(testdir) # clean before running tests! os.mkdir(testdir) os.chdir(testdir) try: results = _test(2, calculators, display=False) if results.failures or results.errors: print >> sys.stderr, 'Test suite failed' raise SystemExit(len(results.failures) + len(results.errors)) finally: os.chdir(origcwd)
def run(self): self.run_command('build') buildcmd = self.get_finalized_command('build') sys.path.insert(0, buildcmd.build_lib) from ase.test import test as _test testdir = '%s/testase-tempfiles' % buildcmd.build_base origcwd = os.getcwd() if not os.path.exists(testdir): os.mkdir(testdir) os.chdir(testdir) try: results = _test(2, display=False) if results.failures or results.errors: print >> sys.stderr, 'Test suite failed' raise SystemExit(len(results.failures) + len(results.errors)) finally: os.chdir(origcwd)