Skip to content

Commit 28fed19

Browse files
committed
initial commit
0 parents  commit 28fed19

27 files changed

+4020
-0
lines changed

.gitattributes

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for C++
5+
*.h text diff=cpp
6+
*.cc text diff=cpp
7+
8+
# Standard to msysgit
9+
*.doc diff=astextplain
10+
*.DOC diff=astextplain
11+
*.docx diff=astextplain
12+
*.DOCX diff=astextplain
13+
*.dot diff=astextplain
14+
*.DOT diff=astextplain
15+
*.pdf diff=astextplain
16+
*.PDF diff=astextplain
17+
*.rtf diff=astextplain
18+
*.RTF diff=astextplain
19+
20+
# Ignored paths for language reporting
21+
CMakeLists.txt linguist-vendored
22+
*.md linguist-vendored
23+
*.sh linguist-vendored
24+
*.bat linguist-vendored
25+
*.ps1 linguist-vendored
26+
*.psm1 linguist-vendored
27+
*.json linguist-vendored
28+
*.yml linguist-vendored
29+
*.ipynb linguist-vendored
30+
docs/* linguist-vendored
31+
test/* linguist-vendored
32+
scripts/* linguist-vendored
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Linux CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: seanmiddleditch/gha-setup-ninja@master
16+
17+
- name: Build the project
18+
run: ./scripts/build.sh
19+
shell: bash
20+
21+
- name: Run the tests
22+
run: ./scripts/run-tests.sh
23+
shell: bash
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Windows CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: windows-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: seanmiddleditch/gha-setup-ninja@master
16+
17+
- name: Build the project
18+
run: .\scripts\build.bat
19+
shell: pwsh
20+
21+
- name: Run the tests
22+
run: .\scripts\run-tests.bat
23+
shell: pwsh

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Compiled Object files
5+
*.slo
6+
*.lo
7+
*.o
8+
*.obj
9+
10+
# Precompiled Headers
11+
*.gch
12+
*.pch
13+
14+
# Compiled Dynamic libraries
15+
*.so
16+
*.dylib
17+
*.dll
18+
19+
# Compiled Static libraries
20+
*.lai
21+
*.la
22+
*.a
23+
*.lib
24+
25+
# Executables
26+
*.exe
27+
*.out
28+
*.app
29+
30+
# Build files
31+
bin/
32+
build/
33+
out/
34+
35+
# Visual Studio
36+
.vs/

CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
cmake_minimum_required(VERSION 0.1)
2+
project("cpp_systematic_testing" CXX)
3+
4+
set(CMAKE_CXX_STANDARD 17)
5+
6+
enable_testing()
7+
8+
if(CMAKE_TESTING_ENABLED AND NOT MSVC)
9+
find_package(Threads REQUIRED)
10+
endif()
11+
12+
if(MSVC)
13+
add_compile_options(/permissive-)
14+
add_compile_options(/utf-8)
15+
endif()
16+
17+
add_subdirectory(src)
18+
if(CMAKE_TESTING_ENABLED)
19+
add_subdirectory(test)
20+
endif()

CMakeSettings.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "x64-Debug",
5+
"generator": "Ninja",
6+
"configurationType": "Debug",
7+
"buildRoot": "${projectDir}\\out\\build\\${name}",
8+
"installRoot": "${projectDir}\\out\\install\\${name}",
9+
"cmakeCommandArgs": "",
10+
"buildCommandArgs": "-v",
11+
"ctestCommandArgs": "",
12+
"inheritEnvironments": [ "msvc_x64_x64" ],
13+
"variables": []
14+
},
15+
{
16+
"name": "x64-Release",
17+
"generator": "Ninja",
18+
"configurationType": "RelWithDebInfo",
19+
"buildRoot": "${projectDir}\\out\\build\\${name}",
20+
"installRoot": "${projectDir}\\out\\install\\${name}",
21+
"cmakeCommandArgs": "",
22+
"buildCommandArgs": "-v",
23+
"ctestCommandArgs": "",
24+
"inheritEnvironments": [ "msvc_x64_x64" ],
25+
"variables": []
26+
}
27+
]
28+
}

LICENSE

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Copyright (c) Microsoft Corporation.
2+
3+
Coyote
4+
5+
MIT License
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.

README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# `Systematic Testing for C++`
2+
3+
![Windows CI](https://github.com/microsoft/cpp-systematic-testing/workflows/Windows%20CI/badge.svg)
4+
![Linux CI](https://github.com/microsoft/cpp-systematic-testing/workflows/Linux%20CI/badge.svg)
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.

SECURITY.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.5 BLOCK -->
2+
3+
## Security
4+
5+
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
6+
7+
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
8+
9+
## Reporting Security Issues
10+
11+
**Please do not report security vulnerabilities through public GitHub issues.**
12+
13+
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
14+
15+
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
16+
17+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18+
19+
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20+
21+
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22+
* Full paths of source file(s) related to the manifestation of the issue
23+
* The location of the affected source code (tag/branch/commit or direct URL)
24+
* Any special configuration required to reproduce the issue
25+
* Step-by-step instructions to reproduce the issue
26+
* Proof-of-concept or exploit code (if possible)
27+
* Impact of the issue, including how an attacker might exploit the issue
28+
29+
This information will help us triage your report more quickly.
30+
31+
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
32+
33+
## Preferred Languages
34+
35+
We prefer all communications to be in English.
36+
37+
## Policy
38+
39+
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
40+
41+
<!-- END MICROSOFT SECURITY.MD BLOCK -->

docs/building.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Building the project on Windows
2+
3+
On Windows, run the following script for a VS 2019 developer command prompt:
4+
```bat
5+
scripts\build.bat
6+
```
7+
8+
Or, to build manually, open the project as a Visual Studio 2019 CMake project by selecting the
9+
CMakeLists.txt file and then build the project.
10+
11+
After building the project, you can find a static and shared library in `bin`.
12+
13+
## Building the project on Linux
14+
15+
On Linux, run the following bash script from the root directory:
16+
```bash
17+
./scripts/build.sh
18+
```
19+
20+
Or, to build manually, follow these commands from the root directory:
21+
```bash
22+
mkdir build
23+
cd build
24+
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release ..
25+
ninja
26+
```
27+
28+
To build for debug under Linux, add to the `-DCMAKE_BUILD_TYPE=Debug` flag when invoking `cmake`.
29+
30+
After building the project, you can find a static and shared library in `bin`.

0 commit comments

Comments
 (0)