Giter Site home page Giter Site logo

min-contracts's Introduction

min-contracts

Linux builds

MacOS builds

Windows builds

Minimal contracts library tries to offer a minimal library-only solution to support contracts in modern C++.

The library offers:

  • Preconditions
  • Postconditions
  • Assertions

Please, refer to library API description for more details.

Getting started

Prerequisites

The following requirements must be met to use the library:

  • CMake 3.16 or higher.
  • A C++20 compliant compiler. Note that the library has been tested with the following versions:
    • g++ (version 9, 10, 11) under Ubuntu Linux 20.
    • clang++ (version 11) under Ubuntu Linux 20.
    • AppleClang++ (version 12) under MacOS 10.
    • MSVC 2019 under Windows 2019.
    • MSVC 2017 under Windows 2017.

If you want to run the unit tests you will need:

  • Google Test (available at GitHub repo). Please, use the latest available version. If Google Test library is not found, the unit tests will not be available but you will be able to install the library.

Installing the sources

Clone the project:

git clone [email protected]:jdgarciauc3m/min-contracts.git

Building the library

To build the library out of source, create a directory and run cmake:

mkdir build
cd build
cmake .. -D_CMAKE_BUILD_TYPE=Release  # Configure build process
make

Installing the library

You can install the library with the target install.

make install

Running the tests

Unit tests can be disabled by setting the option mincontracts_TESTS to OFF.

To run the tests, simply use CTest, from the build directory, passing the desired configuration.

ctest

If you want more verbose output for the tests, you can use:

ctest -VV

Acknowledgments

Some ideas used here are inspired by the great series of blog posts by Herb Sutter:

min-contracts's People

Contributors

jdgarciauc3m avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.