Source
3
3
###
4
4
### PYTHONPATH=build/lib.macosx-10.12-x86_64-3.6 python tests/run.py tests/tools/image/test_ia_imageconcat.py tests/tools/image/test_ia_makecomplex.py
5
5
###
6
6
import os
7
7
import sys
8
8
import time
9
9
import inspect
10
10
import unittest
11
11
import subprocess
12
12
from subprocess import Popen, PIPE
13
-
from distutils.dir_util import remove_tree
13
+
import shutil
14
14
from xml.sax.saxutils import escape
15
15
16
16
###
17
17
### xUnit generation
18
18
###
19
19
20
20
xml_escape_table = {
21
21
"&": "&",
22
22
'"': """,
23
23
"'": "'",
107
107
108
108
if len(sys.argv) == 1:
109
109
tests = [ ]
110
110
run_py = os.path.realpath(__file__)
111
111
test_dir = os.path.dirname(run_py)
112
112
for dir, subdirs, files in os.walk(test_dir):
113
113
for f in files:
114
114
if f.endswith(".py") and f.startswith("test_"):
115
115
workingdir = "%s/work/%s" % (test_dir,f[:-3])
116
116
if os.path.exists(workingdir):
117
-
remove_tree(workingdir)
117
+
shutil.rmtree(workingdir)
118
118
mkpath(workingdir)
119
119
tests.append((os.path.abspath("%s/%s" % (dir,f)),workingdir))
120
120
121
121
testwidth = 0 if len(tests) == 0 else max(map(lambda x: len(os.path.basename(x[0]))+3,tests))
122
122
tabwidth = max(testwidth,45)
123
123
124
124
start_time = time.time()
125
125
126
126
results = list(map(lambda params: run_test(tabwidth,*params),tests))
127
127