summaryrefslogtreecommitdiff
path: root/test/addons
Commit message (Collapse)AuthorAgeFilesLines
* buffer: fix assertion error in WeakCallbackFedor Indutny2015-10-122-5/+18
| | | | | | | | | | | | | | | `CallbackInfo` is now bound to `ArrayBuffer` instance, not `Uint8Array`, therefore `SPREAD_ARG` will abort with: Assertion failed: ((object)->IsUint8Array()) Make changes necessary to migrate it to `ArrayBuffer`. See: https://github.com/nodejs/node/pull/3080#issuecomment-147502167 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> PR-URL: https://github.com/nodejs/node/pull/3329
* test: linting for buffer-free-callback testRich Trott2015-10-061-0/+1
| | | | | | | | | | | Test added in d1f24044 does not pass linting rule added in 3de353b5. Fixed in this commit. `common` module required in all tests except those that intentionally leak variables. PR-URL: https://github.com/nodejs/node/pull/3230 Fixes: https://github.com/nodejs/node/issues/3229 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
* buffer: FreeCallback should be tied to ArrayBufferFedor Indutny2015-10-063-0/+53
| | | | | | | | | | | FreeCallback should be invoked on the storage disposal (`ArrayBuffer`), not when the view (`Uint8Array` or `Buffer`) is disposed. This causes bug and crashes in addons which create buffers and store only slices of them. PR-URL: https://github.com/nodejs/node/pull/3198 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
* test: load common.js in all testsRich Trott2015-10-066-0/+7
| | | | | | | | | | | | common.js contains code that detects leaked variables. In preparation for an eslint rule that will enforce loading common.js in test files, load it everywhere it can be loaded and use an `eslint-disable` comment for files that intentionally leak. PR-URL: https://github.com/nodejs/node/pull/3157 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* module: use UNC paths when loading native addonsJustin Chase2015-10-053-0/+50
| | | | | | | | | | When using require to load a native addon the path must be converted into a long path, otherwise the addon will fail to be loaded on windows if the path is longer than 260 characters. PR-URL: https://github.com/nodejs/node/pull/2965 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <inglor@gmail.com>
* src: replace usage of v8::Handle with v8::LocalMichaël Zasso2015-09-065-8/+7
| | | | | | | v8::Handle is deprecated: https://codereview.chromium.org/1224623004 PR-URL: https://github.com/nodejs/io.js/pull/2202 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* build: make ci test addons in test/addonsBen Noordhuis2015-08-251-0/+2
| | | | | | | | | | | | Make `make test-addons` part of the `make test-ci` target. Use order-only prerequisites to make generating and building the add-ons concurrency-safe when $JOBS > 1 and fudge the dependency on $(NODE_EXE) so that add-ons are only rebuilt when needed instead of all the time. PR-URL: https://github.com/nodejs/node/pull/2428 Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Rod Vagg <rod@vagg.org>
* test: drop Isolate::GetCurrent() from addon testsBen Noordhuis2015-08-184-9/+9
| | | | | | | | | v8::Isolate::GetCurrent() is not exactly deprecated at this point but its use is strongly discouraged. Update the addon tests so they no longer use it. PR-URL: https://github.com/nodejs/node/pull/2427 Reviewed-By: Trevor Norris <trev.norris@gmail.com>
* test: lint addon testsBen Noordhuis2015-08-184-33/+27
| | | | | | | | | Add files in test/addon to the `make cpplint` rule and fix up existing style issues. Tests scraped from doc/api/addon.md are filtered out because those are predominantly for illustrative purposes. PR-URL: https://github.com/nodejs/node/pull/2427 Reviewed-By: Trevor Norris <trev.norris@gmail.com>
* deps: update v8 to 4.4.63.9Ben Noordhuis2015-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | Upgrade the bundled V8 and update code in src/ and lib/ to the new API. Notable backwards incompatible changes are the removal of the smalloc module and dropped support for CESU-8 decoding. CESU-8 support can be brought back if necessary by doing UTF-8 decoding ourselves. This commit includes https://codereview.chromium.org/1192973004 to fix a build error on python 2.6 systems. The original commit log follows: Use optparse in js2c.py for python compatibility Without this change, V8 won't build on RHEL/CentOS 6 because the distro python is too old to know about the argparse module. PR-URL: https://github.com/nodejs/io.js/pull/2022 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
* test: remove smalloc add-on testBen Noordhuis2015-06-013-48/+0
| | | | | | | | The smalloc module is about to be deprecated and removed. Remove the add-on test now so it's not forgotten about in the upcoming purge. PR-URL: https://github.com/nodejs/io.js/pull/1835 Reviewed-By: Trevor Norris <trev.norris@gmail.com>
* test: add heap profiler add-on regression testBen Noordhuis2015-05-283-0/+47
| | | | | | | Add a regression test for https://github.com/nodejs/io.js/pull/1827. PR-URL: https://github.com/nodejs/io.js/pull/1828 Reviewed-By: Trevor Norris <trev.norris@gmail.com>
* test: fix deprecation warning in addons testBen Noordhuis2015-05-261-1/+1
| | | | | | | | The non-isolate version of node::FatalException() is deprecated, switch to the version that takes an isolate as its first argument. PR-URL: https://github.com/nodejs/io.js/pull/1793 Reviewed-By: Trevor Norris <trev.norris@gmail.com>
* test: enable linting for testsRoman Reiss2015-05-196-3/+9
| | | | | | | | | | | | Enable linting for the test directory. A number of changes was made so all tests conform the current rules used by lib and src directories. The only exception for tests is that unreachable (dead) code is allowed. test-fs-non-number-arguments-throw had to be excluded from the changes because of a weird issue on Windows CI. PR-URL: https://github.com/nodejs/io.js/pull/1721 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* smalloc: extend user APITrevor Norris2015-02-203-0/+47
| | | | | | | | | node::Environment isn't accessible to user APIs, so extend smalloc to also accept v8::Isolate. Fixes: 75adde07 "src: remove `node_isolate` from source" PR-URL: https://github.com/iojs/io.js/pull/905 Reviewed-by: Fedor Indutny <fedor@indutny.com>
* Remove excessive copyright/license boilerplateisaacs2015-01-122-42/+0
| | | | | | | The copyright and license notice is already in the LICENSE file. There is no justifiable reason to also require that it be included in every file, since the individual files are not individually distributed except as part of the entire package.
* node,async-wrap: verify domain enter/exit are setTrevor Norris2014-09-023-0/+119
| | | | | | | | | | | | | The REPL global object lazy loads modules by placing getters for each. This causes MakeDomainCallback() to be run if a native module is loaded from the REPL, but if the domain module hasn't been loaded then there are no enter/exit callbacks to be called. Causing an assert() to fail. Fix the issue by conditionally running the callback instead of asserting it is available. Also add "addon" test to verify the fix. Fixes: #8231 Signed-off-by: Trevor Norris <trev.norris@gmail.com>
* src, test: fix up ObjectWrap, `make test-addons`Ben Noordhuis2014-03-142-5/+10
| | | | | | | | | | V8 was upgraded from 3.22 to 3.24 in commit 1c7bf24. Upgrade source files in test/addons/ and automatically generated tests from doc/api/addons.markdown to the new V8 API. This coincidentally fixes a bug in src/node_object_wrap.h where it was still using the old V8 weak persistent handle interface, which is gone in 3.24.
* addons: build and test examplesFedor Indutny2014-01-225-19/+29
| | | | fix #6910
* test: modify async native test.js to test for #4820Nathan Rajlich2013-02-211-1/+9
|
* test: add an "async-hello-world" native addon testNathan Rajlich2013-02-213-0/+80
|
* addon: Pass module object to NODE_MODULE init functionisaacs2013-01-253-0/+27
| | | | | | | | | | | | | | mainly to allow native addons to export single functions on rather than being restricted to operating on an existing object. Init functions now receive exports as the first argument, like before, but also the module object as the second argument, if they support it. Related to #4634 cc: @rvagg
* test: update addons .gitignoreBen Noordhuis2012-05-241-1/+1
|
* addon: add AtExit() functionBen Noordhuis2012-05-033-0/+52
| | | | | | | Lets native addons register exit hooks that run after the event loop has quit but before the VM is killed. Fixes #3147.
* test: Fix path to require hello-world moduleShigeki Ohtsu2012-03-141-1/+1
|
* Use NODE_MODULE in the hello-world addon example.Nathan Rajlich2012-02-271-4/+2
| | | | Fixes Windows throwing "unknown error" when trying to require the .node file.
* Revert support for isolates.Ben Noordhuis2012-02-063-82/+0
| | | | | | | | | | | | It was decided that the performance benefits that isolates offer (faster spin-up times for worker processes, faster inter-worker communication, possibly a lower memory footprint) are not actual bottlenecks for most people and do not outweigh the potential stability issues and intrusive changes to the code base that first-class support for isolates requires. Hence, this commit backs out all isolates-related changes. Good bye, isolates. We hardly knew ye.
* move isolate V8 functions out of node.ccRyan Dahl2011-12-291-1/+2
|
* Add shared-buffer isolate addon testRyan Dahl2011-12-293-0/+81
|
* Add gitignore file for addon testsRyan Dahl2011-12-211-0/+5
|
* Support addons with gypRyan Dahl2011-12-203-0/+29
Initial pass.