testitpy 0.4__tar.gz → 0.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. {testitpy-0.4/src/testitpy.egg-info → testitpy-0.5}/PKG-INFO +10 -6
  2. {testitpy-0.4 → testitpy-0.5}/README.md +9 -5
  3. {testitpy-0.4 → testitpy-0.5}/docs/index.md +85 -22
  4. {testitpy-0.4 → testitpy-0.5}/pyproject.toml +1 -1
  5. {testitpy-0.4 → testitpy-0.5}/src/testit/main.py +17 -2
  6. {testitpy-0.4 → testitpy-0.5}/src/testit/run.py +120 -53
  7. {testitpy-0.4 → testitpy-0.5}/src/testit/run_util.py +88 -26
  8. {testitpy-0.4 → testitpy-0.5}/src/testit/templates/config.test +4 -2
  9. {testitpy-0.4 → testitpy-0.5}/src/testit/templates/testit_golden.py +1 -1
  10. {testitpy-0.4 → testitpy-0.5}/src/testit/testit.py +258 -228
  11. {testitpy-0.4 → testitpy-0.5}/src/testit/testit_util.py +40 -12
  12. {testitpy-0.4 → testitpy-0.5/src/testitpy.egg-info}/PKG-INFO +10 -6
  13. {testitpy-0.4 → testitpy-0.5}/src/testitpy.egg-info/SOURCES.txt +2 -1
  14. testitpy-0.5/tests/test_campaign_seed.py +268 -0
  15. {testitpy-0.4 → testitpy-0.5}/.github/workflows/release.yml +0 -0
  16. {testitpy-0.4 → testitpy-0.5}/.gitignore +0 -0
  17. {testitpy-0.4 → testitpy-0.5}/LICENSE +0 -0
  18. {testitpy-0.4 → testitpy-0.5}/docs/_config.yml +0 -0
  19. {testitpy-0.4 → testitpy-0.5}/docs/images/testit_structure.png +0 -0
  20. {testitpy-0.4 → testitpy-0.5}/setup.cfg +0 -0
  21. {testitpy-0.4 → testitpy-0.5}/src/testit/__init__.py +0 -0
  22. {testitpy-0.4 → testitpy-0.5}/src/testitpy.egg-info/dependency_links.txt +0 -0
  23. {testitpy-0.4 → testitpy-0.5}/src/testitpy.egg-info/entry_points.txt +0 -0
  24. {testitpy-0.4 → testitpy-0.5}/src/testitpy.egg-info/requires.txt +0 -0
  25. {testitpy-0.4 → testitpy-0.5}/src/testitpy.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: testitpy
3
- Version: 0.4
3
+ Version: 0.5
4
4
  Summary: A tool for verifying RTL and FPGA models using custom SW applications
5
5
  Author-email: Tommaso Terzano <tommaso.terzano@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -691,6 +691,11 @@ Dynamic: license-file
691
691
 
692
692
  # Just TestIt!
693
693
 
694
+ <p align="center">
695
+ <img src="https://github.com/user-attachments/assets/2742f7fa-ac6b-46e5-bdfa-09131c2f9ccc" alt="logo" width="400" />
696
+ </p>
697
+
698
+
694
699
  TestIt is a python package designed to **automate full-system integration testing** using a **Software-Based Self-Test (SBST)** approach.
695
700
  While formal verification methods are highly effective for targeting individual components, their complexity grows exponentially with the size of the System-Under-Test (SUT), making them impractical for testing large scale systems, like MCUs.
696
701
  Furthermore, they do not test interactions between the hardware platform and the software stack, which is essential for validating real-world functionality.
@@ -707,13 +712,13 @@ TestIt tackles these limitations and to **bridge the gap** between **formal veri
707
712
 
708
713
  #### How can TestIt do all of this?
709
714
  With just three requirements:
