mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:17:45 +00:00
test262-runner: Add option to disable core dumping
When running a larger set of tests in Serenity the runner would otherwise trigger a lot of crash reporters. This would then in turn lead to memory starvation causes more crashes.
This commit is contained in:
parent
e4f3c8bf00
commit
b5b3b9323d
1 changed files with 14 additions and 0 deletions
|
@ -25,6 +25,11 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#ifndef AK_OS_MACOS
|
||||||
|
// Only used to disable core dumps
|
||||||
|
# include <sys/prctl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
static String s_current_test = "";
|
static String s_current_test = "";
|
||||||
static bool s_use_bytecode = false;
|
static bool s_use_bytecode = false;
|
||||||
static bool s_parse_only = false;
|
static bool s_parse_only = false;
|
||||||
|
@ -553,6 +558,7 @@ int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
int timeout = 10;
|
int timeout = 10;
|
||||||
bool enable_debug_printing = false;
|
bool enable_debug_printing = false;
|
||||||
|
bool disable_core_dumping = false;
|
||||||
|
|
||||||
Core::ArgsParser args_parser;
|
Core::ArgsParser args_parser;
|
||||||
args_parser.set_general_help("LibJS test262 runner for streaming tests");
|
args_parser.set_general_help("LibJS test262 runner for streaming tests");
|
||||||
|
@ -561,8 +567,16 @@ int main(int argc, char** argv)
|
||||||
args_parser.add_option(s_parse_only, "Only parse the files", "parse-only", 'p');
|
args_parser.add_option(s_parse_only, "Only parse the files", "parse-only", 'p');
|
||||||
args_parser.add_option(timeout, "Seconds before test should timeout", "timeout", 't', "seconds");
|
args_parser.add_option(timeout, "Seconds before test should timeout", "timeout", 't', "seconds");
|
||||||
args_parser.add_option(enable_debug_printing, "Enable debug printing", "debug", 'd');
|
args_parser.add_option(enable_debug_printing, "Enable debug printing", "debug", 'd');
|
||||||
|
args_parser.add_option(disable_core_dumping, "Disable core dumping", "disable-core-dump", 0);
|
||||||
args_parser.parse(argc, argv);
|
args_parser.parse(argc, argv);
|
||||||
|
|
||||||
|
#ifndef AK_OS_MACOS
|
||||||
|
if (disable_core_dumping && prctl(PR_SET_DUMPABLE, 0, 0) < 0) {
|
||||||
|
perror("prctl(PR_SET_DUMPABLE)");
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (s_harness_file_directory.is_empty()) {
|
if (s_harness_file_directory.is_empty()) {
|
||||||
s_automatic_harness_detection_mode = true;
|
s_automatic_harness_detection_mode = true;
|
||||||
} else if (!s_harness_file_directory.ends_with('/')) {
|
} else if (!s_harness_file_directory.ends_with('/')) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue