Commit e29c02d
authored
Clean up the test harness a bit (#55)
Primarily, this gets rid of the `test/runtest` executable, preventing
the need for spawning an additional subprocess for each test. The
current approach handles all the things that `test/runtest` would in a
`--require` and in a loader that switches whether or not to use the IITM
loader via the same filename check that was originally done in
`test/runtest`.
One interesting thing that happened while making this change is that we
need some way of passing the entrypoint filename to the loader. Since
newer versions of Node.js run the loader in a separate thread,
`process.argv[1]` no longer works. The approved alternative is to use
inter-thread messages via the `register()` method, but that's not
available on some versions of Node.js that also use loader threads. To
get around this, an environment variable is set in the `--require`
that's then propagated to the loader thread. This is a bit hacky, but
probably the only thing that will work across the supported version
range.
An attempt was made to use the more popular `tap` test package, rather
than `imhotap`, but there's no version of `tap` that supports both the
entire Node.js version range that IITM supports _and_ also supports ESM.
For now, this means sticking with `imhotap`, but were it not for the
incompatibility, `tap` would be just as suitable here, and is a much
more popular test package.1 parent 6f4aa45 commit e29c02d
5 files changed
Lines changed: 57 additions & 54 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | | - | |
8 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | | - | |
13 | | - | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
0 commit comments