Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/node_modules
/build
*.swp
npm-debug.log
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.gitmodules
.npmignore
.travis.yml
npm-debug.log
test
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_js:

os:
- osx
- linux

notifications:
email:
Expand Down
2 changes: 1 addition & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}, {
'dependencies': [
'deps/breakpad/breakpad.gyp:minidump_stackwalk',
'deps/breakpad/breakpad.gyp:dump_syms',
'deps/breakpad/breakpad.gyp:dump_syms#host',
],
}],
],
Expand Down
3 changes: 3 additions & 0 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
'variables': {
'chromeos%': 0,
'os_bsd%': 0,
'mac_deployment_target%': '10.9',
},
'target_defaults': {
'conditions': [
Expand All @@ -11,6 +12,8 @@
['OS=="mac"', {
'xcode_settings': {
'OTHER_CFLAGS': ['-w'],
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
'CLANG_CXX_LIBRARY': 'libc++',
}
}]
]
Expand Down
Binary file added test/fixtures/linux.dmp
Binary file not shown.
31 changes: 27 additions & 4 deletions test/minidump-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down Expand Up @@ -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)
Expand All @@ -73,15 +91,20 @@ 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)

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'))
}
})
})
}
Expand Down