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
url=[email protected]:w0lek/sockpp.git# fork where in branch v1.0.0_no_complication_warnings there are compilation warnings fixes for upstream tag v1.0.0 of sockpp
To see the names of each unit test, use `--list-tests`:
376
+
377
+
```shell
378
+
# From $VTR_ROOT/build/vpr
379
+
$ ./test_vpr --list-tests
380
+
```
381
+
382
+
The output should look similar to this:
383
+
384
+
```shell
385
+
All available test cases:
386
+
test_route_flow
387
+
[vpr_noc_bfs_routing]
388
+
test_find_block_with_matching_name
389
+
[vpr_clustered_netlist]
390
+
connection_router
391
+
[vpr]
392
+
binary_heap
393
+
[vpr]
394
+
edge_groups_create_sets
395
+
[vpr]
396
+
read_interchange_models
397
+
[vpr]
398
+
399
+
... # many more test cases
400
+
401
+
52 test cases
402
+
```
403
+
404
+
To run specific unit tests, pass them as arguments. For example:
405
+
406
+
```shell
407
+
# From $VTR_ROOT/build/vpr
408
+
$ ./test_vpr test_route_flow connection_router
409
+
```
410
+
352
411
# Evaluating Quality of Result (QoR) Changes
353
412
VTR uses highly tuned and optimized algorithms and data structures.
354
413
Changes which effect these can have significant impacts on the quality of VTR's design implementations (timing, area etc.) and VTR's run-time/memory usage.
@@ -972,6 +1031,64 @@ This describes adding a test to `vtr_reg_strong`, but the process is similar for
972
1031
$ git commit
973
1032
```
974
1033
1034
+
## Creating Unit Tests
1035
+
1036
+
You can find the source code forthe unit testsin their respective directories. New unit tests must also be created in
VTR uses [Catch2](https://github.com/catchorg/Catch2) for its unit testing framework. For a full tutorial of how to use
1047
+
the framework, see `$VTR_ROOT/libs/EXTERNAL/libcatch2/docs/Readme.md`.
1048
+
1049
+
### Example: Creating and Running a VPR Test Case
1050
+
1051
+
Navigate to `$VTR_ROOT/vpr/test`.
1052
+
1053
+
```shell
1054
+
$ cd$VTR_ROOT/vpr/test
1055
+
```
1056
+
1057
+
From here, let's create and open a new file `test_new_vpr.cpp` (begin the file name with `test_`). Be sure to `#include "catch2/catch_test_macros.hpp"`.
1058
+
Introduce a test case using the `TEST_CASE` macro, and include a name and a tag. For boolean assertions, use `REQUIRE`.
1059
+
1060
+
```shell
1061
+
#include "catch2/catch_test_macros.hpp"
1062
+
1063
+
// To choose a tag (written with square brackets "[tag]"), see examples from when you run ./test_vpr
1064
+
// --list-tests in the tester exectuable directory, as shown earlier. A good default tag name is the name
1065
+
// of the tester: in this case, [vpr].
1066
+
TEST_CASE("a_vpr_test_name", "[vpr]") {
1067
+
int x = 0;
1068
+
REQUIRE(x == 0);
1069
+
}
1070
+
```
1071
+
1072
+
To run our test case, we must navigate back to `$VTR_ROOT/build/vpr` (from the table
1073
+
under [Running Individual Testers](#running-individual-testers)). Since we created a test, we need to rebuild the
Docker creates an isolated container on your system so you know that VTR will run without further configurations nor affecting any other work.
5
5
6
6
Our Docker file sets up this enviroment by installing all necessary Linux packages and applications as well as Perl modules.
7
7
8
-
Additionally, Cloud9 is installed, which enables the remote management of your container through browser. With Cloud9, VTR can be started easier (and even modified and recompiled) without the need to logging into a terminal. If the Cloud9 endpoint is published outside your LAN, you can also execute VTR remotely or share your screen with other users.
8
+
## Setup
9
9
10
+
1. Install docker (Community Edition is free and sufficient for VTR): https://docs.docker.com/engine/install/
10
11
11
-
Setup
12
-
=====
12
+
2. Clone the VTR project:
13
13
14
-
Install docker (Community Edition is free and sufficient for VTR): https://docs.docker.com/engine/installation/
0 commit comments