Skip to content

Commit

Permalink
Add lldb debug integration tests config, upgrade mocha to prevent chi…
Browse files Browse the repository at this point in the history
…ld process being spawned (realm#4085)

* Add lldb debug integration tests config, upgrade mocha to prevent child process being spawned

* Add .mocharc.json to use ts-node
  • Loading branch information
tomduncalf committed Nov 17, 2021
1 parent 61cc7ec commit 6b127df
Show file tree
Hide file tree
Showing 5 changed files with 1,023 additions and 534 deletions.
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,24 @@
],
"cwd": "${workspaceFolder}/tests"
},
{
"type": "lldb",
"request": "launch",
"name": "LLDB Debug Integration Tests",
"program": "node",
"args": [
"--expose_gc",
"node_modules/mocha/bin/mocha",
"--require",
"ts-node/register/transpile-only",
"--require",
"src/utils/inject-node-globals.ts",
"src/index.ts",
"--grep",
"${input:integrationTestFilter}"
],
"cwd": "${workspaceFolder}/integration-tests/tests"
}
],
"compounds": [
{
Expand All @@ -112,6 +130,12 @@
"type": "promptString",
"default": ".",
"description": "Filtering used to limit what tests are run"
},
{
"id": "integrationTestFilter",
"type": "promptString",
"default": "",
"description": "Filtering used to limit what tests are run"
}
]
}
6 changes: 6 additions & 0 deletions integration-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ When running the environments individually the test suite's TypeScript is not au
npm run build:watch --prefix tests
```

## Running tests with a C++ debugger attached

In order to debug the tests with `lldb` attached to debug C++, you can use the VS Code launch configuration `LLDB Debug Integration Tests`.

This bypasses the usual startup script (as this spawns a child process for the tests, which stops `lldb` working), so you need to have the app importer running separately when doing this: `npm run app-importer` from the `integration-tests/tests` directory.

---

## Maintaining the tests
Expand Down
4 changes: 4 additions & 0 deletions integration-tests/tests/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extension": ["ts"],
"require": ["ts-node/register/transpile-only", "src/utils/inject-node-globals.ts"]
}
Loading

0 comments on commit 6b127df

Please sign in to comment.