0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

23 Commits

Author SHA1 Message Date
Sakthipriyan Vairamani
612307564b test: make import common as the first line
The `test/common` module has the capability to identify if any variable
is leaked to the global scope and fail the test. So that has to be
imported at the beginning.

PR-URL: https://github.com/nodejs/node/pull/7786
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2016-07-21 16:39:21 -07:00
Rich Trott
85da963dda test: remove non-incremental common.PORT changes
Remove uses of `common.PORT + 1337` where `common.PORT` suffices.

PR-URL: https://github.com/nodejs/node/pull/7055
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Refs: https://github.com/nodejs/node/pull/6990
2016-06-01 19:41:20 -07:00
Rich Trott
ff00a48169 test: improve debug-break-on-uncaught reliability
Running the test through CI reveals unreliability due to a race
condition. These changes mitigate the race condition, but do not
eliminate it.

PR-URL: https://github.com/nodejs/node/pull/6793
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
2016-05-24 13:45:09 -07:00
Rich Trott
5a5b74aad6 test: move test-debugger-debug-brk to sequential
Move test from `test/debugger` to `test/sequential` so that it is
exercised by CI and `make test`.

PR-URL: https://github.com/nodejs/node/pull/6731
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-05-16 13:38:31 -07:00
Rich Trott
9d445bce07 test: fix test-debugger-repl-break-in-module
The line number checks in test-debugger-repl-break-in-module were
checking for line numbers that exceed the total number of lines in the
files that were being inspected. Change the checks to match the actual
files.

PR-URL: https://github.com/nodejs/node/pull/6686
Reviewed-By: Ben Noorhduis <info@bnoordhuis.nl>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2016-05-12 23:01:50 -07:00
Santiago Gimeno
588cfc5cfc test: fix test-debugger-pid
The current format that prints the process PID before the actual
message.

Adapt the test so it also passes on Windows, that emits a different
message from the rest of platforms.

Move the test to parallel.

PR-URL: https://github.com/nodejs/node/pull/6584
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2016-05-11 09:24:02 +02:00
cjihrig
d2eb935177 debugger: display array contents in repl
This commit allows all array properties to be printed except for
"length". Previously, this filter was applied by checking the
type of each property. However, something changed in V8, and
array elements started coming through as numeric strings, which
stopped them from being displayed.

Fixes: https://github.com/nodejs/node/issues/6444
PR-URL: https://github.com/nodejs/node/pull/6448
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2016-05-02 10:18:53 -04:00
Rich Trott
fc8542f1c0 test: fix test-debugger-client.js
Fix long-broken test-debugger-client by adding missing `\r\n\r\n`
separator.

PR-URL: https://github.com/nodejs/node/pull/5851
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-03-24 13:09:05 -07:00
Rich Trott
eb3f04d81d test: remove broken debugger scenarios
`test-debug-break-on-uncaught` was hanging on the domain and parse error
scenarios. These tests are not run in CI and may have been broken
for a very long time.

Refs: https://github.com/nodejs/node/issues/3156
Refs: https://github.com/nodejs/node/commit/c16963b9
PR-URL: https://github.com/nodejs/node/pull/5532
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rod Vagg <r@va.gg>
2016-03-07 11:20:43 -08:00
Michaël Zasso
0ec093cd41 lib,test: remove extra semicolons
PR-URL: https://github.com/nodejs/node/pull/2205
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-01-16 19:54:25 +01:00
Michaël Zasso
d1aabd6264 test: fix style issues after eslint update
Replace var keyword with const or let.

PR-URL: https://github.com/nodejs/io.js/pull/2286
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-01-13 23:16:17 +01:00
Rich Trott
bc39d6a3a6 test: remove unused vars
Remove unused vars in tests

PR-URL: https://github.com/nodejs/node/pull/4536
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-01-05 08:59:58 -08:00
Jackson Tian
b33e9da8f9 debugger: introduce exec method for debugger
In debugger, the usage of `repl` very ugly. I'd like there is a `p`
like gdb. So the `exec` is coming.

Usage:

```
$ ./iojs debug ~/git/node_research/server.js
< Debugger listening on port 5858
connecting to 127.0.0.1:5858 ... ok
break in /Users/jacksontian/git/node_research/server.js:1
> 1 var http = require('http');
  2
  3 http.createServer(function (req, res) {
debug> exec process.title
/Users/jacksontian/git/io.js/out/Release/iojs
debug>
```

And the `repl`:

```
debug> repl
Press Ctrl + C to leave debug repl
> process.title
'/Users/jacksontian/git/io.js/out/Release/iojs'
debug>
(^C again to quit)
```

The enter and leave debug repl is superfluous.

R-URL: https://github.com/nodejs/node/pull/1491
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-11-17 12:11:40 -08:00
Rich Trott
c78091d689 test: load common.js in all tests
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>
2015-10-06 15:11:47 -07:00
Jackson Tian
81029c639a debugger: improve ESRCH error message
When using `iojs debug -p <pid>` with an invalid pid, the debugger
printed an internal error message because it wasn't smart enough
to figure out that the target process didn't exist.  Now it is.

PR-URL: https://github.com/nodejs/io.js/pull/1863
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com>
2015-06-05 05:54:19 +02:00
Rod Vagg
f78c722df5 test: remove hardwired references to 'iojs'
PR-URL: https://github.com/nodejs/io.js/pull/1882
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-06-03 16:53:05 +02:00
Roman Reiss
f29762f4dd test: enable linting for tests
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>
2015-05-19 21:21:27 +02:00
Jackson Tian
a2ea16838f debugger: don't spawn child process in remote mode
When debug in remote mode with host:port or pid, the interface
spawn child process also. If the debugger agent is running, will
get following output:

```
< Error: listen EADDRINUSE :::5858
<     at Object.exports._errnoException (util.js:734:11)
<     at exports._exceptionWithHostPort (util.js:757:20)
<     at Agent.Server._listen2 (net.js:1155:14)
<     at listen (net.js:1181:10)
<     at Agent.Server.listen (net.js:1268:5)
<     at Object.start (_debug_agent.js:21:9)
<     at startup (node.js:68:9)
<     at node.js:799:3
```

This fix won't spawn child process and no more error message was
shown.

When use `iojs debug`, the tip information just like this:

```
Usage: iojs debug script.js
```

This fix will display the advance usage also:

```
Usage: iojs debug script.js
       iojs debug <host>:<port>
       iojs debug -p <pid>
```

Fixes: https://github.com/iojs/io.js/issues/889
PR-URL: https://github.com/iojs/io.js/pull/1282
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-27 17:28:48 +01:00
isaacs
3e1b1dd4a9 Remove excessive copyright/license boilerplate
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.
2015-01-12 15:30:28 -08:00
Fedor Indutny
8398bf9128 debugger: assign Environment to DebugContext too
fix #7517
2014-05-02 22:12:54 +04:00
Timothy J Fontaine
466a9b5c78 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	src/node_zlib.cc
2014-02-17 20:57:53 -08:00
Alexis Campailla
e12e72eb58 debug client: connect after child is ready
We now wait to connect to the debuggee until we know that
its error stream has data, to ensure that the output message
"connecting..... ok" appears after "Debugger listening on port xyz"

I also increased the test timeout to let the more complex
tests finish in time on Windows

This change fixes the following unit tests on Windows:
 test-debugger-repl.js
 test-debugger-repl-term.js
 test-debugger-repl-utf8.js
 test-debugger-repl-restart.js
2014-01-20 09:00:14 -08:00
Timothy J Fontaine
574f71444c test: move debugger repl into own section 2014-01-20 09:00:13 -08:00