|
| 1 | +# `Systematic Testing for C++` |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | +**Note: This is still work-in-progress (WIP) and provided here as-is. If you are a Microsoft |
| 7 | +employee interested in using this library please get in touch over Teams or email to discuss.** |
| 8 | + |
| 9 | +A library for **systematically testing** concurrent C++ code and **deterministically reproducing** |
| 10 | +bugs. |
| 11 | + |
| 12 | +Using this library, you get access to a `SystematicTesting::TestEngine` that can be used to (1) |
| 13 | +instrument your code for taking control of sources of concurrency and nondeterminism in your C++ |
| 14 | +code, and (2) for writing and running what we call concurrency unit tests. These look like your |
| 15 | +regular unit tests, but can reliably test concurrent workloads (such as tasks and threads). In |
| 16 | +regular unit tests, you would typically avoid concurrency due to flakiness, but with this library |
| 17 | +you are encouraged to embrace concurrency in your tests to find bugs. |
| 18 | + |
| 19 | +This library is part of the [Coyote](https://microsoft.github.io/coyote/) project by [Microsoft |
| 20 | +Research](https://www.microsoft.com/en-us/research/). To learn more about the research behind our |
| 21 | +technology, check out our published papers |
| 22 | +[here](https://microsoft.github.io/coyote/learn/resources/publications). |
| 23 | + |
| 24 | +## How to build |
| 25 | + |
| 26 | +On Windows, run the following script for a VS 2019 developer command prompt: |
| 27 | +```bat |
| 28 | +scripts\build.bat |
| 29 | +``` |
| 30 | + |
| 31 | +On Linux, run the following bash script from the root directory: |
| 32 | +```bash |
| 33 | +./scripts/build.sh |
| 34 | +``` |
| 35 | + |
| 36 | +After building the project, you can find a static and shared library in `bin`. |
| 37 | + |
| 38 | +For more detailed building instructions (e.g. if you want to build without the scripts), read |
| 39 | +[here](./docs/building.md). |
| 40 | + |
| 41 | +*Note: the build/ci scripts do not currently work on macOS, feel free to contribute!* |
| 42 | + |
| 43 | +## How to use |
| 44 | + |
| 45 | +To use the systematic testing engine in a C++ project, link the static or shared library to your |
| 46 | +project, and include the following header file (from the [`include`](./include) directory): |
| 47 | +```c++ |
| 48 | +#include "systematic_testing.h" |
| 49 | +``` |
| 50 | + |
| 51 | +Then use the `SystematicTesting::TestEngine` APIs to instrument your code similar to our examples |
| 52 | +[here](./test/integration). |
| 53 | + |
| 54 | +## Contributing |
| 55 | + |
| 56 | +This project welcomes contributions and suggestions. Most contributions require you to agree to a |
| 57 | +Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us |
| 58 | +the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. |
| 59 | + |
| 60 | +When you submit a pull request, a CLA bot will automatically determine whether you need to provide a |
| 61 | +CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions |
| 62 | +provided by the bot. You will only need to do this once across all repositories using our CLA. |
| 63 | + |
| 64 | +## Code of Conduct |
| 65 | + |
| 66 | +This project has adopted the [Microsoft Open Source Code of |
| 67 | +Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of |
| 68 | +Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact |
| 69 | +[opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. |
0 commit comments