710
- - A simple **configuration file**, `config.test`, in which you have to describe both *your workflow* and the *tests* you want to run.
711
- - A **python module**, `testit_golden.py`, in which you can develop the *golden functions* used to generate the reference values for your test.
712
- - A complete **Makefile-based workflow**, with some custom targets, as described below. This is the *gateway* that TestIt uses to access your workflow to build, compile and load.
715
+ - A simple **configuration file**, `testit/config/config.test` by default, in which you have to describe both *your workflow* and the *tests* you want to run.
716
+ - A **python module**, `testit/testit_golden.py`, in which you can develop the *golden functions* used to generate the reference values for your test.
717
+ - A complete **Makefile-based workflow**, with the [required Make targets](docs/index.md#makefile-targets). This is the *gateway* that TestIt uses to access your workflow to build, compile and load.
713
718
 
714
719
  #### How can you use TestIt?
715
720
  Again, very simple! Just go to TestIt's documentation at https://vlsi-lab.github.io/TestIt/.
716
- If you have any question or suggestions, just contact Tommaso Terzano at tommaso.terzano@gmail.com.
721
+ If you have any question or suggestions, just contact Tommaso Terzano at tommaso.terzano@epfl.ch.
717
722
  He will be glad to connect with you and help you with any doubt you might have.
718
723
 
719
724
  ## Installation
@@ -750,4 +755,3 @@ options:
750
755
  [![Downloads](https://img.shields.io/badge/dynamic/json.svg?label=downloads&url=https%3A%2F%2Fpypistats.org%2Fapi%2Fpackages%2Ftestitpy%2Frecent&query=data.last_month&colorB=brightgreen&suffix=%2FMonth)](https://pypistats.org/packages/testitpy) [![PyPi package](https://img.shields.io/badge/PyPi%20package-blue?style=flat&logo=https://pypi.org/static/images/logo-small.8998e9d1.svg&link=https://pypi.org/project/testitpy/)](https://pypi.org/project/testitpy/) [![gitHub](https://img.shields.io/badge/gitHub-green?style=flat&link=https://github.com/vlsi-lab/TestIt)](https://github.com/vlsi-lab/TestIt)
751
756
 
752
757
  ---
753
-
@@ -1,5 +1,10 @@
1
1
  # Just TestIt!
2
2
 
3
+ <p align="center">
4
+ <img src="https://github.com/user-attachments/assets/2742f7fa-ac6b-46e5-bdfa-09131c2f9ccc" alt="logo" width="400" />
5
+ </p>
6
+
7
+
3
8
  TestIt is a python package designed to **automate full-system integration testing** using a **Software-Based Self-Test (SBST)** approach.
4
9
  While formal verification methods are highly effective for targeting individual components, their complexity grows exponentially with the size of the System-Under-Test (SUT), making them impractical for testing large scale systems, like MCUs.
5
10
  Furthermore, they do not test interactions between the hardware platform and the software stack, which is essential for validating real-world functionality.
@@ -16,13 +21,13 @@ TestIt tackles these limitations and to **bridge the gap** between **formal veri
16
21
 
17
22
  #### How can TestIt do all of this?
18
23
  With just three requirements:
19
- - A simple **configuration file**, `config.test`, in which you have to describe both *your workflow* and the *tests* you want to run.
20
- - A **python module**, `testit_golden.py`, in which you can develop the *golden functions* used to generate the reference values for your test.
21
- - A complete **Makefile-based workflow**, with some custom targets, as described below. This is the *gateway* that TestIt uses to access your workflow to build, compile and load.
24
+ - A simple **configuration file**, `testit/config/config.test` by default, in which you have to describe both *your workflow* and the *tests* you want to run.
25
+ - A **python module**, `testit/testit_golden.py`, in which you can develop the *golden functions* used to generate the reference values for your test.
26
+ - A complete **Makefile-based workflow**, with the [required Make targets](docs/index.md#makefile-targets). This is the *gateway* that TestIt uses to access your workflow to build, compile and load.
22
27
 
23
28
  #### How can you use TestIt?
24
29
  Again, very simple! Just go to TestIt's documentation at https://vlsi-lab.github.io/TestIt/.
25
- If you have any question or suggestions, just contact Tommaso Terzano at tommaso.terzano@gmail.com.
30
+ If you have any question or suggestions, just contact Tommaso Terzano at tommaso.terzano@epfl.ch.
26
31
  He will be glad to connect with you and help you with any doubt you might have.
27
32
 
28
33
  ## Installation
@@ -59,4 +64,3 @@ options:
59
64
  [![Downloads](https://img.shields.io/badge/dynamic/json.svg?label=downloads&url=https%3A%2F%2Fpypistats.org%2Fapi%2Fpackages%2Ftestitpy%2Frecent&query=data.last_month&colorB=brightgreen&suffix=%2FMonth)](https://pypistats.org/packages/testitpy) [![PyPi package](https://img.shields.io/badge/PyPi%20package-blue?style=flat&logo=https://pypi.org/static/images/logo-small.8998e9d1.svg&link=https://pypi.org/project/testitpy/)](https://pypi.org/project/testitpy/) [![gitHub](https://img.shields.io/badge/gitHub-green?style=flat&link=https://github.com/vlsi-lab/TestIt)](https://github.com/vlsi-lab/TestIt)
60
65
 
61
66
  ---
62
-
@@ -16,9 +16,9 @@ TestIt tackles these limitations and aims at **bridging the gap** between **form
16
16
 
17
17
  #### How can TestIt do all of this?
18
18
  With just three requirements:
19
- - A simple **configuration file**, `config.test`, in which you have to describe both *your workflow* and the *tests* you want to run.
20
- - A **python module**, `testit_golden.py`, in which you can develop the *golden functions* used to generate the reference values for your test.
21
- - A complete **Makefile-based workflow**, with some custom targets, as described below. This is the *gateway* that TestIt uses to access your workflow to build, compile and load.
19
+ - A simple **configuration file**, `testit/config/config.test` by default, in which you have to describe both *your workflow* and the *tests* you want to run.
20
+ - A **python module**, `testit/testit_golden.py`, in which you can develop the *golden functions* used to generate the reference values for your test.
21
+ - A complete **Makefile-based workflow**, with the [required Make targets](#makefile-targets). This is the *gateway* that TestIt uses to access your workflow to build, compile and load.
22
22
 
23
23
  #### How can you use TestIt?
24
24
  Again, it's super simple! Just follow this documentation and you'll find plenty of useful tips to integrate TestIt into your project.
@@ -47,7 +47,7 @@ In order to run TestIt and take full advantage of its features, it's important t
47
47
 
48
48
  - **How does TestIt interact with my RTL project?**
49
49
  TestIt uses Make as a gateway to tap into your RTL project's workflow. We considered several approaches, but chose Make because it’s the most popular scripting tool in open-source RTL projects. And if your project doesn’t already use a Makefile, don’t worry, Make is so flexible and simple that you can easily integrate it into your workflow. Just note that TestIt does require you to add a few standardized targets to your Makefile.
50
- Check out section xx for more details and examples.
50
+ See [Makefile targets](#makefile-targets) for their names, arguments, and responsibilities.
51
51
 
52
52
  - **What does Software-Based Self-Test mean?**
53
53
  _SBST_ is a testing approach where software applications (_Software-Based_) run directly on your target system to verify specific units, without needing any external equipment (_Self-Test_). Essentially, the application checks its own functionality for you.
@@ -63,15 +63,15 @@ In order to run TestIt and take full advantage of its features, it's important t
63
63
  Pretty neat, right?
64
64
 
65
65
  - **How can TestIt generate random input datasets?**
66
- TestIt creates a unique dataset for every test iteration based on your specifications in the _test_ field of `config.test`. There, you define the size, dimensions, and data type for your input dataset(s). Plus, you can even **parameterize** dataset features!
67
- Following the SBST approach, TestIt writes these input datasets, along with any parameters and reference values—to C source and header files in the directory specified in the _test_ field of `config.test`. This way, everything is automated and ready for your test campaign.
66
+ TestIt creates a unique dataset for every test iteration based on your specifications in the _tests_ field of `config.test`. There, you define the size, dimensions, and value range for your input dataset(s). Plus, you can even **parameterize** dataset features!
67
+ Following the SBST approach, TestIt writes these input datasets and reference values to the test directory. The default output mode uses a C source/header pair, while [custom output mode](#configure-the-testing-environment-configtest) creates one ASCII file per dataset. This way, everything is automated and ready for your test campaign.
68
68
 
69
69
  - **How can TestIt input datasets be parametrized?**
70
70
  When specifying the test you want TestIt to run, include a parameters field in your configuration (see section xxx for details). In this field, you can describe as many parameters as you need by assigning each a name and a value. Optionally, you can also provide a value range and a step size.
71
71
 
72
72
  TestIt scans your input dataset specifications for strings that match any of the defined parameters. When a match is found, it replaces that string with the current parameter value, allowing your input datasets to dynamically change shape with each iteration.
73
73
  Additionally, these parameters are passed to the golden function defined in `testit_golden.py`, so your function can use them as needed.
74
- Finally, all parameters are declared in the header file generated by TestIt in the directory specified in the test field, making them accessible to your test application.
74
+ Finally, in default output mode, all parameters are declared in the generated header file, making them accessible to your test application.
75
75
 
76
76
  For example, you might set a *TILE_SIZE* parameter to experiment with different tiling strategies for your SA, or define an *ARRAY_LEN* parameter with a range and a step to vary the array size with each iteration. Imagination is the only limit!
77
77
 
@@ -81,7 +81,7 @@ In order to run TestIt and take full advantage of its features, it's important t
81
81
  There are just a couple of requirements for your golden functions. First of all, they **must** accept two arguments: *input_datasets* and *parameters*, which TestIt passes as lists. The only other requirement is that your function **must** return a _one-dimensional list_. If your output is a tensor, simply flatten it. Everything else in your function is completely up to you.
82
82
 
83
83
  - **How can TestIt read the result(s) of my application(s)?**
84
- TestIt relies on a regular expression mechanism, meaning your test application **must** print its output, whether via a serial connection or a file dump in simulation environments, using the regex you define in the _test_ field of `config.test`. You can make this regex as elaborate as needed, but remember to include tags for each field.
84
+ TestIt relies on a regular expression mechanism, meaning your test application **must** print its output, whether via a serial connection or a file dump in simulation environments, using the regex you define in the _tests_ field of `config.test`. You can make this regex as elaborate as needed, but remember to include tags for each field.
85
85
 
86
86
  Your application is free to print multiple regex strings, provided they follow the same structure. This setup allows a single test application to run as many sub-tests as you want, offering significant flexibility. For example, you can leverage this feature for **performance characterization**. As explained in section zzz, your application could record test durations using an on-board timer and then report those timings within the regex, which are then communicated back to the host device.
87
87
 
@@ -96,6 +96,23 @@ Let's get technical!
96
96
 
97
97
  This section covers all the requirements that TestIt needs to run a successful integration test.
98
98
 
99
+ #### Makefile targets
100
+
101
+ TestIt delegates project-specific build and execution steps to a `Makefile` in the directory where you run `testit run`. The Makefile must expose the top-level targets for your selected workflow with these exact names. TestIt passes the `target.name` and `test.appName` values from `config.test` as Make variables.
102
+
103
+ | Target invoked by TestIt | Used for | Responsibility |
104
+ | --- | --- | --- |
105
+ | `make sim-build tool=<target.name>` | Simulation | Build the simulation model for the selected tool. This is skipped with `testit run --nobuild`. |
106
+ | `make sw-sim tool=<target.name> app=<test.appName>` | Simulation | Compile the selected test application for simulation. |
107
+ | `make sim-run tool=<target.name> app=<test.appName>` | Simulation | Run the compiled application and write its output to the file configured by `target.outputFile`. |
108
+ | `make fpga-build board=<target.name>` | FPGA | Build the FPGA model for the selected board. This is skipped with `testit run --nobuild`. |
109
+ | `make fpga-load board=<target.name>` | FPGA | Load the built model onto the selected FPGA board. |
110
+ | `make sw-fpga app=<test.appName> target=<target.name>` | FPGA | Compile the selected test application for the target board. |
111
+ | `make deb-setup` | FPGA | Start the debug server used to communicate with the board. The process must remain active while the campaign runs. |
112
+ | `make gdb-setup` | FPGA | Start an interactive GDB session. It must remain active and present a `(gdb)` prompt so TestIt can load and run each application. |
113
+
114
+ Before starting a campaign, TestIt checks only the targets used by the configured `target.type`: simulation campaigns require the three simulation targets, while FPGA campaigns require the five FPGA targets.
115
+
99
116
  #### Configure the testing environment: *config.test*
100
117
 
101
118
  This file is at heart a JSON database, which contains all the information that TestIt needs to operate, about both your workflow and the tests you want to run.
@@ -111,6 +128,7 @@ Specifically, there are three fields that you need to fill out:
111
128
  baudrate: 9600
112
129
  iterations: 10
113
130
  outputFile: "path/to/sim/dump"
131
+ seed: None
114
132
  }
115
133
  ```
116
134
  This field captures all the details about the target platform you are using, which can be any FPGA development board or simulation tool that *your workflow* supports.
@@ -127,6 +145,8 @@ Specifically, there are three fields that you need to fill out:
127
145
 
128
146
  - __*outputFile*__: This parameter may seem a bit tricky. TestIt reads test results via serial communication between the host device and the system under test (SUT). This method is used even for simulation-based tests. Essentially, your simulation system needs to dump the serial communication data to a file, and TestIt then reads and parses this file to extract the test information. The _outputFile_ parameter specifies the directory containing this file.
129
147
 
148
+ - __*seed*__: Set this to an integer to reproduce the same random parameters and datasets across multiple testing campaigns. Leave it as `None` or `null` to keep the campaign unseeded.
149
+
130
150
  - <a id="report-dir"> **report**</a>
131
151
  ```json
132
152
  {
@@ -135,12 +155,13 @@ Specifically, there are three fields that you need to fill out:
135
155
  ```
136
156
  This field simply specifies the directory where TestIt will store the test results and generate the report when you run the `testit report` [command](#run-the-testing-campaign).
137
157
 
138
- - **test**
158
+ - **tests**
139
159
  ```json
140
160
  [
141
161
  {
142
162
  appName: "application_name"
143
163
  dir: "path/to/app"
164
+ outputMode: "default"
144
165
  genFilesName: "test_data"
145
166
  outputFormat: "(\\d+):(\\d+):(\\d+)"
146
167
  outputTags: ["TestID", "Cycles", "Outcome"]
@@ -181,13 +202,14 @@ Specifically, there are three fields that you need to fill out:
181
202
  }
182
203
  ]
183
204
  ```
184
- This field describes all the tests you want TestIt to run. In the example above, there’s only a single test, but notice that it’s actually a list (hence the square brackets), so feel free to add as many tests as you desires. Let’s break this down piece by piece:
205
+ This field describes all the tests you want TestIt to run. In the example above, there’s only a single test, but notice that it’s actually a list (hence the square brackets), so feel free to add as many tests as you desire. Let’s break this down piece by piece:
185
206
  <br>
186
207
 
187
208
  First of all, you need to specify some __details__ about the test:
188
209
  - __*appName*__: This is crucial because it’s passed to the Make targets for compiling the test application. Make sure you match the name your own workflow expects.
189
210
  - __*dir*__: This simply points to the directory where your test application lives.
190
- - __*genFilesName*__: This is the name for the C source and header files that TestIt will generate to store random datasets, reference values, and parameters. Your test application should link the header so it can access all this data, so be sure to use the right name.
211
+ - __*outputMode*__: This can be `default` or `custom` and defaults to `default` when omitted. Default mode writes all datasets to the C source and header pair described by `genFilesName`. Custom mode writes each dataset to a separate ASCII file named from its `name` and `extension`, with the flattened array stored one value per line.
212
+ - __*genFilesName*__: In default output mode, this is the name for the C source and header files that TestIt generates to store random datasets, reference values, and parameters. Your test application should include the header so it can access all this data. This field is not used in custom output mode.
191
213
  - __*outputFormat*__: Super important! This is the _regular expression_ that TestIt will use to parse the results from your test application. It’s important to ensure your application prints data in the same format.
192
214
  - <a id="output-tags"> __*outputTags*__</a>: Again, super important! These are the tags associated with the fields in the regex. Each tag corresponds to a capture group in the regular expression.
193
215
  <br>
@@ -195,7 +217,7 @@ Specifically, there are three fields that you need to fill out:
195
217
  The next step is to define __parameters__, which are essential for TestIt’s functionality but not strictly required. This field is also a _list_, so feel free to define multiple parameters per test.
196
218
 
197
219
  Each parameter __must__ have:
198
- - __*name*__: This is the name that TestIt will include in the generated header file, so make sure your test application is ready to use it.
220
+ - __*name*__: This identifies the parameter when it is used in dataset dimensions or by a golden function. In default output mode, TestIt also defines it as a macro in the generated header file.
199
221
  - __*value*__: This can be a _fixed value_, a _fixed string_, or a _value range_. If it’s a value range (like in the example), TestIt will pick one value from that range in each iteration. And if any dimensions of your input dataset (like "input_matrix_A" or "input_matrix_B") depend on this parameter, TestIt will parse the correct parameter value for every matching dimension.
200
222
 
201
223
  If the value is defined as a range, it’s _possible_ to define a **step** parameter (as shown in the example). This parameter is used by TestIt whenever you run your tests in sweep mode, by calling `testit run --sweep`.
@@ -205,19 +227,45 @@ Specifically, there are three fields that you need to fill out:
205
227
  Next on the list: __input datasets__. Just like parameters, this field is a _list_, so you can define as many input datasets as you wish.
206
228
 
207
229
  Each input dataset **must** have:
208
- - **_name_**: This is the name TestIt will give to the C array it writes in the source and header files. Make sure your test application knows this name.
209
- - **_dataType_**: A _string_ used to define the C array that holds the dataset values. TestIt checks that this is a standard C type, as for the moment custom datatypes aren’t supported yet.
210
- - **_valueRange_**: The range from which TestIt picks values to create the random dataset. Make sure this range suits the chosen data type.
230
+ - **_name_**: The dataset name. In default output mode, TestIt uses it for the C array; in custom output mode, it becomes the file name.
231
+ - **_dataType_**: In default output mode, this string defines the C array type and must be a supported standard C type. It is ignored and may be omitted in custom output mode; integer range bounds generate integers and floating-point bounds generate floating-point values.
232
+ - **_extension_**: Required only in custom output mode. This is the extension of the dataset’s separate output file, such as `hex` or `.txt`.
233
+ - **_valueRange_**: The range from which TestIt picks values to create the random dataset.
211
234
  - **_dimensions_**: A _list_ describing the dataset’s dimensions. If a dimension corresponds to a _parameter_, TestIt will parse the correct value automatically. You can have as many dimensions as you like!
212
235
  <br>
213
236
 
214
237
  Next up is a straightforward step: defining the __output datasets__. They only have a couple of fields, as output size and dimensions are extracted by TestIt from the array that your golden function returns:
215
238
 
216
- - **_name_**: Just like for input datasets, this is the name TestIt will assign to the C array it writes in the source and header files. Make sure your test application looks for this name.
217
- - **_dataType_**: Similar to the input datasets, this _string_ determines the C array’s type. TestIt validates that it’s a standard C type; custom datatypes aren’t supported yet.
239
+ - **_name_**: Just like for input datasets, this identifies the generated C array in default mode or the separate file in custom mode.
240
+ - **_dataType_**: In default output mode, this string determines the C array’s type. It is ignored and may be omitted in custom output mode.
241
+ - **_extension_**: Required only in custom output mode. This is the extension of the dataset’s separate output file.
218
242
  <br>
219
243
 
220
- Speaking of golden functions, the __goldenResultFunction__ is the very last step in defining the _test_ field.
244
+ For example, a custom-mode test can write each input and golden output array to its own file:
245
+
246
+ ```hjson
247
+ {
248
+ outputMode: "custom"
249
+ inputDataset: [
250
+ {
251
+ name: "input_matrix"
252
+ extension: "stim"
253
+ valueRange: [0, 255]
254
+ dimensions: [4, 4]
255
+ }
256
+ ]
257
+ outputDataset: [
258
+ {
259
+ name: "expected_matrix"
260
+ extension: ".golden"
261
+ }
262
+ ]
263
+ }
264
+ ```
265
+
266
+ This produces `input_matrix.stim` and `expected_matrix.golden` in the test directory. Both files contain the corresponding flattened array with one value on each line.
267
+
268
+ Speaking of golden functions, the __goldenResultFunction__ is the very last step in defining the _tests_ field.
221
269
 
222
270
  - **_name_**: This is the name of the function TestIt will call to generate the reference dataset. It **must** match exactly the name you used for your function in `testit_golden.py`.
223
271
 
@@ -323,9 +371,18 @@ TestIt provides three main commands to access its functionalities.
323
371
  ```bash
324
372
  testit setup
325
373
  ```
326
- This is the first command you’ll want to run. It does exactly what it says—it sets up your TestIt environment. Running this command generates template versions of *testit_golden.py* and *config.test*, based on the targets and examples in this documentation.
374
+ This is the first command you’ll want to run. It does exactly what it says—it sets up your TestIt environment. Running this command creates a `testit/` directory with template versions of the golden module and of the default configuration, based on the targets and examples in this documentation:
375
+
376
+ ```text
377
+ testit/
378
+ ├── testit_golden.py
379
+ └── config/
380
+ └── config.test
381
+ ```
382
+
383
+ Existing files are never overwritten. You can add more configuration files next to `config.test` in `testit/config/` and select them with the `--config` [flag](#run-the-testing-campaign).
327
384
 
328
- You don’t have to place these files in the root of your RTL project, but keep in mind that **all subsequent TestIt commands must be executed in the same directory where you first ran** `testit setup`. That’s where TestIt expects to find its configuration files.
385
+ You don’t have to run this in the root of your RTL project, but keep in mind that **all subsequent TestIt commands must be executed in the directory that contains** `testit/`. That’s where TestIt expects to find its configuration files.
329
386
 
330
387
  ---
331
388
 
@@ -333,7 +390,9 @@ You don’t have to place these files in the root of your RTL project, but keep
333
390
  ```bash
334
391
  testit run [flags]
335
392
  ```
336
- This is the core command of TestIt, the one that actually executes the testing campaign. As mentioned earlier, you must run it in the directory where *testit_golden.py* and *config.test* are stored, which doesn’t necessarily have to be the root of your RTL project.
393
+ This is the core command of TestIt, the one that actually executes the testing campaign. As mentioned earlier, you must run it in the directory that contains `testit/`, which doesn’t necessarily have to be the root of your RTL project.
394
+
395
+ The progress bar estimates the remaining campaign time from the duration of completed iterations. An iteration advances the progress only after all of its configured tests finish, so the estimate does not depend on the number of tests in that iteration.
337
396
 
338
397
  You can customize the test campaign with the following flags:
339
398
 
@@ -347,6 +406,11 @@ testit run --sweep
347
406
  ```
348
407
  This enables <a id="sweep-mode">**sweep mode**</a>, which overrides the _iterations_ parameter and instead tests all possible parameter combinations for each individual test. This mode ensures a more comprehensive testing effort and is particularly useful for **performance characterization**. Be aware that this may generate a _large number of iterations_. The command line interface will always display the current iteration count and provide a dynamic estimate of the total test duration.
349
408
 
409
+ ```bash
410
+ testit run --config [file_name]
411
+ ```
412
+ Runs the campaign described by `testit/config/[file_name]` instead of the default `testit/config/config.test`. The same flag is accepted by `testit report`, so the report is read from the directory that configuration specifies.
413
+
350
414
  ```bash
351
415
  testit run --mammamia
352
416
  ```
@@ -370,4 +434,3 @@ testit report --sort_key [key_name]
370
434
  This sorts the test results based on any of the [output tags](#output-tags) defined in `config.test`. If you want to sort the results in descending order, add `--descending` to the command. Otherwise, sorting will be in ascending order.
371
435
 
372
436
  ---
373
-
@@ -19,7 +19,7 @@ build-backend = "setuptools.build_meta"
19
19
 
20
20
  [project]
21
21
  name = "testitpy"
22
- version = "0.4"
22
+ version = "0.5"
23
23
  authors = [
24
24
  {name = "Tommaso Terzano", email = "tommaso.terzano@gmail.com"},
25
25
  ]
@@ -15,6 +15,18 @@
15
15
 
16
16
  import argparse
17
17
  from . import run
18
+ from . import testit_util
19
+
20
+
21
+ def _add_config_argument(parser):
22
+ parser.add_argument(
23
+ "--config",
24
+ default=testit_util.DEFAULT_CONFIG_NAME,
25
+ help=(
26
+ f"Configuration file name inside {testit_util.CONFIG_DIR}/ "
27
+ f"(default: {testit_util.DEFAULT_CONFIG_NAME})"
28
+ ),
29
+ )
18
30
 
19
31
 
20
32
  def main():
@@ -43,6 +55,9 @@ def main():
43
55
  "--mammamia", action="store_true", help="Let's cook some pasta"
44
56
  )
45
57
 
58
+ _add_config_argument(run_parser)
59
+ _add_config_argument(report_parser)
60
+
46
61
  # Sorting key argument
47
62
  report_parser.add_argument(
48
63
  "--sort_key",
@@ -60,11 +75,11 @@ def main():
60
75
  args = parser.parse_args()
61
76
 
62
77
  if args.command == "run":
63
- run.testit_run(args.nobuild, args.mammamia, args.sweep)
78
+ run.testit_run(args.nobuild, args.mammamia, args.sweep, args.config)
64
79
  elif args.command == "setup":
65
80
  run.testit_setup()
66
81
  elif args.command == "report":
67
- run.testit_report(args.sort_key, not args.descending)
82
+ run.testit_report(args.sort_key, not args.descending, args.config)
68
83
 
69
84
 
70
85
  if __name__ == "__main__":