Browse Source

deps: add test for V8 version in profiler's log

431eb172f9 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.
v0.12.2-release
Julien Gilli 10 years ago
parent
commit
2b095bb76c
  1. 15
      deps/v8/test/cctest/test-log.cc

15
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<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();
}

Loading…
Cancel
Save