Skip to content

Commit

Permalink
Merge pull request #83 from matepek/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
matepek authored Apr 2, 2019
2 parents 3a77d77 + aea74e6 commit 4749423
Show file tree
Hide file tree
Showing 16 changed files with 212 additions and 143 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ before_install:

install:
- npm install
- npm audit
- npm audit || npm audit
- npm run compile

script:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.4.1]

### Added

- `executables`'s `dependOn` (type: _string[]_) property is no longer experimental.
Be careful with it. It eats [file descriptors](https://en.wikipedia.org/wiki/File_descriptor) and defecates test executions.
- section result stat to description and tooltip.

## [2.4.0] - 2019-03-25

### Added
Expand Down
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ This variable can be

If it is an object it can contains the following properties:

| Property | Description |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name` | The name of the test suite (file). Can contains variables related to `pattern`. |
| `pattern` | A relative (to workspace directory) or an absolute path or [_glob pattern_](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options). ⚠️**Avoid backslash!**: 🚫`\`; ✅`/`; (required) |
| `description` | A less prominent text after the `name`. Can contains variables related to `pattern`. |
| `cwd` | The current working directory for the test executable. If it isn't provided and `defaultCwd` does, then that will be used. Can contains variables related to `pattern`. |
| `env` | Environment variables for the test executable. If it isn't provided and `defaultEnv` does, then that will be used. Can contains variables related to `pattern`. |
| `dependsOn` | (Experimental) Array of _paths_ / [_glob pattern_](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options) (string[]). If a related file is _changed/created/deleted_ it will run the related executables. |
| Property | Description |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name` | The name of the test suite (file). Can contains variables related to `pattern`. |
| `pattern` | A relative (to workspace directory) or an absolute path or [_glob pattern_](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options). ⚠️**Avoid backslash!**: 🚫`\`; ✅`/`; (required) |
| `description` | A less prominent text after the `name`. Can contains variables related to `pattern`. |
| `cwd` | The current working directory for the test executable. If it isn't provided and `defaultCwd` does, then that will be used. Can contains variables related to `pattern`. |
| `env` | Environment variables for the test executable. If it isn't provided and `defaultEnv` does, then that will be used. Can contains variables related to `pattern`. |
| `dependsOn` | Array of (relative / absolute) _paths_ / [_glob pattern_](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options) (string[]). If a related file is _changed/created/deleted_ and autorun is enabled in "..." menu it will run the related executables. |

The `pattern` (or the `executables` used as string or an array of strings)
can contains [_search-pattern_](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options).
Expand All @@ -76,10 +76,14 @@ If the pattern is too general like `out/**/*test*`, it could cause unexpected ex
which would not just increase the test-loading duration but also could have other unexpeced effects.
I suggest to have a stricter file-name convention and a corresponding pattern like `out/**/*.test.*` or `out/**/Test.*`

**Remark** that `dependsOn` is experimental and **only** works well with paths **inside** of the workspace directory.
Also note that if it is set, it will run the related tests automatically.
**Note** that `dependsOn` **only** works well with paths/patterns **inside** of the workspace directory.
If "Enable autorun" is enabled in "**...**" menu (next to the play button), it will trigger the related tests.
It accumulates events by waiting for 2 seconds after the last event.

**Also** `dependsOn` cannot contain variables like the others and outside of the workspace directory it works with only existing directory.
So if one `dependsOn` a file which is deleted, the related tests will be triggered once, but re-reation won't trigger it agian.
(It is harder to find a suitable fswatcher than I thought. Tried: chokidar, gaze)

#### Variables which can be used in `name`, `cwd` and `env` of `executables`:

| Variable | Description |
Expand Down Expand Up @@ -198,12 +202,14 @@ Note that `name` and `request` are filled, if they are undefined, so it is not n
- (2018-09-03) On windows the navigate to source button isn't working. It is a framework bug.
- (2018-11-17) Catch2: Long (>80 character) filename, test-name or description can cause test-list parsing failures.
Workaround: `#define CATCH_CONFIG_CONSOLE_WIDTH 300`
- (2019-04-02) `dependsOn` limitation: See `dependsOn`.

For solving issues use: `catch2TestExplorer.logpanel: true` and check the output window.

## TODOs

- Test cases: google test, catch2: info, warn, fail, stdout, stderr, capture, gtest_skip
- gaze is not good enough: detects change and delete, but not creation
- `dependsOn` could contain variables

## [Contribution guideline here](CONTRIBUTING.md)
65 changes: 35 additions & 30 deletions package-lock.json

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

Loading

0 comments on commit 4749423

Please sign in to comment.