diff --git a/.gitignore b/.gitignore index 0b53b35..4c7ffe1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /node_modules /build *.swp +npm-debug.log diff --git a/.npmignore b/.npmignore index 56b80ee..fb13d04 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,5 @@ .gitmodules .npmignore .travis.yml +npm-debug.log test diff --git a/.travis.yml b/.travis.yml index 11dba95..32cceec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ node_js: os: - osx +- linux notifications: email: diff --git a/binding.gyp b/binding.gyp index 61cbe1e..dc655b3 100644 --- a/binding.gyp +++ b/binding.gyp @@ -8,7 +8,7 @@ }, { 'dependencies': [ 'deps/breakpad/breakpad.gyp:minidump_stackwalk', - 'deps/breakpad/breakpad.gyp:dump_syms', + 'deps/breakpad/breakpad.gyp:dump_syms#host', ], }], ], diff --git a/common.gypi b/common.gypi index 6be5828..7eeea15 100644 --- a/common.gypi +++ b/common.gypi @@ -2,6 +2,7 @@ 'variables': { 'chromeos%': 0, 'os_bsd%': 0, + 'mac_deployment_target%': '10.9', }, 'target_defaults': { 'conditions': [ @@ -11,6 +12,8 @@ ['OS=="mac"', { 'xcode_settings': { 'OTHER_CFLAGS': ['-w'], + 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', + 'CLANG_CXX_LIBRARY': 'libc++', } }] ] diff --git a/deps/breakpad b/deps/breakpad index 1e93756..64ee374 160000 --- a/deps/breakpad +++ b/deps/breakpad @@ -1 +1 @@ -Subproject commit 1e937567e92d2c3beed4556f3c68a4b0362b1e6d +Subproject commit 64ee3743b4dd5e34220e2b47701be7be927ebd1f diff --git a/test/fixtures/linux.dmp b/test/fixtures/linux.dmp new file mode 100644 index 0000000..595ba88 Binary files /dev/null and b/test/fixtures/linux.dmp differ diff --git a/test/minidump-test.js b/test/minidump-test.js index 3ca489b..3e7ed74 100644 --- a/test/minidump-test.js +++ b/test/minidump-test.js @@ -7,7 +7,7 @@ var extractZip = require('extract-zip') var temp = require('temp').track() describe('minidump', function () { - this.timeout(60000) + this.timeout(3 * 60 * 1000) describe('walkStack()', function () { describe('macOS dump', function () { @@ -49,11 +49,29 @@ describe('minidump', function () { }) }) }) + + describe('Linux dump', function () { + it('calls back with a report', function (done) { + downloadElectronSymbols('linux', function (error, symbolsPath) { + if (error) return done(error) + + var dumpPath = path.join(__dirname, 'fixtures', 'linux.dmp') + minidump.walkStack(dumpPath, symbolsPath, function (error, report) { + if (error) return done(error) + + report = report.toString() + assert.notEqual(report.length, 0) + assert.notEqual(report.indexOf('electron!Crash [atom_bindings.cc : 27 + 0x0]'), -1) + done() + }) + }) + }) + }) }) describe('dumpSymbol()', function () { it('calls back with a minidump', function (done) { - if (process.platform !== 'darwin') return this.skip() + if (process.platform === 'win32') return this.skip() downloadElectron(function (error, binaryPath) { if (error) return done(error) @@ -73,7 +91,7 @@ var downloadElectron = function (callback) { electronDownload({ version: '1.4.3', arch: 'x64', - platform: 'darwin', + platform: process.platform, quiet: true }, function (error, zipPath) { if (error) return callback(error) @@ -81,7 +99,12 @@ var downloadElectron = function (callback) { var electronPath = temp.mkdirSync('node-minidump-') extractZip(zipPath, {dir: electronPath}, function (error) { if (error) return callback(error) - callback(null, path.join(electronPath, 'Electron.app', 'Contents', 'MacOS', 'Electron')) + + if (process.platform === 'darwin') { + callback(null, path.join(electronPath, 'Electron.app', 'Contents', 'MacOS', 'Electron')) + } else { + callback(null, path.join(electronPath, 'electron')) + } }) }) }