mirror of
https://github.com/nodejs/node.git
synced 2025-05-15 03:29:46 +00:00

PR-URL: https://github.com/nodejs/node/pull/35415 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
40 lines
1.2 KiB
JavaScript
40 lines
1.2 KiB
JavaScript
// Copyright 2020 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
function check_test_results(tests, status) {
|
|
let failed_counter = 0;
|
|
for (let test of tests) {
|
|
const PASS = 0;
|
|
const FAIL = 1;
|
|
const TIMEOUT = 2;
|
|
const NOTRUN = 3;
|
|
const PRECONDITION_FAILED = 4;
|
|
|
|
if (test.status !== PASS) {
|
|
console.log();
|
|
if (test.status === FAIL) {
|
|
console.log("Test failed");
|
|
} else if(test.status === TIMEOUT) {
|
|
console.log("Timeout");
|
|
} else if(test.status === NOTRUN) {
|
|
console.log("Test did not run");
|
|
} else if (test.status === PRECONDITION_FAILED) {
|
|
console.log("Test precondition failed");
|
|
} else {
|
|
console.log("Unknown error code:", test.status);
|
|
}
|
|
console.log("Message:");
|
|
console.log(test.message);
|
|
console.log("Stack trace:");
|
|
console.log(test.stack);
|
|
failed_counter++;
|
|
}
|
|
}
|
|
|
|
setTimeout(() => assertEquals(0, failed_counter));
|
|
}
|
|
|
|
add_completion_callback(check_test_results);
|
|
setup(() => {}, {'explicit_done': true});
|