aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-02-27 19:07:02 -0800
committerChad Austin <chad@imvu.com>2013-03-04 19:35:18 -0800
commitcc0d959ebeb0624d7e8f3af496c170340afb8e55 (patch)
treee47dd030d21fe970b64478faa5792a90d99feb8b
parent4bde971a1f51eaa9c6da2e54a295ff04183cbab5 (diff)
fix some test failures
-rwxr-xr-xtests/runner.py2
-rw-r--r--tools/cache.py3
-rw-r--r--tools/file_packager.py2
-rw-r--r--tools/js_optimizer.py2
-rw-r--r--tools/shared.py13
5 files changed, 13 insertions, 9 deletions
diff --git a/tests/runner.py b/tests/runner.py
index c9c8ac9e..e631b025 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -11943,6 +11943,8 @@ fi
try_delete(CANONICAL_TEMP_DIR)
def test_relooper(self):
+ RELOOPER = Cache.get_path('relooper.js')
+
restore()
for phase in range(2): # 0: we wipe the relooper dir. 1: we have it, so should just update
if phase == 0: Cache.erase()
diff --git a/tools/cache.py b/tools/cache.py
index 2958197c..dec32473 100644
--- a/tools/cache.py
+++ b/tools/cache.py
@@ -1,5 +1,6 @@
import os.path, shutil, hashlib, cPickle
-from . import tempfiles
+
+import tempfiles
# Permanent cache for dlmalloc and stdlibc++
class Cache:
diff --git a/tools/file_packager.py b/tools/file_packager.py
index bfa8e2f0..73ff4919 100644
--- a/tools/file_packager.py
+++ b/tools/file_packager.py
@@ -35,8 +35,8 @@ TODO: You can also provide .crn files yourself, pre-crunched. With this o
import os, sys, shutil, random
-from shared import Compression, execute, suffix, unsuffixed
import shared
+from shared import Compression, execute, suffix, unsuffixed
from subprocess import Popen, PIPE, STDOUT
data_target = sys.argv[1]
diff --git a/tools/js_optimizer.py b/tools/js_optimizer.py
index ad3a1f79..2fd2211b 100644
--- a/tools/js_optimizer.py
+++ b/tools/js_optimizer.py
@@ -31,7 +31,7 @@ def run_on_chunk(command):
return filename
def run_on_js(filename, passes, js_engine, jcache):
-
+ if isinstance(jcache, bool) and jcache: jcache = shared.JCache
if jcache: shared.JCache.ensure()
if type(passes) == str:
diff --git a/tools/shared.py b/tools/shared.py
index ff9f9f9b..06d530b8 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -1,7 +1,7 @@
import shutil, time, os, sys, json, tempfile, copy, shlex, atexit, subprocess, hashlib, cPickle, zlib, re
from subprocess import Popen, PIPE, STDOUT
from tempfile import mkstemp
-from . import jsrun, cache, tempfiles
+import jsrun, cache, tempfiles
def listify(x):
if type(x) is not list: return [x]
@@ -307,13 +307,13 @@ class Configuration:
print >> sys.stderr, 'TEMP_DIR not defined in ~/.emscripten, using /tmp'
self.TEMP_DIR = '/tmp'
- CANONICAL_TEMP_DIR = os.path.join(self.TEMP_DIR, 'emscripten_temp')
+ self.CANONICAL_TEMP_DIR = os.path.join(self.TEMP_DIR, 'emscripten_temp')
if self.DEBUG:
try:
- self.EMSCRIPTEN_TEMP_DIR = CANONICAL_TEMP_DIR
- if not os.path.exists(EMSCRIPTEN_TEMP_DIR):
- os.makedirs(EMSCRIPTEN_TEMP_DIR)
+ self.EMSCRIPTEN_TEMP_DIR = self.CANONICAL_TEMP_DIR
+ if not os.path.exists(self.EMSCRIPTEN_TEMP_DIR):
+ os.makedirs(self.EMSCRIPTEN_TEMP_DIR)
except Exception, e:
print >> sys.stderr, e, 'Could not create canonical temp dir. Check definition of TEMP_DIR in ~/.emscripten'
@@ -330,6 +330,7 @@ configuration = Configuration(environ=os.environ)
DEBUG = configuration.DEBUG
EMSCRIPTEN_TEMP_DIR = configuration.EMSCRIPTEN_TEMP_DIR
DEBUG_CACHE = configuration.DEBUG_CACHE
+CANONICAL_TEMP_DIR = configuration.CANONICAL_TEMP_DIR
if not EMSCRIPTEN_TEMP_DIR:
EMSCRIPTEN_TEMP_DIR = tempfile.mkdtemp(prefix='emscripten_temp_', dir=configuration.TEMP_DIR)
@@ -430,7 +431,7 @@ if not WINDOWS:
pass
# Temp file utilities
-from .tempfiles import try_delete
+from tempfiles import try_delete
# Utilities