-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dipto Pandit (dipandit)
committed
Jan 28, 2021
1 parent
adef54a
commit 1d30d58
Showing
8 changed files
with
75 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,15 @@ | ||
# Example Test Adapter for Visual Studio Code | ||
# Snort3 Test Explorer for Visual Studio Code | ||
|
||
This repository contains an example for implementing a `TestAdapter` extension that works with the | ||
[Test Explorer](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-test-explorer) extension. | ||
|
||
More documentation can be found in the [Test Adapter API repository](https://github.com/hbenl/vscode-test-adapter-api). | ||
Snort3 Test Explorer is a visual studio code extension that lets you run snort3 tests in the Sidebar of Visual Studio Code. This extention will activate when there is a snort3_test folder open in the workspace and automatically list all the tests available in the [Test Explorer](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-test-explorer) side bar. | ||
|
||
## Setup | ||
|
||
* install the [Test Explorer](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-test-explorer) extension | ||
* fork and clone this repository and open it in VS Code | ||
* run `npm install` | ||
* run `npm run watch` or start the watch Task in VS Code | ||
* start the debugger | ||
* install the [Snort3 Test Explorer](https://marketplace.visualstudio.com/items?itemName=diptopandit.snort3-test-adapter) extension | ||
* open extension settings | ||
* set sf_prefix_snort3 to snort install path | ||
* set snort_srcpath to snort source code path | ||
* set dependencies to dependencies (libdaq, abcip, cpputest etc.) installation path | ||
|
||
You should now see a second VS Code window, the Extension Development Host. | ||
Open a folder in this window and click the "Test" icon in the Activity bar. | ||
Now you should see the fake example test suite in the side panel: | ||
You should now see a tree view of all the tests in the side panel: | ||
|
||
![The fake example test suite](img/fake-tests.png) | ||
|
||
## Basic implementation | ||
|
||
* add any configuration properties that your Test Adapter needs to the `contributes.configuration.properties` section of `package.json` | ||
* replace the `loadFakeTests()` call in `src/adapter.ts` with your code for loading the test definitions for the real test framework | ||
* replace the `runFakeTests()` call in `src/adapter.ts` with your code for running the tests in a child process using the real test framework | ||
|
||
## Getting ready to publish | ||
|
||
* search for all occurrences of the word "example" in this project and replace them with the name of the testing framework that your Test Adapter supports | ||
* update `package.json` with your preferred values (at a minimum you should change `author`, `publisher`, `homepage`, `repository` and `bugs`) | ||
* create an icon for your Test Adapter (there's an SVG version of the Test Explorer icon at `img/test-explorer.svg`) and reference it in `package.json` | ||
* replace this README with your documentation | ||
|
||
Now you're ready to [publish](https://code.visualstudio.com/docs/extensions/publish-extension) the first version of your Test Adapter. | ||
|
||
## Completing the implementation | ||
|
||
* implement the `debug()` method | ||
* implement the `cancel()` method (it should kill the child process that was started by `run()` or `debug()`) | ||
* watch the configuration for any changes that may affect the loading of test definitions and reload the test definitions if necessary | ||
* watch the workspace for any changes to the test files and reload the test definitions if necessary | ||
* watch the configuration for any changes that may affect the results of running the tests and emit an `autorun` event if necessary | ||
* watch the workspace for any changes to the source files and emit an `autorun` event if necessary | ||
* ensure that only one test run is active at a time |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters