#include "src/log-utils.h"
#include "src/string-stream.h"
+#include "src/version.h"
namespace v8 {
namespace internal {
} else {
OpenFile(log_file_name);
}
+
+ if (output_handle_ != nullptr) {
+ Log::MessageBuilder msg(this);
+ msg.Append("v8-version,%d,%d,%d,%d,%d", Version::GetMajor(),
+ Version::GetMinor(), Version::GetBuild(), Version::GetPatch(),
+ Version::IsCandidate());
+ msg.WriteToLogFile();
+ }
}
}
#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"
}
isolate->Dispose();
}
+
+
+TEST(LogVersion) {
+ v8::Isolate* isolate;
+ {
+ ScopedLoggerInitializer initialize_logger;
+ isolate = initialize_logger.isolate();
+ 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();
+ }
+ isolate->Dispose();
+}