diff options
author | Fedor Indutny <fedor.indutny@gmail.com> | 2014-01-18 22:49:18 +0000 |
---|---|---|
committer | Fedor Indutny <fedor.indutny@gmail.com> | 2014-01-22 00:39:13 +0400 |
commit | 1442c1c6de1009a7f451a443c02b1450bcb5bc44 (patch) | |
tree | 32cace77dfd18e93d3edf85f1ace0e39456074a3 /test/testpy | |
parent | 2a0b619f7b830b2e34f1707f4428c77a6fcf33fc (diff) | |
download | android-node-v8-1442c1c6de1009a7f451a443c02b1450bcb5bc44.tar.gz android-node-v8-1442c1c6de1009a7f451a443c02b1450bcb5bc44.tar.bz2 android-node-v8-1442c1c6de1009a7f451a443c02b1450bcb5bc44.zip |
addons: build and test examples
fix #6910
Diffstat (limited to 'test/testpy')
-rw-r--r-- | test/testpy/__init__.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/testpy/__init__.py b/test/testpy/__init__.py index 54b0f19916..9593a1f642 100644 --- a/test/testpy/__init__.py +++ b/test/testpy/__init__.py @@ -134,3 +134,28 @@ class SimpleTestConfiguration(test.TestConfiguration): status_file = join(self.root, '%s.status' % (self.section)) if exists(status_file): test.ReadConfigurationInto(status_file, sections, defs) + +class AddonTestConfiguration(SimpleTestConfiguration): + def __init__(self, context, root, section, additional=[]): + super(AddonTestConfiguration, self).__init__(context, root, section) + + def Ls(self, path): + def SelectTest(name): + return name.endswith('.js') + + result = [] + for subpath in os.listdir(path): + if os.path.isdir(join(path, subpath)): + for f in os.listdir(join(path, subpath)): + if SelectTest(f): + result.append([subpath, f[:-3]]) + return result + + def ListTests(self, current_path, path, mode): + all_tests = [current_path + t for t in self.Ls(join(self.root))] + result = [] + for test in all_tests: + if self.Contains(path, test): + file_path = join(self.root, reduce(join, test[1:], "") + ".js") + result.append(SimpleTestCase(test, file_path, mode, self.context, self)) + return result |