Commit 92843517 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm][fuzzer] Automatically compute year for test generation

This avoids having to update either the source code or the generated
test cases each year.

R=ahaas@chromium.org

Change-Id: I33fb85dc4ae7d45f8d05d982e0285d6fd3008a26
Reviewed-on: https://chromium-review.googlesource.com/c/1405032Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58725}
parent 1740bc7b
......@@ -4,6 +4,8 @@
#include "test/fuzzer/wasm-fuzzer-common.h"
#include <ctime>
#include "include/v8.h"
#include "src/isolate.h"
#include "src/objects-inl.h"
......@@ -163,7 +165,18 @@ void GenerateTestCase(Isolate* isolate, ModuleWireBytes wire_bytes,
StdoutStream os;
os << "// Copyright 2018 the V8 project authors. All rights reserved.\n"
tzset();
time_t current_time = time(nullptr);
struct tm current_localtime;
#ifdef V8_OS_WIN
localtime_s(&current_localtime, &current_time);
#else
localtime_r(&current_time, &current_localtime);
#endif
int year = 1900 + current_localtime.tm_year;
os << "// Copyright " << year
<< " the V8 project authors. All rights reserved.\n"
"// Use of this source code is governed by a BSD-style license that "
"can be\n"
"// found in the LICENSE file.\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment