Skip to content

Commit

Permalink
deps: add test for V8 version in profiler's log
Browse files Browse the repository at this point in the history
431eb17 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
nodejs/node-v0.x-archive#9208.
  • Loading branch information
Julien Gilli committed Feb 17, 2015
1 parent a6bdd8f commit 2b095bb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions deps/v8/test/cctest/test-log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -493,3 +494,17 @@ TEST(EquivalenceOfLoggingAndTraversal) {
CHECK(false);
}
}

TEST(LogVersion) {
ScopedLoggerInitializer initialize_logger;
bool exists = false;
i::Vector<const char> log(
i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true));
CHECK(exists);
i::EmbeddedVector<char, 100> 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();
}

0 comments on commit 2b095bb

Please sign in to comment.