OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 24 matching lines...) Expand all Loading... |
35 #endif // __linux__ | 35 #endif // __linux__ |
36 | 36 |
37 #include "src/v8.h" | 37 #include "src/v8.h" |
38 | 38 |
39 #include "src/cpu-profiler.h" | 39 #include "src/cpu-profiler.h" |
40 #include "src/log.h" | 40 #include "src/log.h" |
41 #include "src/log-utils.h" | 41 #include "src/log-utils.h" |
42 #include "src/natives.h" | 42 #include "src/natives.h" |
43 #include "src/utils.h" | 43 #include "src/utils.h" |
44 #include "src/v8threads.h" | 44 #include "src/v8threads.h" |
| 45 #include "src/version.h" |
45 #include "src/vm-state-inl.h" | 46 #include "src/vm-state-inl.h" |
46 #include "test/cctest/cctest.h" | 47 #include "test/cctest/cctest.h" |
47 | 48 |
48 using v8::internal::Address; | 49 using v8::internal::Address; |
49 using v8::internal::EmbeddedVector; | 50 using v8::internal::EmbeddedVector; |
50 using v8::internal::Logger; | 51 using v8::internal::Logger; |
51 using v8::internal::StrLength; | 52 using v8::internal::StrLength; |
52 | 53 |
53 namespace { | 54 namespace { |
54 | 55 |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 CHECK_NE(NULL, data.start()); | 501 CHECK_NE(NULL, data.start()); |
501 s->WriteUtf8(data.start()); | 502 s->WriteUtf8(data.start()); |
502 printf("%s\n", data.start()); | 503 printf("%s\n", data.start()); |
503 // Make sure that our output is written prior crash due to CHECK failure. | 504 // Make sure that our output is written prior crash due to CHECK failure. |
504 fflush(stdout); | 505 fflush(stdout); |
505 CHECK(false); | 506 CHECK(false); |
506 } | 507 } |
507 } | 508 } |
508 isolate->Dispose(); | 509 isolate->Dispose(); |
509 } | 510 } |
| 511 |
| 512 |
| 513 TEST(LogVersion) { |
| 514 v8::Isolate* isolate; |
| 515 { |
| 516 ScopedLoggerInitializer initialize_logger; |
| 517 isolate = initialize_logger.isolate(); |
| 518 bool exists = false; |
| 519 i::Vector<const char> log( |
| 520 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true)); |
| 521 CHECK(exists); |
| 522 i::EmbeddedVector<char, 100> ref_data; |
| 523 i::SNPrintF(ref_data, |
| 524 "v8-version,%d,%d,%d,%d,%d", |
| 525 i::Version::GetMajor(), |
| 526 i::Version::GetMinor(), |
| 527 i::Version::GetBuild(), |
| 528 i::Version::GetPatch(), |
| 529 i::Version::IsCandidate()); |
| 530 CHECK_NE(NULL, StrNStr(log.start(), ref_data.start(), log.length())); |
| 531 log.Dispose(); |
| 532 } |
| 533 isolate->Dispose(); |
| 534 } |
OLD | NEW |