Giter Site home page Giter Site logo

cmakeresources-demo's Introduction

CMakeResources demo test

Sample project demonstrating using CMake resources to distribute port allocations for an example test. Ideally use port 0 to just get a random port allocated but if you have a use case for a deterministic port that won't be duplicated across tests then this barely works.

cmake -S . -B build --preset\=default -DCMAKE_EXPORT_COMPILE_COMMANDS\=ON -DCMAKE_COLOR_DIAGNOSTICS\=ON
cmake --build build --preset\=default --parallel\=18
env CLICOLOR_FORCE\=1 GTEST_COLOR\=1 ctest --test-dir build --preset\=default --output-on-failure --schedule-random test

CTest will schedule upto 16 tests in parallel but because the portoffset resource in CMakeResources.txt only has 3 slots no more than 3 tests with a dependence on that resource will be defined. The project defines 15 tests all of the same executable and all it does is start up, read the resource environment, bind to a port succesfully and then wait a bit before exiting. To confirm the test never steps over port allocations you can try adding a modulo chock to the port read to make it step over itself.

cmakeresources-demo's People

Contributors

mohkale 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.