diff options
author | Sam Mikes <smikes@cubane.com> | 2014-07-21 15:15:04 +0100 |
---|---|---|
committer | Sam Mikes <smikes@cubane.com> | 2014-07-21 15:15:04 +0100 |
commit | d4a3479a1ea95b073e7f7e16ef8e984714b0b395 (patch) | |
tree | d29433d1ce9e0795f93d8f88479e966cf9046086 /tools/packaging | |
parent | 33c8399de842515918bf64e42f44aae341fc469b (diff) | |
download | qtdeclarative-testsuites-d4a3479a1ea95b073e7f7e16ef8e984714b0b395.tar.gz |
test262.py: only include helper scripts when needed
test262.py: only supply async helper scripts when test is async
sth.js: factor out function isAsyncTest()
timer.js: improve workaround for async tests when Promise is defined but setTimeout is noot
timer.js emulates setTimeout using Promise by doing a busy loop that checks
if `timeout` milliseconds have elapsed. Modified check to (timeLeft > 0) instead
of (!timeLeft) to prevent infinite loop when check does not happen to run
at precise millisecond timeout expires.
Because test262.py did not support the $INCLUDE directive, some helper
scripts were added to every test -- notably testIntl, timer, and donePrintHandle
Now that $INCLUDE is supported, these can be dropped, speeding overall test run time
Diffstat (limited to 'tools/packaging')
-rwxr-xr-x | tools/packaging/test262.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/packaging/test262.py b/tools/packaging/test262.py index 5a1917eaa..1e7ad1689 100755 --- a/tools/packaging/test262.py +++ b/tools/packaging/test262.py @@ -260,11 +260,14 @@ class TestCase(object): # "var testDescrip = " + str(self.testRecord) + ';\n\n' + \ source = self.suite.GetInclude("cth.js") + \ self.suite.GetInclude("sta.js") + \ - self.suite.GetInclude("ed.js") + \ - self.suite.GetInclude("testBuiltInObject.js") + \ - self.suite.GetInclude("testIntl.js") + \ - self.suite.GetInclude("timer.js") + \ - self.suite.GetInclude("doneprintHandle.js").replace('print', self.suite.print_handle) + \ + self.suite.GetInclude("ed.js") + + if self.IsAsyncTest(): + source = source + \ + self.suite.GetInclude("timer.js") + \ + self.suite.GetInclude("doneprintHandle.js").replace('print', self.suite.print_handle) + + source = source + \ self.GetAdditionalIncludes() + \ self.test + '\n' |