How to use CxxTest in your raspberryPI

Install CxxTest in your raspberryPI is fairly easy as you will just need to download the source code and then use the script: cxxtestgen to generate a .cpp file and then compile this file.

To get the source code:
  - Move to /usr/local directory (you can choose your own preference)
  - Sudo git clone https://github.com/CxxTest/cxxtest.git

Try the first example in the CxxTest website:
   http://cxxtest.com/guide.html#gettingStarted

Execute the cxxtestgen script. In my case the script is located in the /usr/local/cxxtest/bin.
    /usr/local/cxxtest/bin/cxxtestgen --error-printer -o runner.cpp MyTestSuite1.h

(download your MyTestSuite1.h in the cxxtest website: http://cxxtest.com/guide.html#gettingStarted)

   ls –a (You would see runner.cpp file.)

Then you would need to compile this file using:
   g++ -I/usr/local/cxxtest runner.cpp –o runner 

-I/usr/local/cxxtest is to tell where to file the include file in CxxTest.

If you do not have the correct include path, it will raise an error: g++: fatal error: no input files compilation terminated.

Finally, you can run your test: ./runner

No comments:

Post a Comment

Blog Archive

About Me

My photo
I am a software developer with roughly 5 years of experience in developing end-to-end solutions in C#, Java, C/C++, PHP and HTML/CSS/Javascript. At the moment, I am joining the Professional Doctorate in Engineering degree program in Software Technology at Eindhoven University of Technology. My areas of particular interest include software design, data structures and algorithms, problem solving, software security, embedded system, machine learning, and data science.