| 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 10 matching lines...) Expand all Loading... |
| 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 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 #include "isolate.h" |
| 31 | 32 |
| 32 | 33 |
| 33 CcTest* CcTest::last_ = NULL; | 34 CcTest* CcTest::last_ = NULL; |
| 34 | 35 |
| 35 | 36 |
| 36 CcTest::CcTest(TestFunction* callback, const char* file, const char* name, | 37 CcTest::CcTest(TestFunction* callback, const char* file, const char* name, |
| 37 const char* dependency, bool enabled) | 38 const char* dependency, bool enabled) |
| 38 : callback_(callback), name_(name), dependency_(dependency), prev_(last_) { | 39 : callback_(callback), name_(name), dependency_(dependency), prev_(last_) { |
| 39 // Find the base name of this test (const_cast required on Windows). | 40 // Find the base name of this test (const_cast required on Windows). |
| 40 char *basename = strrchr(const_cast<char *>(file), '/'); | 41 char *basename = strrchr(const_cast<char *>(file), '/'); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 64 printf("%s/%s<%s\n", | 65 printf("%s/%s<%s\n", |
| 65 current->file(), current->name(), current->dependency()); | 66 current->file(), current->name(), current->dependency()); |
| 66 } else { | 67 } else { |
| 67 printf("%s/%s<\n", current->file(), current->name()); | 68 printf("%s/%s<\n", current->file(), current->name()); |
| 68 } | 69 } |
| 69 } | 70 } |
| 70 | 71 |
| 71 | 72 |
| 72 int main(int argc, char* argv[]) { | 73 int main(int argc, char* argv[]) { |
| 73 v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true); | 74 v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true); |
| 75 v8::internal::Isolate::GlobalSetup(); |
| 74 int tests_run = 0; | 76 int tests_run = 0; |
| 75 bool print_run_count = true; | 77 bool print_run_count = true; |
| 76 for (int i = 1; i < argc; i++) { | 78 for (int i = 1; i < argc; i++) { |
| 77 char* arg = argv[i]; | 79 char* arg = argv[i]; |
| 78 if (strcmp(arg, "--list") == 0) { | 80 if (strcmp(arg, "--list") == 0) { |
| 79 PrintTestList(CcTest::last()); | 81 PrintTestList(CcTest::last()); |
| 80 print_run_count = false; | 82 print_run_count = false; |
| 81 | 83 |
| 82 } else { | 84 } else { |
| 83 char* arg_copy = v8::internal::StrDup(arg); | 85 char* arg_copy = v8::internal::StrDup(arg); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } | 119 } |
| 118 } | 120 } |
| 119 if (print_run_count && tests_run != 1) | 121 if (print_run_count && tests_run != 1) |
| 120 printf("Ran %i tests.\n", tests_run); | 122 printf("Ran %i tests.\n", tests_run); |
| 121 v8::V8::Dispose(); | 123 v8::V8::Dispose(); |
| 122 return 0; | 124 return 0; |
| 123 } | 125 } |
| 124 | 126 |
| 125 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL; | 127 RegisterThreadedTest *RegisterThreadedTest::first_ = NULL; |
| 126 int RegisterThreadedTest::count_ = 0; | 128 int RegisterThreadedTest::count_ = 0; |
| OLD | NEW |