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: tests/README.md
+33
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,8 @@ Here are some test examples that can help you get started writing unit tests.
33
33
34
34
## Compile
35
35
36
+
### With the `Makefile` System
37
+
36
38
Smart test discovery is already built into the `Makefile`, so anything in `src` (at any level of nesting) will be detected and compiled into the equivalent path in the `bin` directory. Also, the `Makefile` generates the test "makefile" for `ctest`. There should never be a reason to directly modify any Makefile unless you are hacking on the SCIP Unit Test Suite.
37
39
38
40
The easiest way to compile and run the tests is:
@@ -54,8 +56,27 @@ Go to `Criterion/dependencies/klib` and execute `git co cdb7e92` and then go to
54
56
55
57
**NOTE** Some tests might need to include c files from SCIP. For tests to be recompilied the included c file gets recompiled, run `make depend`.
56
58
59
+
### With the CMake System
60
+
61
+
Create a build directory and build the unittests
62
+
```bash
63
+
mkdir build
64
+
cd build
65
+
cmake .. YOUR_CMAKE_CONFIGURATION
66
+
make unittests -j
67
+
```
68
+
69
+
There's a target for each test file, that's generated by cmake if you would like to compile only one test.
70
+
For example,
71
+
```bash
72
+
make unittest-scip-stages -j
73
+
```
74
+
To compile the `stages.c` test file in `tests/scip` directory.
75
+
57
76
## Run
58
77
78
+
### With the Makefile System
79
+
59
80
See above for the easiest way to compile and run tests. For simply running tests:
60
81
61
82
```
@@ -90,6 +111,18 @@ Alternatively, one can disable ASLR system-wide (requires root access):
90
111
91
112
TODO: Define a policy for moving/removing tests in `src/bugs` once the bugs are fixed.
0 commit comments