Skip to content

Commit

Permalink
Merge pull request #16 from matepek/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
matepek authored Oct 30, 2018
2 parents 9be32c6 + 65931fa commit e6d9ed1
Show file tree
Hide file tree
Showing 29 changed files with 16,334 additions and 845 deletions.
23 changes: 23 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
image:
- Visual Studio 2017

platform:
- x86
- x64

environment:
matrix:
- nodejs_version: LTS
- nodejs_version: Current

install:
- ps: Install-Product node $env:nodejs_version
- node --version
- npm --version
- npm install

build: off

test_script:
- npm run compile
- npm test --silent
28 changes: 25 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
sudo: false

env:
global:
- secure: GnwXBT/tIhfb7dCu2fYOjWxGJ9t9T16Oc36w+vgAPKJ43boDO3xWWUuqb6CL9yQpzH1ZO8M5+twwCt12B0RTeAqIfqKzfFq5V3v9/4DhXi8huUNB3Acv79GbFNSReXyfz+KXth7fA4zO35Rru+/reSXnJZDCrb7bMMN30z5Whe8CnqlINbHocI2UEcb+cjx6J8EGNzzR9OBZbpNdy2kGmq/5buzomZorneiNrI6ap6fZg97ljuwh4VATOqBBhkGWLYOlBVBVWs1Nc7JwwYrEloMp1mB3LxGtn1Ut1zjDPDX4SLOYujAcsuzWcOp0DAwtPi1oc4atnPmCNfPFCtYzCt4hXwSswQkYkJ0jD9jjZomkOSxbq47zTULisj1chGrZiMwJ295cZ7vjnh8FvN5e7KNd4AczUIMIxf0mYGAQYqCajMTTp3S4AzdVd6mXj8x0CJ1p0y1cFHCsK2BLuGbAANfR7oQNfTsChBMhi2uKxgVt0V+ndZ4y+JMTxBkvPoUrdm5ghkTvYdk4mEKDnvxAPmqsstJRaCBBnLNZtkLfrvQW4WB3Z9N0DnnV1z1j6DnceM4GkYOZekOjM8jm5ea/bpLlYm43vW8M5073nM3IfgS+DkZeysSnn0QTvUx96PPSlWCXypo1GVsbKyyKoGkFGhT7Y6FOKJqeMR3M2WHa928=
- secure: K3woraK3efvVQXzn5xtOfAsimcbrXD1HzSNzDQX6gDZazvRN+vhQqNAD6fFg0JA4cSo7+BzQi2rIRqcDxaPjeWflgbhGhyFBc21xxOchIDVBGXhWhdbHuZ+KS7Qn4xQyzJPr6qRHIcPwlJW8c40q/AXqPkhiVgWJZNYNlpuCNNM+xqyM+FKz2jPmHt0mcyv6vcXMP0eeORu5UC2txMIY2Kcpf9xm486tUStB31mzb4zZzOHjYtr3iAkmp8DiypPWepTKm2Eg8dYiAhqaLqQtZjx5HayBGhAD0HQyuiMiHmzqkCJU0xTvSf+Ky3xOMGtb9WboTIotGeh6+8lIZMRrUQn1bFHF0rQ/Ge4aU9KhAmugd1ycppslU7BtHpasa9vgWV9CqGpIg8F8fihOE0ygEaOAwU41hoI9LisH5YHKNqtBOrfM6Pdm+urQC2hL5wA64nOxLTRZZkaDpFWdXN+etaiJ9bmlMrM8qTZ7dz+Rfrpora9DvuMSmm+RX+ETIb1tqtSS3tO7SVhufnqefRoRwBA8EBmhTRnmWyRVqhwQaqeYzVPWTi6s5Rt2uz3d/7h0NdTpEb2YHcd7V3TC9k+c2nALDFPP1LgFP6AScPVoAYmoDSovOwaxfO9LHPgNzikf50Sz5/zeSariib4iYKSFt/waJ6NU2FIvvP8qVlYO568=

language: node_js

