aboutsummaryrefslogtreecommitdiff
path: root/tools/shared.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-01-20 18:37:31 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-01-20 18:37:31 -0800
commit63f02726973bd02c7b19a1e814aeb041cf832ed4 (patch)
treeabd0248e764f43df0cdacdb3f2fae067c7e5b5dc /tools/shared.py
parentc77346ca4a45f9eeaa1eb2b4a71ec73cfee4799c (diff)
do not add unneeded -s 'es in test runner
Diffstat (limited to 'tools/shared.py')
-rw-r--r--tools/shared.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/shared.py b/tools/shared.py
index 41221c67..6f6fa0d6 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -1,4 +1,4 @@
-import shutil, time, os, sys, json, tempfile
+import shutil, time, os, sys, json, tempfile, copy
from subprocess import Popen, PIPE, STDOUT
__rootpath__ = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
@@ -298,6 +298,7 @@ class Settings:
# Load the JS defaults into python
settings = open(path_from_root('src', 'settings.js')).read().replace('var ', 'Settings.').replace('//', '#')
exec settings in globals()
+ Settings.defaults = copy.copy(Settings.__dict__) # save the defaults for later comparisons
# Apply additional settings. First -O, then -s
for i in range(len(args)):
@@ -315,7 +316,10 @@ class Settings:
ret = []
for key, value in Settings.__dict__.iteritems():
if key == key.upper(): # this is a hack. all of our settings are ALL_CAPS, python internals are not
- ret += ['-s', key + '=' + json.dumps(value)]
+ jsoned = json.dumps(value)
+ # Only add if it actually modifies a default
+ if jsoned != json.dumps(Settings.defaults[key]):
+ ret += ['-s', key + '=' + jsoned]
return ret
@classmethod