aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-12-06 10:39:21 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-12-06 10:39:21 -0800
commit0f3f5cc6934a45c78ce7bfb2bdab15bb8756edf7 (patch)
treeb9513da15404ce6f13a0712f8cf5d333002ecf7d /tools
parent0591fabb67954257cfa3a024b78f46a392fd4a31 (diff)
add 'defaults' pass in test runner, and rename other passes to 'special'
Diffstat (limited to 'tools')
-rw-r--r--tools/shared.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/tools/shared.py b/tools/shared.py
index 632cf633..0aead08a 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -144,11 +144,22 @@ def read_pgo_data(filename):
'overflows_lines': overflows_lines
}
-# Settings
-
-class Dummy: pass
-
-Settings = Dummy() # A global singleton. Not pretty, but nicer than passing |, settings| everywhere
+# Settings. A global singleton. Not pretty, but nicer than passing |, settings| everywhere
+
+class Settings:
+ @classmethod
+ def reset(self):
+ global Settings
+ class Settings2:
+ reset = Settings.reset
+ load_defaults = Settings.load_defaults
+ Settings = Settings2
+
+ @classmethod
+ def load_defaults(self):
+ ''' Load the JS settings into Python '''
+ settings = open(path_from_root('src', 'settings.js')).read().replace('var ', 'Settings.').replace('//', '#')
+ exec(settings)
# Building