Skip to content

Commit 9c71ae5

Browse files
committed
update readme
1 parent 8c4c570 commit 9c71ae5

2 files changed

Lines changed: 52 additions & 12 deletions

File tree

tests/regression/ba-issues/README.md

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22

33
For how to add a new test case, you should refer to following steps:
44

5-
1. [Creating directories for new issue test cases](#helper-shell-script)
6-
2. If the new issue test cases require new CMake build config of `warmc`/`iwasm` rather than existing ones, modify [build script](#warmc-and-iwasm-build-script) for new build config
7-
3. Add [running configuration](#add-a-new-configuration-for-how-to-run-your-issue-test-case) for the new issue test cases
8-
4. [Running tests and check test results](#running-test-cases-and-getting-results)
5+
- [BA Issues](#ba-issues)
6+
- [helper shell script](#helper-shell-script)
7+
- [`warmc` and `iwasm` build script](#warmc-and-iwasm-build-script)
8+
- [Add a new configuration for how to run your issue test case](#add-a-new-configuration-for-how-to-run-your-issue-test-case)
9+
- [Here is a simply running configuration that only uses `iwasm`](#here-is-a-simply-running-configuration-that-only-uses-iwasm)
10+
- [Here is a simply running configuration that uses only `wamrc`](#here-is-a-simply-running-configuration-that-uses-only-wamrc)
11+
- [Here is a simply running configuration that uses both `wamrc` and `iwasm`](#here-is-a-simply-running-configuration-that-uses-both-wamrc-and-iwasm)
12+
- [For deprecated issue test cases](#for-deprecated-issue-test-cases)
13+
- [Running test cases and getting results](#running-test-cases-and-getting-results)
914

1015
## helper shell script
1116

@@ -218,22 +223,57 @@ simply run `run.py`
218223
./run.py
219224
```
220225

226+
Specify a specific issue with option `--issues`/`-i`
227+
228+
```shell
229+
./run.py --issues 2833 # test 1 issue #2833
230+
./run.py -i 2833,2834,2835 # test 3 issues #2833 #2834 #2835
231+
```
232+
221233
If everything went well, you should see similarly output in your command line output
222234

223235
```shell
224-
Finish testing, 22/22 of test cases passed, no more issues should further test
236+
==== Test results ====
237+
Total: 22
238+
Passed: 22
239+
Failed: 0
240+
Left issues in folder: no more
241+
Cases in JSON but not found in folder: no more
225242
```
226243

227244
If you add the test case under directory `issues` but forget to add the running config in json file, the output can be something like
228245

229246
```shell
230-
Finish testing, 21/21 of test cases passed, {2945} issue(s) should further test
247+
==== Test results ====
248+
Total: 21
249+
Passed: 21
250+
Failed: 0
251+
missed: 0
252+
Left issues in folder: {3022}
253+
Cases in JSON but not found in folder: no more
254+
```
255+
256+
If you add the test case in `running_config.json` but used the wrong id or forget to add the test case under directory `issues`, the output can be someting like
257+
258+
```shell
259+
==== Test results ====
260+
Total: 21
261+
Passed: 21
262+
Failed: 0
263+
missed: 0
264+
Left issues in folder: {2855}
265+
Cases in JSON but not found in folder: {100000}
231266
```
232267

233268
If some test case are failing, then it will be something like
234269

235270
```shell
236-
Finish testing, 21/22 of test cases passed, no more issue(s) should further test
271+
==== Test results ====
272+
Total: 22
273+
Passed: 21
274+
Failed: 1
275+
Left issues in folder: no more
276+
Cases in JSON but not found in folder: no more
237277
```
238278

239279
And a log file named `issues_tests.log` will be generated and inside it will display the details of the failing cases, for example:

tests/regression/ba-issues/run.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def process_and_run_test_cases(
205205

206206
passed_ids = set()
207207
failed_ids = set()
208-
missed_ids = set()
208+
json_only_ids = set()
209209

210210
# Iterate through each test case in the json data
211211
for test_case in data.get("test cases", []):
@@ -220,7 +220,7 @@ def process_and_run_test_cases(
220220

221221
for issue_id in issue_ids:
222222
if issue_id not in issue_ids_should_test:
223-
missed_ids.add(issue_id)
223+
json_only_ids.add(issue_id)
224224
continue
225225

226226
# cross out the this issue_id in the should test set
@@ -254,17 +254,17 @@ def process_and_run_test_cases(
254254
total = len(passed_ids) + len(failed_ids)
255255
passed = len(passed_ids)
256256
failed = len(failed_ids)
257-
missed = len(missed_ids)
258257
issue_ids_should_test = (
259258
issue_ids_should_test if issue_ids_should_test else "no more"
260259
)
260+
json_only_ids = json_only_ids if json_only_ids else "no more"
261261
print(f"####################################")
262262
print(f"==== Test results ====")
263263
print(f" Total: {total}")
264264
print(f" Passed: {passed}")
265265
print(f" Failed: {failed}")
266-
print(f" missed: {missed}")
267-
print(f" Left Issues: {issue_ids_should_test}")
266+
print(f" Left issues in folder: {issue_ids_should_test}")
267+
print(f" Cases in JSON but not found in folder: {json_only_ids}")
268268

269269

270270
def main():

0 commit comments

Comments
 (0)