OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 11 matching lines...) Expand all Loading... |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include <v8.h> | 28 #include <v8.h> |
29 #include "cctest.h" | 29 #include "cctest.h" |
30 #include "debug.h" | 30 #include "debug.h" |
31 | 31 |
32 | 32 v8::AllowSeveralV8InstancesInProcess v8_please; |
33 CcTest* CcTest::last_ = NULL; | 33 CcTest* CcTest::last_ = NULL; |
34 | 34 |
| 35 void CcTest::Run() { |
| 36 const int kAdditionalParallelThreads = 0; |
| 37 V8Runner** runners = new V8Runner*[kAdditionalParallelThreads]; |
| 38 for (int i = 0; i < kAdditionalParallelThreads; ++i) { |
| 39 (runners[i] = new V8Runner(callback_))->Start(); |
| 40 } |
| 41 callback_(); |
| 42 |
| 43 for (int i = 0; i < kAdditionalParallelThreads; ++i) { |
| 44 runners[i]->Join(); |
| 45 } |
| 46 } |
35 | 47 |
36 CcTest::CcTest(TestFunction* callback, const char* file, const char* name, | 48 CcTest::CcTest(TestFunction* callback, const char* file, const char* name, |
37 const char* dependency, bool enabled) | 49 const char* dependency, bool enabled) |
38 : callback_(callback), name_(name), dependency_(dependency), prev_(last_) { | 50 : callback_(callback), name_(name), dependency_(dependency), prev_(last_) { |
39 // Find the base name of this test (const_cast required on Windows). | 51 // Find the base name of this test (const_cast required on Windows). |
40 char *basename = strrchr(const_cast<char *>(file), '/'); | 52 char *basename = strrchr(const_cast<char *>(file), '/'); |
41 if (!basename) { | 53 if (!basename) { |
42 basename = strrchr(const_cast<char *>(file), '\\'); | 54 basename = strrchr(const_cast<char *>(file), '\\'); |
43 } | 55 } |
44 if (!basename) { | 56 if (!basename) { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 129 } |
118 } | 130 } |
119 if (print_run_count && tests_run != 1) | 131 if (print_run_count && tests_run != 1) |
120 printf("Ran %i tests.\n", tests_run); | 132 printf("Ran %i tests.\n", tests_run); |
121 v8::V8::Dispose(); | 133 v8::V8::Dispose(); |
122 return 0; | 134 return 0; |
123 } | 135 } |
124 | 136 |
125 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL; | 137 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL; |
126 int RegisterThreadedTest::count_ = 0; | 138 int RegisterThreadedTest::count_ = 0; |
OLD | NEW |