Browse Source

Fix internet testcase config

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
e8542b6220
  1. 40
      test/internet/testcfg.py

40
test/internet/testcfg.py

@ -27,6 +27,10 @@
import test
import os
import shutil
from shutil import rmtree
from os import mkdir
from glob import glob
from os.path import join, dirname, exists
import re
@ -42,6 +46,33 @@ class InternetTestCase(test.TestCase):
self.file = file
self.config = config
self.mode = mode
self.tmpdir = join(dirname(self.config.root), 'tmp')
def AfterRun(self, result):
# delete the whole tmp dir
try:
rmtree(self.tmpdir)
except:
pass
# make it again.
try:
mkdir(self.tmpdir)
except:
pass
def BeforeRun(self):
# delete the whole tmp dir
try:
rmtree(self.tmpdir)
except:
pass
# make it again.
# intermittently fails on win32, so keep trying
while not os.path.exists(self.tmpdir):
try:
mkdir(self.tmpdir)
except:
pass
def GetLabel(self):
return "%s %s" % (self.mode, self.GetName())
@ -79,14 +110,7 @@ class InternetTestConfiguration(test.TestConfiguration):
return [f[:-3] for f in os.listdir(path) if SelectTest(f)]
def ListTests(self, current_path, path, mode):
simple = [current_path + [t] for t in self.Ls(self.root)]
#simple = [current_path + ['simple', t] for t in self.Ls(join(self.root, 'simple'))]
#pummel = [current_path + ['pummel', t] for t in self.Ls(join(self.root, 'pummel'))]
#internet = [current_path + ['internet', t] for t in self.Ls(join(self.root, 'internet'))]
#regress = [current_path + ['regress', t] for t in self.Ls(join(self.root, 'regress'))]
#bugs = [current_path + ['bugs', t] for t in self.Ls(join(self.root, 'bugs'))]
#tools = [current_path + ['tools', t] for t in self.Ls(join(self.root, 'tools'))]
all_tests = simple # + regress + bugs + tools
all_tests = [current_path + [t] for t in self.Ls(join(self.root))]
result = []
for test in all_tests:
if self.Contains(path, test):

Loading…
Cancel
Save