Giter Club home page Giter Club logo

testcontainers-c's Introduction

Testcontainers for C/C++/Swift and other native languages

Testcontainers Native Logo

Slack: testcontainers-native on slack.testcontainers.org Stability: Experimental GitHub release (latest by date)

!!! warning This is a prototype. There is a lot to do before it can be distributed and used in production, see the GitHub Issues and the project roadmap

This is not a standalone Testcontainers engine, but a C-style shared library adapter for native languages like C/C++, D, Lua, Swift, etc. It is an MVP SDK that can be later extended for the languages. The project is based on Testcontainers for Go which is one of the most powerful Testcontainers implementations.

Contributions and feedback are welcome! Also join the #testcontainers-native channel on the Testcontainers Slack.

Key Features

  • Testcontainers for C/C++ - a shared library and C-style headers that can be used in native projects
  • Support for C, C++, Swift and other native projects.
  • Minimum viable Testcontainers API functionality: starting and terminating containers, passing files, exposing ports, accessing container logs, etc.
  • Minimum HTTP client wrapper to simplify requests and assertions
  • Testcontainers for Go under the hood, with all its reporting and resource management capabilities. Memory might leak a lot in the current versions, but we do not want containers to leak :)
  • Support for Testcontainers Modules

This is what a very simple run without a test framework may look like.

Sample Output

Quick Start

Follow the Getting Started Guide.

Installing the library

It is advised to include CMake as a dependent module for now. If you like living dangerously until proper vcpkg and Conan packages are ready, you can optionally install the library to your system:

# NOT RECOMMENDED
cmake --install ..

Documentation

Using in C/C++/Swift projects

See the examples and demos for more examples.

Using in other languages

TL;DR: You get the C header file, a shared library object or a DLL file from the Testcontainers for C module. Then, you can bind this native library in your project type. It allows supporting many other languages that support using native tooling via dynamically or statically linked libraries:

Languages that can leverage Testcontainers for C

Disclaimer: The schema above shows the most popular languages for Embedded systems, based on the IEEE Spectrum 2021 Report and the JetBrains 2021 Developer Ecosystem Survey for Embedded Software. More native languages exist and can be supported by Testcontainers Native.

Feel free to contribute examples or SDKs for the languages! See the Swift Solution Page for examples. Testcontainers Native Architecture describes how it can be done in principle.

Credits

Using a complex Golang framework from C/C++ is not trivial. Neither the CMake files are. This project would not succeed without many quality articles and help from the community.

Kudos to:

Discuss

For any questions and feedback, join the #testcontainers-native channel on the Testcontainers Slack.

Support the Project

The best support is investing some time in the project. All contributions are welcome, checkout the Contributor Guide. Of course, GitHub Sponsorships will be appreciated too.

Read More

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.