| 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 18 matching lines...) Expand all Loading... |
| 29 #include "cctest.h" | 29 #include "cctest.h" |
| 30 #include "debug.h" | 30 #include "debug.h" |
| 31 | 31 |
| 32 | 32 |
| 33 CcTest* CcTest::last_ = NULL; | 33 CcTest* CcTest::last_ = NULL; |
| 34 | 34 |
| 35 | 35 |
| 36 CcTest::CcTest(TestFunction* callback, const char* file, const char* name, | 36 CcTest::CcTest(TestFunction* callback, const char* file, const char* name, |
| 37 const char* dependency, bool enabled) | 37 const char* dependency, bool enabled) |
| 38 : callback_(callback), name_(name), dependency_(dependency), prev_(last_) { | 38 : callback_(callback), name_(name), dependency_(dependency), prev_(last_) { |
| 39 // Make sure that the global isolate has had a chance to complete its | |
| 40 // static initialization. (We need this so that things like StrDup work.) | |
| 41 v8::internal::Isolate::EnsureDefaultIsolate(); | |
| 42 CHECK(v8::internal::Isolate::Current() != NULL); | |
| 43 | |
| 44 // Find the base name of this test (const_cast required on Windows). | 39 // Find the base name of this test (const_cast required on Windows). |
| 45 char *basename = strrchr(const_cast<char *>(file), '/'); | 40 char *basename = strrchr(const_cast<char *>(file), '/'); |
| 46 if (!basename) { | 41 if (!basename) { |
| 47 basename = strrchr(const_cast<char *>(file), '\\'); | 42 basename = strrchr(const_cast<char *>(file), '\\'); |
| 48 } | 43 } |
| 49 if (!basename) { | 44 if (!basename) { |
| 50 basename = v8::internal::StrDup(file); | 45 basename = v8::internal::StrDup(file); |
| 51 } else { | 46 } else { |
| 52 basename = v8::internal::StrDup(basename + 1); | 47 basename = v8::internal::StrDup(basename + 1); |
| 53 } | 48 } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 } | 117 } |
| 123 } | 118 } |
| 124 if (print_run_count && tests_run != 1) | 119 if (print_run_count && tests_run != 1) |
| 125 printf("Ran %i tests.\n", tests_run); | 120 printf("Ran %i tests.\n", tests_run); |
| 126 v8::V8::Dispose(); | 121 v8::V8::Dispose(); |
| 127 return 0; | 122 return 0; |
| 128 } | 123 } |
| 129 | 124 |
| 130 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL; | 125 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL; |
| 131 int RegisterThreadedTest::count_ = 0; | 126 int RegisterThreadedTest::count_ = 0; |
| OLD | NEW |