Skip to content

Commit 7ec43fc

Browse files
Add docs on generating stubs
Signed-off-by: Sanjula Ganepola <Sanjula.Ganepola@ibm.com>
1 parent d8ae9a8 commit 7ec43fc

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed
385 KB
Loading
473 KB
Loading

src/content/docs/developing/testing/overview.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { Aside, CardGrid, Card } from '@astrojs/starlight/components';
1717

1818
The [IBM i Testing](https://marketplace.visualstudio.com/items?itemName=IBM.vscode-ibmi-testing) extension allows developers to run unit tests and generate code coverage results for RPG and COBOL programs on IBM i. Under the covers, this extension leverages the [RPGUnit](https://irpgunit.sourceforge.io/help) testing framework.
1919

20+
* ✍️ **Generate Stubs**: Generate test stubs for individual test cases or an entire test suite.
2021
* 👨‍💻 **Run Tests**: Visualize and run tests suites out of local files or source members.
2122
* ⚙️ **Configure Tests**: Configure parameters to compile (`RUCRTRPG`/`RUCRTCLB`) and run (`RUCALLTST`) tests.
2223
* 📋 **View Test Results**: View detailed test results along with inline failure/error messages.

src/content/docs/developing/testing/writing.mdx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Writing Tests
44

55
import { Aside, CardGrid, Card, Tabs, TabItem } from '@astrojs/starlight/components';
66

7-
## Naming Conventions
7+
## Naming Requirements
88

99
### Test Cases
1010

@@ -111,7 +111,15 @@ In order to use RPGUnit procedures you need to add the `TESTCASE` copybook to yo
111111
</TabItem>
112112
</Tabs>
113113

114-
## Generating Stubs
114+
## Generating Test Stubs
115+
116+
To simplify the process of writing tests, you can have the extension generate stubs for individual test cases or an entire test suite. To do this, place your cursor inside any export procedure and click the code action button (💡). This will give you an option to generate a test case for the specific procedure you are in or to generate a test suite containing test cases for every procedure.
117+
118+
![Generating Test Stubs](Testing_GeneratingTestStubs.png)
119+
120+
After selecting an option, a test suite will be created if it does not already exist with a scaffold that will include not only the test case stubs, but also the necessary includes and prototypes (if necessary). The generated test case stubs themselves will each be structured into the following sections: declarations, inputs, actual results, expected results, and assertions. As the developer, you will need to fill in the inputs and expected results.
121+
122+
![Generated Test Stub](Testing_GeneratedTestStub.png)
115123

116124
## Example Test Suites
117125

@@ -120,5 +128,5 @@ To get started with some sample tests, check out these examples:
120128
* RPGUnit [templates](https://github.com/tools-400/irpgunit/tree/main/host/iRPGUnit/QTEMPLATE) and [self tests](https://github.com/tools-400/irpgunit/tree/main/host/iRPGUnit/QTESTCASES)
121129

122130
<Aside type="tip">
123-
If you have example tests that you would like to share with the community, please open a pull request [here](https://github.com/codefori/docs) to add them to this page.
131+
🙏 If you have example tests that you would like to share with the community, please open a pull request [here](https://github.com/codefori/docs) to add them to this list!
124132
</Aside>

0 commit comments

Comments
 (0)