python script\build.py -c D
```
-After building is done, you can find `electron.exe` under `out\D` (debug
+After building is done, you can find `electron.exe` under `out\D` (debug
target) or under `out\R` (release target).
## 64bit build
python script\test.py
```
+Tests that include native modules (e.g. `runas`) can't be executed with the
+debug build (see #2558 for details), but they will work with the release build.
+
+To run the tests with the release build use:
+
+```powershell
+python script\test.py -R
+```
+
## Troubleshooting
### Command xxxx not found
fixtures = path.join __dirname, 'fixtures'
temp.track()
- describe 'runas', ->
- it 'can be required in renderer', ->
- require 'runas'
+ # If the test is executed with the debug build on Windows, we will skip it
+ # because native modules don't work with the debug build (see issue #2558).
+ if process.platform isnt 'win32' or
+ process.execPath.toLowerCase().indexOf('\\out\\d\\') is -1
+ describe 'runas', ->
+ it 'can be required in renderer', ->
+ require 'runas'
- it 'can be required in node binary', (done) ->
- runas = path.join fixtures, 'module', 'runas.js'
- child = require('child_process').fork runas
- child.on 'message', (msg) ->
- assert.equal msg, 'ok'
- done()
+ it 'can be required in node binary', (done) ->
+ runas = path.join fixtures, 'module', 'runas.js'
+ child = require('child_process').fork runas
+ child.on 'message', (msg) ->
+ assert.equal msg, 'ok'
+ done()
describe 'q', ->
Q = require 'q'
webview.src = "file://#{fixtures}/pages/d.html"
document.body.appendChild webview
- it 'loads native modules when navigation happens', (done) ->
- listener = (e) ->
- webview.removeEventListener 'did-finish-load', listener
- listener2 = (e) ->
- assert.equal e.message, 'function'
- done()
- webview.addEventListener 'console-message', listener2
- webview.reload()
- webview.addEventListener 'did-finish-load', listener
- webview.setAttribute 'nodeintegration', 'on'
- webview.src = "file://#{fixtures}/pages/native-module.html"
- document.body.appendChild webview
+ # If the test is executed with the debug build on Windows, we will skip it
+ # because native modules don't work with the debug build (see issue #2558).
+ if process.platform isnt 'win32' or
+ process.execPath.toLowerCase().indexOf('\\out\\d\\') is -1
+ it 'loads native modules when navigation happens', (done) ->
+ listener = (e) ->
+ webview.removeEventListener 'did-finish-load', listener
+ listener2 = (e) ->
+ assert.equal e.message, 'function'
+ done()
+ webview.addEventListener 'console-message', listener2
+ webview.reload()
+ webview.addEventListener 'did-finish-load', listener
+ webview.setAttribute 'nodeintegration', 'on'
+ webview.src = "file://#{fixtures}/pages/native-module.html"
+ document.body.appendChild webview
describe 'preload attribute', ->
it 'loads the script before other scripts in window', (done) ->