diff --git a/.gitignore b/.gitignore index 742ae0ae..a4d3f8c4 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,4 @@ build.log.* realm-object-server/ tests/react-test-app/ios/out.txt *.iml +crash.log diff --git a/tests/js/index.js b/tests/js/index.js index 130dd7a9..0e059c2a 100644 --- a/tests/js/index.js +++ b/tests/js/index.js @@ -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'), diff --git a/tests/package.json b/tests/package.json index 22550b1c..b29e47b1 100644 --- a/tests/package.json +++ b/tests/package.json @@ -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",