aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAlon Zakai <azakai@mozilla.com>2011-02-27 16:55:53 -0800
committerAlon Zakai <azakai@mozilla.com>2011-02-27 16:55:53 -0800
commit6b7f4ffa844bd3e1f2690af2501807e1da161034 (patch)
tree49ac3a5e35a09b09a1a2ad7aebbb8e9a6c86f263 /tools
parente932e70792a50786dedc0461697ed31c7ffa4bb2 (diff)
openjpeg test
Diffstat (limited to 'tools')
-rwxr-xr-xtools/emmaken.py14
-rw-r--r--tools/make_file.py18
-rw-r--r--tools/shared.py2
3 files changed, 33 insertions, 1 deletions
diff --git a/tools/emmaken.py b/tools/emmaken.py
index b860bacb..170ed1ef 100755
--- a/tools/emmaken.py
+++ b/tools/emmaken.py
@@ -48,9 +48,19 @@ def path_from_root(*pathelems):
return os.path.join(os.path.sep, *(abspath.split(os.sep)[:-1] + list(pathelems)))
exec(open(path_from_root('tools', 'shared.py'), 'r').read())
+# If this is a CMake config, just do that
+CMAKE_CONFIG = 'CMakeFiles/cmTryCompileExec.dir' in ' '.join(sys.argv)# or 'CMakeCCompilerId' in ' '.join(sys.argv)
+if CMAKE_CONFIG:
+ exit(os.execvp('gcc', ['gcc'] + sys.argv[1:]))
+
try:
+ print 'emmaken.py: ', ' '.join(sys.argv)
print >> sys.stderr, 'emmaken.py: ', ' '.join(sys.argv)
+ #f=open('/dev/shm/tmp/waka.txt', 'a')
+ #f.write('Args: ' + ' '.join(sys.argv) + '\nCMake? ' + str(CMAKE_CONFIG) + '\n')
+ #f.close()
+
CXX = os.environ.get('EMMAKEN_COMPILER') or LLVM_GCC
CC = to_cc(CXX)
@@ -125,6 +135,10 @@ try:
if not use_linker:
newargs.append('-c')
+ #f=open('/dev/shm/tmp/waka.txt', 'a')
+ #f.write('Calling: ' + ' '.join(newargs) + '\n\n')
+ #f.close()
+
print >> sys.stderr, "Running:", call, ' '.join(newargs)
os.execvp(call, [call] + newargs)
diff --git a/tools/make_file.py b/tools/make_file.py
new file mode 100644
index 00000000..9568ff40
--- /dev/null
+++ b/tools/make_file.py
@@ -0,0 +1,18 @@
+'''
+Takes the output from a JS test, and creates a file from it. So if
+you do JSON.stringify() of an array in JS, this script will take
+that and make a proper file out of it
+'''
+
+import os, sys, re
+
+data = open(sys.argv[1], 'r').read()
+m = re.search('\[[\d, ]*\]', data)
+data = eval(m.group(0))
+string = ''.join([chr(item) for item in data])
+out = open(sys.argv[1]+'.raw', 'wb')
+print data[0:80]
+print string[0:80]
+out.write(string)
+out.close()
+
diff --git a/tools/shared.py b/tools/shared.py
index ad3b1912..78b18ba7 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -35,7 +35,7 @@ def timeout_run(proc, timeout, note):
def run_js(engine, filename, args, check_timeout=False, stdout=PIPE, stderr=STDOUT):
return timeout_run(Popen(engine + [filename] + (['--'] if 'v8' in engine[0] else []) + args,
- stdout=stdout, stderr=stderr), 120 if check_timeout else None, 'Execution')
+ stdout=stdout, stderr=stderr), 15*60 if check_timeout else None, 'Execution')
def to_cc(cxx):
# By default, LLVM_GCC and CLANG are really the C++ versions. This gets an explicit C version