v8/tools/testrunner/local/testsuite_unittest.py
Tamer Tas 4eec444957 [testrunner] add tests for loading TestSuite from disk
- Removed the old test.
- Created a fake test suite and added a test for loading it with a TestConfig

R=machenbach@chromium.org
CC=​​yangguo@chromium.org,sergiyb@chromium.org

Bug: v8:8174
Change-Id: Ib7587ceec9e31ecd4cb8f45c3158e73c79a9bc5b
Reviewed-on: https://chromium-review.googlesource.com/c/1396082
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Tamer Tas <tmrts@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58593}
2019-01-07 15:02:04 +00:00

52 lines
1.4 KiB
Python
Executable File

#!/usr/bin/env python
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import tempfile
import unittest
# Needed because the test runner contains relative imports.
TOOLS_PATH = os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__))))
sys.path.append(TOOLS_PATH)
from testrunner.local.testsuite import TestSuite
from testrunner.objects.testcase import TestCase
from testrunner.test_config import TestConfig
class TestSuiteTest(unittest.TestCase):
def setUp(self):
test_dir = os.path.dirname(__file__)
self.test_root = os.path.join(test_dir, "fake_testsuite")
self.test_config = TestConfig(
command_prefix=[],
extra_flags=[],
isolates=False,
mode_flags=[],
no_harness=False,
noi18n=False,
random_seed=0,
run_skipped=False,
shell_dir='fake_testsuite/fake_d8',
timeout=10,
verbose=False,
)
def testLoadingTestSuite(self):
suite = TestSuite.LoadTestSuite(self.test_root, self.test_config)
self.assertEquals(suite.name, "fake_testsuite")
self.assertEquals(suite.test_config, self.test_config)
# Verify that no tests are loaded yet.
self.assertIsNone(suite.tests)
self.assertIsNone(suite.statusfile)
if __name__ == '__main__':
unittest.main()