Using segfault-handler to help debugging C++ crashes. (#1834)

* Using segfault-handler to help debugging C++ crashes.
* Only use segfault-handler in node environments.
This commit is contained in:
Kenneth Geisshirt 2018-05-29 18:05:36 +02:00 committed by GitHub
parent fa3e2c699b
commit b0535cb2c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

1
.gitignore vendored
View File

@ -57,3 +57,4 @@ build.log.*
realm-object-server/
tests/react-test-app/ios/out.txt
*.iml
crash.log

View File

@ -20,7 +20,6 @@
const Realm = require('realm');
if( typeof Realm.Sync !== 'undefined' && Realm.Sync !== null ) {
global.WARNING = "global is not available in React Native. Use it only in tests";
global.enableSyncTests = true;
@ -34,6 +33,12 @@ if (isNodeProcess && process.platform === 'win32') {
global.enableSyncTests = false;
}
// catching segfaults during testing can help debugging
if (isNodeProcess) {
const SegfaultHandler = node_require('segfault-handler');
SegfaultHandler.registerHandler("crash.log");
}
var TESTS = {
ListTests: require('./list-tests'),
LinkingObjectsTests: require('./linkingobjects-tests'),

View File

@ -8,6 +8,7 @@
"jasmine-console-reporter": "^1.2.7",
"jasmine-reporters": "^2.2.0",
"needle": "^1.3.0",
"segfault-handler": "^1.0.1",
"terminate": "^1.0.8",
"tmp": "^0.0.30",
"url-parse": "^1.1.7",