You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/documentation/testing.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,13 +17,15 @@ To restrict to a given range, use the `--from` (`-f`) and `--to` (`-t`) options.
17
17
18
18
### Creating Tests
19
19
20
-
To (re)generate *golden files*, append the `-g` (i.e `--generate`) option:
20
+
To (re)generate *golden files*, append the `--generate` option:
21
21
```console
22
-
$ ./mfc.sh test -g -j 8
22
+
$ ./mfc.sh test --generate -j 8
23
23
```
24
24
25
25
It is recommended that a range be specified when generating golden files for new test cases, as described in the previous section, in an effort not to regenerate the golden files of existing test cases.
26
26
27
+
**Note:** If you output new variables and want to update the golden files to include these without modifying the original data, use the `--add-new-variables` option instead.
28
+
27
29
Adding a new test case can be done by modifying [cases.py](https://github.com/MFlowCode/MFC/tree/master/toolchain/mfc/test/cases.py). The function `generate_cases` is responsible for generating the list of test cases. Loops and conditionals are used to vary parameters, whose defaults can be found in the `BASE_CFG` case object within [case.py](https://github.com/MFlowCode/MFC/tree/master/toolchain/mfc/test/case.py). The function operates on two variables:
28
30
29
31
-`stack`: A stack that holds the variations to the default case parameters. By pushing and popping the stack inside loops and conditionals, it is easier to nest test case descriptions, as it holds the variations that are common to all future test cases within the same indentation level (in most scenarios).
test.add_argument("-r", "--relentless", action="store_true", default=False, help="Run all tests, even if multiple fail.")
73
72
test.add_argument("-a", "--test-all", action="store_true", default=False, help="Run the Post Process Tests too.")
73
+
74
74
test.add_argument("--case-optimization", action="store_true", default=False, help="(GPU Optimization) Compile MFC targets with some case parameters hard-coded.")
75
+
76
+
test_meg=test.add_mutually_exclusive_group()
77
+
test_meg.add_argument("--generate", action="store_true", default=False, help="(Test Generation) Generate golden files.")
78
+
test_meg.add_argument("--add-new-variables", action="store_true", default=False, help="(Test Generation) If new variables are found in D/ when running tests, add them to the golden files.")
0 commit comments