[mjsunit] Fix tmp log files for --log tests
https://crrev.com/c/2972915 previously added more gitignore files to the repository. This left the repo dirty after running mjsunit tests due to lingering .log files. - Add test/mjsunit/tools/tmp dir to keep and ignore temporary log files without the need for a platform specific tmp dir - Use temporary logfiles with --logfile=+ for log-ci.js tests Change-Id: I1b1a47f45603d6c3027c6ca7050c78e8df0664ce Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2992720 Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Michael Achenbach <machenbach@chromium.org> Commit-Queue: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#75451}
This commit is contained in:
parent
58406c760c
commit
cd658fd283
@ -2,8 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --log-ic --logfile=test/mjsunit/tools/log-ic-test.log
|
||||
// Flags: --allow-natives-syntax
|
||||
// Flags: --log-ic --logfile='+' --allow-natives-syntax
|
||||
|
||||
// The idea behind this test is to make sure we do not crash when using the
|
||||
// --log-ic flag.
|
||||
|
@ -470,35 +470,35 @@ function testTickProcessor(logInput, refOutput, args=[]) {
|
||||
// /foo/bar/tickprocesser.mjs => /foo/bar/
|
||||
const dir = import.meta.url.split("/").slice(0, -1).join('/') + '/';
|
||||
const params = ArgumentsProcessor.process(args);
|
||||
testExpectations(dir + logInput, dir + refOutput, params);
|
||||
testExpectations(dir, logInput, refOutput, params);
|
||||
// TODO(cbruni): enable again after it works on bots
|
||||
// testEndToEnd(dir + 'tickprocessor-test-large.js', dir + refOutput, params);
|
||||
// testEndToEnd(dir, 'tickprocessor-test-large.js', refOutput, params);
|
||||
}
|
||||
|
||||
function testExpectations(logInput, refOutput, params) {
|
||||
const symbolsFile = logInput + '.symbols.json';
|
||||
function testExpectations(dir, logInput, refOutput, params) {
|
||||
const symbolsFile = dir + logInput + '.symbols.json';
|
||||
const cppEntries = new CppEntriesProviderMock(symbolsFile);
|
||||
const tickProcessor = TickProcessor.fromParams(params, cppEntries);
|
||||
const printMonitor = new PrintMonitor(refOutput);
|
||||
tickProcessor.processLogFileInTest(logInput);
|
||||
const printMonitor = new PrintMonitor(dir + refOutput);
|
||||
tickProcessor.processLogFileInTest(dir + logInput);
|
||||
tickProcessor.printStatistics();
|
||||
printMonitor.finish();
|
||||
};
|
||||
|
||||
function testEndToEnd(sourceFile, ignoredRefOutput, params) {
|
||||
function testEndToEnd(dir, sourceFile, ignoredRefOutput, params) {
|
||||
// This test only works on linux.
|
||||
if (!os?.system) return;
|
||||
if (os.name !== 'linux' && os.name !== 'macos') return;
|
||||
params.platform = os.name;
|
||||
const tmpLogFile= `/var/tmp/${Date.now()}.v8.log`
|
||||
const result = os.system(
|
||||
os.d8Path, ['--prof', `--logfile=${tmpLogFile}`, sourceFile]);
|
||||
os.d8Path, ['--prof', `--logfile=${tmpLogFile}`, dir + sourceFile]);
|
||||
|
||||
const tickProcessor = TickProcessor.fromParams(params);
|
||||
// We will not always get the same ticks due to timing on bots,
|
||||
// hence we cannot properly compare output expectations.
|
||||
// Let's just use a dummy file and only test whether we don't throw.
|
||||
const printMonitor = new PrintMonitor(ignoredRefOutput);
|
||||
const printMonitor = new PrintMonitor(dir + ignoredRefOutput);
|
||||
tickProcessor.processLogFileInTest(tmpLogFile);
|
||||
tickProcessor.printStatistics();
|
||||
}
|
Loading…
Reference in New Issue
Block a user