Questions tagged [cxxtest]

CxxTest is a unit testing framework for C++

CxxTest is a unit testing framework for C++ that is similar in spirit to JUnit, CppUnit, and xUnit. CxxTest is easy to use because it does not require precompiling a CxxTest testing library, it employs no advanced features of C++ (e.g. RTTI) and it supports a very flexible form of test discovery.

40 questions
1
vote
0 answers

Can't find files of cxxtest when I'm trying to run compiled file

I started writing a small project on C++. I just wanted to develop using TDD because in Java I always do that. I faced a problem that using any libraries and so on is a bit easier in Java IDEs and tools (like maven and so on). But it's not exactly…
1
vote
1 answer

Can i make unit testing using cxxtest with visual studio 2010 professional?

Can i make unit testing using cxxtest with visual studio 2010 professional?
G-71
  • 3,626
  • 12
  • 45
  • 69
1
vote
1 answer

Travis-Ci Install and run CxxTest

I am trying to add Travis-Ci support for my open source project hosted on Github Problem appears when CMake tries to find CxxTest. Travis-Ci runs on old Ubuntu version, in which CxxTest is not trusted. I achieved some results. At this state CxxTest…
Inline
  • 2,566
  • 1
  • 16
  • 32
1
vote
1 answer

CxxTest compiling, missing main

I am using CxxTest for unit testing. I followed the docs. First command I executed was: cxxtestgen --error-printer -o runner.cpp MyTestSuite1.h Output of the command is runner.cpp file. According to the documentation, next command should be: g++…
Nikola Lošić
  • 479
  • 1
  • 6
  • 18
1
vote
1 answer

Can cxxtest suite be dynamically extended at run-time?

I wish to dynamically extend my CxxTest Suite with additional test items, but am finding that all the testing scenerios must be available (hard-coded) at compile time. My scenario is that I've got a fairly bulky C++ class that has 20+ methods to be…
J Jorgenson
  • 1,441
  • 12
  • 19
1
vote
1 answer

How do I check what version of java im using in c++

I have a testing script that checks what version of java the user is using and then executes some commands. But we are trying to convert all of our testing into cxxtests. I would like to know how to convert my version checking script into c++…
Grammin
  • 11,808
  • 22
  • 80
  • 138
1
vote
2 answers

Gtest with large C and C ++ codebase

I am into a project where we have a large codebase and currently it has no unit tests framework at all.The code we are working on would be finally run on a box which acts as a switch/router/firewall. So I am working on a piece of code which needs to…
1
vote
1 answer

Can CxxTest Do Paramaterized Tests?

According to this article, one can make a parameterized test in the GoogleTest framework with some code like this: INSTANTIATE_TEST_CASE_P(InstantiationName, MyStringTest, ::testing::Values("meek",…
jtpereyda
  • 6,987
  • 10
  • 51
  • 80
1
vote
1 answer

Casting problems with BOOST_FOREACH and cxxtest plugin

I'm currently working on a project where I use: boost libraries v1.39 Eclipse CDT (Juno) and Cygwin CxxTest plugin: http://wiki.web-cat.org/WCWiki/EclipsePlugins/CxxTestPlugin and I've run into a issue regarding the const_cast. I've searched high…
1
vote
3 answers

Can I write custom assertions in CxxTest?

I'm just starting to use CxxTest and would like to test whether a std::vector has been sorted correctly. Here's my test so far: void testSort() { std::sort(vec.begin(), vec.end()); // This could be any sorting function for (unsigned int i = 0;…
ThisSuitIsBlackNot
  • 23,492
  • 9
  • 63
  • 110
1
vote
1 answer

Macro define about cxxtest

I'm using cxxtest4.0.3 under vc6 to do a test. At first, the compiler report strcmp is not a member of std. After I added the CXXTEST_OLD_STD macro to project settings, the compiler report missing type info of string at the line…
bucherren
  • 299
  • 1
  • 3
  • 13
0
votes
0 answers

CMake's CTest fails to run CxxTest using an emulator as specified by CMAKE_CROSSCOMPILING_EMULATOR

I'd like to run our cross-compiled unit test suite on my host system using qemu and invoke the tests with CTest. For that purpose I've configured and set up CMake with the necessary toolchain information, such as: CMAKE_SYSTEM_PROCESSOR: armv5e-our,…
apprentice
  • 21
  • 3
0
votes
2 answers

Accessing a C++ function from a CXX test

I'm writing a few CXX unit tests for a class I have written. I have never written CXX tests before (also this is the only framework I can use). I am trying to call a function contained within my class so that I can test the output is what is…
MeanwhileInHell
  • 6,780
  • 17
  • 57
  • 106
0
votes
1 answer

Should I #include .cpp files to header of TestSuite to make cxxtest work?

Situation is as follows: I've got a simple project consisting of two files - Calc.h and Calc.cpp. Calc.h: #pragma once class Calc { public: int add(int,int); static const int a = 42; } Calc.cpp: #include "Calc.h" class Calc { public: …
user18140744
0
votes
1 answer

User-defined literal fails to include another file

I have a class Komp where I have a user-defined literal constexpr Komp operator""_i(long double x) to produce a komp object from e.g Komp k = 1 + 5.0_i;. This works fine in komp.cpp's main(), however when I write the same exact statement in…
StijnVanDijk
  • 3
  • 1
  • 3