summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-07-05 10:31:37 -0700
committerRyan Dahl <ry@tinyclouds.org>2011-07-05 10:31:37 -0700
commite8542b6220379c3eeac663a46c29cd1405287f16 (patch)
tree0d811b02e513b28cdd028f094fac9948136b98fc
parentd964b4c5aafd431cfb63529a462871c446522f7a (diff)
downloadnode-e8542b6220379c3eeac663a46c29cd1405287f16.tar.gz
Fix internet testcase config
-rw-r--r--test/internet/testcfg.py42
1 files changed, 33 insertions, 9 deletions
diff --git a/test/internet/testcfg.py b/test/internet/testcfg.py
index cdd479390..3e3e900e6 100644
--- a/test/internet/testcfg.py
+++ b/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,7 +46,34 @@ 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):