From 2b095bb76c62d2e27f0fb9ca716f17198e925f62 Mon Sep 17 00:00:00 2001 From: Julien Gilli Date: Mon, 16 Feb 2015 15:38:57 -0800 Subject: [PATCH] deps: add test for V8 version in profiler's log 431eb172f97434a3b0868a610bc14d8ff7d9efd9 had integrated the addition of V8's version in V8's profiler log files, without backporting the test that was included in the original change (https://codereview.chromium.org/806143002). This commit backports this test. The newly added test was tested with https://github.com/joyent/node/pull/9208. --- deps/v8/test/cctest/test-log.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/deps/v8/test/cctest/test-log.cc b/deps/v8/test/cctest/test-log.cc index d72e6f0e1e..6800215081 100644 --- a/deps/v8/test/cctest/test-log.cc +++ b/deps/v8/test/cctest/test-log.cc @@ -42,6 +42,7 @@ #include "src/natives.h" #include "src/utils.h" #include "src/v8threads.h" +#include "src/version.h" #include "src/vm-state-inl.h" #include "test/cctest/cctest.h" @@ -493,3 +494,17 @@ TEST(EquivalenceOfLoggingAndTraversal) { CHECK(false); } } + +TEST(LogVersion) { + ScopedLoggerInitializer initialize_logger; + bool exists = false; + i::Vector log( + i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true)); + CHECK(exists); + i::EmbeddedVector ref_data; + i::SNPrintF(ref_data, "v8-version,%d,%d,%d,%d,%d", i::Version::GetMajor(), + i::Version::GetMinor(), i::Version::GetBuild(), + i::Version::GetPatch(), i::Version::IsCandidate()); + CHECK_NE(NULL, StrNStr(log.start(), ref_data.start(), log.length())); + log.Dispose(); +}