node_js:
- "10"
- "8"
- "11"

os:
- osx
Expand All @@ -18,5 +26,19 @@ install:
- npm install
- npm run compile

script:
- npm test --silent
script:
- npm test --silent

#before_deploy:
# - npm install
# - npm run compile
#
#deploy:
# provider: script
# script: node ./out/repo_scripts/deploy.js
# on:
# condition: "$TRAVIS_OS_NAME = osx"
# node_js: "8"
# repo: matepek/vscode-catch2-test-adapter
# branch: master
# tags: false
26 changes: 15 additions & 11 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Deploy",
"program": "${workspaceFolder}/out/repo_scripts/deploy.js"
},
{
"type": "extensionHost",
"request": "launch",
"name": "Catch2 adapter",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out"
]
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/out"],
"preLaunchTask": "npm: watch"
},
{
"name": "Extension Tests",
Expand All @@ -24,10 +27,11 @@
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "npm: watch"
"outFiles": ["${workspaceFolder}/out/test/**/*.js"],
"preLaunchTask": "npm: watch",
"env": {
"C2AVCVA": "c:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat"
}
}
]
}
}
5 changes: 5 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
.appveyor.yml
.travis.yml
.github
src/**
**/*.map
out/test/**
out/repo_scripts
resources/src
package-lock.json
tsconfig.json
.vscode/**
Expand Down
36 changes: 35 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.2.0]
## [2.0.0]

Lot of things new under the hood, but lets talk about the 'API' change.

### Changed ⚠️

- Renamed `defaultExecWatchTimeout` --> `defaultWatchTimeoutSec`.

- Also the unit has changed from milisecond to **second**.

- Renamed `debugConfigurationTemplate` --> `debugConfigTemplate`.
- Renamed `path` property of `executables` --> `pattern`. (Technically `path` still can be used as an alias.)

- Changed behaviour of `path` property of `executables`.
Now it can understand "VSCode patterns". ([Details](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options)) - These work for only path's inside the _workspace directory_. Paths outside of it can be used
with absolute path or with relative to _working directory_ (ex.: `../build/test.exe`), but
without patterns (and without file-watch).

- `*` to match one or more characters in a path segment
- `?` to match on one character in a path segment
- `**` to match any number of path segments, including none
- `{}` to group conditions (e.g. {`**/*.html,**/*.txt`} matches all HTML and text files)
- `[]` to declare a range of characters to match (e.g., `example.[0-9]` to match on example.0, example.1, …)

- File system is watched through the previously mentioned pattern (only inside the _workspace directory_), and
newly created executables will be added autamtically, deleted ones will be removed and changed ones will be refresed.

- Variable substitution has been changed. (See [README.md] for details.)

### Removed 🚫

- Removed `regex` property of `executables`.
- Removed `recursiveRegex` property of `executables`.

## [1.2.0] - 2018-10-24

### Added

Expand Down
93 changes: 58 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# Catch2 Test Explorer for Visual Studio Code
## **Warning**: Version 2 has been released: **API has been changed**.

Update your settings! ([See changelog](CHANGELOG.md) or [configuration below](#Configuration).)

---

## Catch2 Test Explorer for Visual Studio Code

[![Build Status](https://travis-ci.org/matepek/vscode-catch2-test-adapter.svg?branch=master)](https://travis-ci.org/matepek/vscode-catch2-test-adapter)
[![Build status](https://ci.appveyor.com/api/projects/status/p6uuyg21cwxcnlv9/branch/master?svg=true)](https://ci.appveyor.com/project/matepek/vscode-catch2-test-adapter/branch/master)
[![GitHub issues](https://img.shields.io/github/issues/matepek/vscode-catch2-test-adapter.svg)](https://github.com/matepek/vscode-catch2-test-adapter/issues)
[![GitHub license](https://img.shields.io/github/license/matepek/vscode-catch2-test-adapter.svg)](https://github.com/matepek/vscode-catch2-test-adapter/blob/master/LICENSE)
[![Visual Studio Marketplace](https://img.shields.io/vscode-marketplace/d/matepek.vscode-catch2-test-adapter.svg)](https://marketplace.visualstudio.com/items?itemName=matepek.vscode-catch2-test-adapter)
[![Visual Studio Marketplace](https://img.shields.io/vscode-marketplace/v/matepek.vscode-catch2-test-adapter.svg)](https://marketplace.visualstudio.com/items?itemName=matepek.vscode-catch2-test-adapter)


This extension allows you to run your [Catch2 tests](https://github.com/catchorg/Catch2) using the
[Test Explorer for VS Code](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-test-explorer).

Expand All @@ -15,31 +21,50 @@ This adapter doesn't support everything.

## Configuration

| Property | Description |
| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `catch2TestExplorer.executables` | The location of your test executables (relative to the workspace folder or absolute path) and with a lot of other setting. Details: [below](#catch2TestExplorer.executables) |
| `catch2TestExplorer.defaultEnv` | Default environment variables to be set when running the tests, if it isn't provided in 'executables'. (Resolves: ${workspaceFolder}) |
| `catch2TestExplorer.defaultCwd` | The working directory where the test is run (relative to the workspace folder or absolue path), if it isn't provided in 'executables'. (Resolves: ${workspaceFolder}) |
| `catch2TestExplorer.defaultRngSeed` | Specify a seed for the Random Number Generator. For details see [Catch2 documentation](https://github.com/catchorg/Catch2/blob/master/docs/command-line.md#rng-seed) |
| `catch2TestExplorer.defaultExecWatchTimeout` | Test executables are being watched. In case of one compiles too much this variable can help with it. |
| `catch2TestExplorer.workerMaxNumber` | The variable maximize the number of the parallel test execution. |
| `catch2TestExplorer.enableSourceDecoration` | Sets the source code decorations: Errored lines will be highlited. |
| `catch2TestExplorer.debugConfigurationTemplate` | Set the necessary debug configuraitons and the debug button will work. Details: [below](#catch2TestExplorer.debugConfigurationTemplate) |
| `testExplorer.onStart` | (This is part of the [dependency extension](https://github.com/hbenl/vscode-test-explorer#configuration)'s settings.) |
| `testExplorer.onReload` | (This is part of the [dependency extension](https://github.com/hbenl/vscode-test-explorer#configuration)'s settings.) |
| Property | Description |
| ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `catch2TestExplorer.executables` | The location of your test executables (relative to the workspace folder or absolute path) and with a lot of other setting. Details: [below](#catch2TestExplorer.executables) |
| `catch2TestExplorer.defaultEnv` | Default environment variables to be set when running the tests, if it isn't provided in 'executables'. (Resolves: ${workspaceFolder}) |
| `catch2TestExplorer.defaultCwd` | The working directory where the test is run (relative to the workspace folder or absolue path), if it isn't provided in "executables". (Resolves: ${workspaceFolder}) |
| `catch2TestExplorer.defaultRngSeed` | Specify a seed for the Random Number Generator. For details see [Catch2 documentation](https://github.com/catchorg/Catch2/blob/master/docs/command-line.md#rng-seed) |
| `catch2TestExplorer.defaultWatchTimeoutSec` | Test executables are being watched. In case of one compiles too much this variable can help with it. Unit: second. |
| `catch2TestExplorer.workerMaxNumber` | The variable maximize the number of the parallel test execution. |
| `catch2TestExplorer.enableSourceDecoration` | Sets the source code decorations: Errored lines will be highlited. |
| `catch2TestExplorer.debugConfigTemplate` | Set the necessary debug configuraitons and the debug button will work. Details: [below](#catch2TestExplorer.debugConfigTemplate) |
| `testExplorer.onStart` | (This is part of the [dependency extension](https://github.com/hbenl/vscode-test-explorer#configuration)'s settings.) |
| `testExplorer.onReload` | (This is part of the [dependency extension](https://github.com/hbenl/vscode-test-explorer#configuration)'s settings.) |

### catch2TestExplorer.executables

This `catch2TestExplorer.executables` variable can be string, an array of strings, an array of objects or an array of strings and objects.

| Property | | Description |
| ---------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `name` | (optional) | The name of the test suite (file). Can contains `${dirname}`, `${absDirname}`, `${name}` if `regex` is provided. |
| `path` | (requierd) | A relative (to workspace) or an absolute directory- or file-path. If it is a directory, the matching children will be added (see `regex`). |
| `regex` | (optional) | If `path` is a directory all matching children (full path) will be added (if there is no error). |
| `recursiveRegex` | (optional) | If true and `path` is a directory, it will search for the `regex` pattern recursively. |
| `cwd` | (optional) | The current working directory for the test executable. If it isn't provided and `defaultCwd` does, then that will be used. Can contains `${dirname}` and `${absDirname}` if `regex` is provided. |
| `env` | (optional) | Environment variables for the test executable. If it isn't provided and `defaultEnv` does, then that will be used. |
This variable can be string, an array of strings, an array of objects or an array of strings and objects.

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

| Property | | Description |
| --------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name` | (optional) | The name of the test suite (file). Can contains variables. |
| `pattern` | (requierd) | A relative pattern (to workspace) or an absolute file-path. ⚠️__Avoid backslash!__ ([Details](https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options)). Example: `{build,out}/**/test[1-9]*` |
| `path` | (alias) | Alias of `pattern`. |
| `cwd` | (optional) | The current working directory for the test executable. If it isn't provided and `defaultCwd` does, then that will be used. Can contains variables. |
| `env` | (optional) | Environment variables for the test executable. If it isn't provided and `defaultEnv` does, then that will be used. Can contains variables. |

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

| Variable | Description |
| ----------------------- | ------------------------------------------------------------------------------- |
| `${absPath}` | Absolute path of the test executable |
| `${relPath}` | Relative path of the test executable to the workspace folder |
| `${absDirpath}` | Absolute path of the test executable's parent directory |
| `${relDirpath}` | Relative path of the test executable's parent directory to the workspace folder |
| `${filename}` | Filename ( = Path withouth directories, "d/a.b.c" => "a.b.c") |
| `${baseFilename}` | Filename without extension ("d/a.b.c" => "a.b") |
| `${extFilename}` | Filename extension. ("d/a.b.c" => ".c") |
| `${base2Filename}` | Filename without extension ("d/a.b.c" => "a") |
| `${ext2Filename}` | Filename's second level extension. ("d/a.b.c" => ".b") |
| `${base3Filename}` | Filename without extension ("d/a.b.c" => "a") |
| `${ext3Filename}` | Filename's second level extension. ("d/a.b.c" => "") |
| `${workspaceDirectory}` | (You can only guess one.) |
| `${workspaceFolder}` | Alias of `${workspaceDirectory}` |

Examples:

Expand All @@ -53,34 +78,32 @@ Examples:

```json
"catch2TestExplorer.executables": {
"name": "${dirname} : ${name}",
"path": "./build",
"regex": "(t|T)est",
"name": "${relName} (${relDirname}/)",
"path": "{build,Build,BUILD,out,Out,OUT}/**/*{test,Test,TEST}*",
"cwd": "${absDirname}",
"env": {}
"env": {
"ExampleENV1": "You can use variables here too, like ${absName}"
}
}
```

```json
"catch2TestExplorer.executables": [
{
"name": "Test1 suite",
"path": "dir/test.exe",
"cwd": ".",
"env": {}
"path": "dir/test.exe"
},
"singleTest.exe",
{
"path": "dir2",
"regex": "(t|T)est",
"recursiveRegex": false,
"cwd": ".",
"regex": "{t,T}est",
"cwd": "out/tmp",
"env": {}
}
]
```

### catch2TestExplorer.debugConfigurationTemplate
### catch2TestExplorer.debugConfigTemplate

For help, see: [here](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations)

Expand Down
Loading

0 comments on commit e6d9ed1

Please sign in to comment.