diff options
author | Refael Ackermann <refack@gmail.com> | 2018-10-04 01:50:21 +0300 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2018-11-29 19:38:55 +0300 |
commit | 8e08a27edf12c44c6ca71b8cabdf977152285716 (patch) | |
tree | 8ea23abaecab2b798233e6ec2bfaf35ec9607378 /test | |
parent | c2aa762fd7e4d05845a266d7f8bdec75ef899c31 (diff) |
tools,test: cleanup and dedup code
* Hoist common code to base class
(`GetTestStatus`, and the `section` property to `TestConfiguration`)
* Replace ListSet with the built in set
* Remove ClassifiedTest
* Inline PrintReport
* How cases_to_run are filtered
PR-URL: https://github.com/nodejs/node/pull/23251
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/message/testcfg.py | 11 | ||||
-rw-r--r-- | test/pseudo-tty/testcfg.py | 11 | ||||
-rw-r--r-- | test/testpy/__init__.py | 10 |
3 files changed, 4 insertions, 28 deletions
diff --git a/test/message/testcfg.py b/test/message/testcfg.py index 819dfa12c5b..7e8d73bb39a 100644 --- a/test/message/testcfg.py +++ b/test/message/testcfg.py @@ -108,10 +108,6 @@ class MessageTestCase(test.TestCase): class MessageTestConfiguration(test.TestConfiguration): - - def __init__(self, context, root): - super(MessageTestConfiguration, self).__init__(context, root) - def Ls(self, path): if isdir(path): return [f for f in os.listdir(path) @@ -135,11 +131,6 @@ class MessageTestConfiguration(test.TestConfiguration): def GetBuildRequirements(self): return ['sample', 'sample=shell'] - def GetTestStatus(self, sections, defs): - status_file = join(self.root, 'message.status') - if exists(status_file): - test.ReadConfigurationInto(status_file, sections, defs) - def GetConfiguration(context, root): - return MessageTestConfiguration(context, root) + return MessageTestConfiguration(context, root, 'message') diff --git a/test/pseudo-tty/testcfg.py b/test/pseudo-tty/testcfg.py index 92078984458..a5b7917bc05 100644 --- a/test/pseudo-tty/testcfg.py +++ b/test/pseudo-tty/testcfg.py @@ -122,10 +122,6 @@ class TTYTestCase(test.TestCase): class TTYTestConfiguration(test.TestConfiguration): - - def __init__(self, context, root): - super(TTYTestConfiguration, self).__init__(context, root) - def Ls(self, path): if isdir(path): return [f[:-3] for f in os.listdir(path) if f.endswith('.js')] @@ -155,11 +151,6 @@ class TTYTestConfiguration(test.TestConfiguration): def GetBuildRequirements(self): return ['sample', 'sample=shell'] - def GetTestStatus(self, sections, defs): - status_file = join(self.root, 'pseudo-tty.status') - if exists(status_file): - test.ReadConfigurationInto(status_file, sections, defs) - def GetConfiguration(context, root): - return TTYTestConfiguration(context, root) + return TTYTestConfiguration(context, root, 'pseudo-tty') diff --git a/test/testpy/__init__.py b/test/testpy/__init__.py index 8b5b2f6b48f..27d7124bf2e 100644 --- a/test/testpy/__init__.py +++ b/test/testpy/__init__.py @@ -95,11 +95,10 @@ class SimpleTestCase(test.TestCase): def GetSource(self): return open(self.file).read() -class SimpleTestConfiguration(test.TestConfiguration): +class SimpleTestConfiguration(test.TestConfiguration): def __init__(self, context, root, section, additional=None): - super(SimpleTestConfiguration, self).__init__(context, root) - self.section = section + super(SimpleTestConfiguration, self).__init__(context, root, section) if additional is not None: self.additional_flags = additional else: @@ -122,11 +121,6 @@ class SimpleTestConfiguration(test.TestConfiguration): def GetBuildRequirements(self): return ['sample', 'sample=shell'] - def GetTestStatus(self, sections, defs): - status_file = join(self.root, '%s.status' % (self.section)) - if exists(status_file): - test.ReadConfigurationInto(status_file, sections, defs) - class ParallelTestConfiguration(SimpleTestConfiguration): def __init__(self, context, root, section, additional=None): super(ParallelTestConfiguration, self).__init__(context, root, section, |