Skip to content

Commit

Permalink
add electron test case to examples and CI test coverage
Browse files Browse the repository at this point in the history
additionally, this PR includes a FIX for #63 (comment)
  • Loading branch information
Ryanmtate committed Aug 5, 2020
1 parent 4af2015 commit 33f5c9a
Show file tree
Hide file tree
Showing 14 changed files with 1,059 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ target-docker
dist
dylib
.idea/
node_modules
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,15 @@ assert.equal(obj.plusOne(),11);

There are more features in the examples folder.

## Windows + Electron Support
When using node-bindgen with electron on Windows, `nj-build` must
compile a C++ file, `win_delay_load_hook.cc`, and therefore it is required that the development
environment has a valid C/C++ compiler.

> If your machine does not have a valid C/C++ compiler, install [Microsoft VSCode](https://code.visualstudio.com/docs/cpp/config-mingw).
In the future, this file will be re-written in Rust, removing this dependency.

## Contributing

If you'd like to contribute to the project, please read our [Contributing guide](CONTRIBUTING.md).
Expand Down
8 changes: 8 additions & 0 deletions examples/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ members = [
"class-async",
"stream",
"buffer",
"array"
"array",
"electron"
]

#[patch.crates-io]
Expand Down
8 changes: 6 additions & 2 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ clean:
make -C class-wrapper clean
make -C class-async clean
make -C param clean
make -C electron clean


test: test-function test-cb test-async-cb test-promise test-json test-class-simple \
test-class-wrapper test-class-async test-stream test-buffer test-array
test-class-wrapper test-class-async test-stream test-buffer test-array test-electron

test-function:
make -C function test
Expand Down Expand Up @@ -49,4 +50,7 @@ test-buffer:
make -C buffer test

test-array:
make -C array test
make -C array test

test-electron:
make -C electron test
16 changes: 16 additions & 0 deletions examples/electron/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "test-electron"
version = "0.1.0"
authors = ["fluvio.io"]
edition = "2018"

[lib]
crate-type = ["cdylib"]


[dependencies]
node-bindgen = { path = "../.."}


[build-dependencies]
node-bindgen = { path = "../../", features = ["build"] }
9 changes: 9 additions & 0 deletions examples/electron/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
build:
npm run build

test:
npm run test

clean:
rm -rf dist

3 changes: 3 additions & 0 deletions examples/electron/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
node_bindgen::build::configure();
}
Loading

0 comments on commit 33f5c9a

Please sign in to comment.