Sign inSign up

patriciomoreno/codeworkout-cpp

By patriciomoreno

•Updated over 8 years ago

Image to test C++ code using CxxTest.

Image
0

178

patriciomoreno/codeworkout-cpp repository overview

⁠This image contains:
  • GCC 7.2.0
  • CxxTest 4.3 (/usr/local/cxxtest)
⁠Example
docker run --rm -v $(pwd):$(pwd) -w $(pwd) patriciomoreno/codeworkout-cpp:v1.0 bash --login -c "cxxtestgen --error-printer -o runner.cpp MyTestSuite1.h;g++ -o runner -I/usr/local/cxxtest runner.cpp;./runner"
⁠Content of MyTestSuite1.h
#include <cxxtest/TestSuite.h>

class MyTestSuite1 : public CxxTest::TestSuite
{
public:
    void testAddition(void)
    {
        TS_ASSERT(1 + 1 > 1);
        TS_ASSERT_EQUALS(1 + 1, 2);
    }
};                                                                                                

Tag summary

Content type

Image

Digest

Size

502.1 MB

Last updated

over 8 years ago

docker pull patriciomoreno/codeworkout-cpp:v2.0