| OLD | NEW |
| (Empty) | |
| 1 # Copyright 2016 the V8 project authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import os |
| 6 import shutil |
| 7 import tempfile |
| 8 |
| 9 from testrunner.local import testsuite |
| 10 from testrunner.local import utils |
| 11 from testrunner.objects import testcase |
| 12 |
| 13 |
| 14 class MkSnapshotTestSuite(testsuite.TestSuite): |
| 15 |
| 16 def Setup(self): |
| 17 self.tmp_dir = tempfile.mkdtemp(prefix='tmp_mksnapshot_test_') |
| 18 |
| 19 def TearDown(self): |
| 20 shutil.rmtree(self.tmp_dir) |
| 21 |
| 22 def ListTests(self, context): |
| 23 return [ |
| 24 testcase.TestCase( |
| 25 self, |
| 26 'Snapshot%03d' % i, |
| 27 flags=[ |
| 28 '--random-seed=%d' % utils.RandomSeed(), |
| 29 '--startup_src=%s' % os.path.join( |
| 30 self.tmp_dir, 'snapshot%03d.cc' % i), |
| 31 '--startup_blob=%s' % os.path.join( |
| 32 self.tmp_dir, 'snapshot_blob%03d.bin' % i), |
| 33 ], |
| 34 ) |
| 35 for i in range(100) |
| 36 ] |
| 37 |
| 38 def GetFlagsForTestCase(self, testcase, context): |
| 39 return testcase.flags + context.mode_flags |
| 40 |
| 41 def shell(self): |
| 42 return 'mksnapshot' |
| 43 |
| 44 def _VariantGeneratorFactory(self): |
| 45 return testsuite.StandardVariantGenerator |
| 46 |
| 47 |
| 48 def GetSuite(name, root): |
| 49 return MkSnapshotTestSuite(name, root) |
| OLD | NEW |