defining CPPUTEST_HOME

544 views
Skip to first unread message

David Yaroni

unread,
Oct 27, 2020, 9:26:37 AM10/27/20
to cpputest
Hi,

I am new to CppUTest and I want to start using it in conjunction with the book TDD for Embedded C

I am used to working on Eclipse so I am trying to set it up on Eclipse and run the examples of the book. But even though there are instructions in readme files online and with the book code, I got stuck.

For example, in the readme file that comes with the book code it says:
Define CPPUTEST_HOME in your .bash_profile or similar file
  export CPPUTEST_HOME=~/tools/cpputest

In the online readme file it says:

Point CPPUTEST_HOME to the root directory of CppUTest. If you don't, the starter project makefile will not be able to find MakefileWorker.mk and the needed include and library files.

export CPPUTEST_HOME=/close-to-your-production-code/cpputest

Under cygwin, you can use a windows environment variable.


I barely know what cygwin even is. 
Isn't there some place in Eclipse I can just set this definition?

I tried setting the definition in windows environment variables but that didn't work.

I am not an too savvy when it comes to setups and work environments.
I thought there would be a more step by step guide as how to set up the workspace to get CppUTest up and running. 
I have searched online a lot and I couldn't find the answer to this question.
It feels intuitive but I don't know where else to ask. 

Thanks.

David

James Grenning

unread,
Oct 27, 2020, 9:48:42 AM10/27/20
to cpputest

Hi David

To get started, you can change the makefile to define CPPUTEST_HOME. The eclipse instructions are old and I don't know what has changed in eclipse over the years. That should help get the starter project going.

Also, I made a git repo for the book's code with an updated build environment and instructions for building with Docker. If you can run docker on your machine it might be the best way to go. https://github.com/jwgrenning/tddec-code

One of the problems over the years keeping the book code running is that the tool chain is constantly changing. Docker helps hold the build environment steady.

Thanks for buying my book!

Hope that helps, James


James Grenning -- Author of TDD for Embedded C - wingman-sw.com/tddec
Join my live-via-the-web TDD Training
wingman software
wingman-sw.com -- blog -- @jwgrenning -- facebook

--
You received this message because you are subscribed to the Google Groups "cpputest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cpputest+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cpputest/183c45f1-e1d9-42a0-8e8a-4b9ab950f0b2n%40googlegroups.com.

David Yaroni

unread,
Oct 27, 2020, 10:20:24 AM10/27/20
to cpputest
Hi James,

Yeah, that seems helpful. I'll give it a try.
I heard about docker but I never used it before. I'll just add it to the list of things to learn.

Thanks, 
David

David Yaroni

unread,
Oct 29, 2020, 9:37:02 AM10/29/20
to cpputest
Hi james,
I just wanted to update you that I got it up and running! 
I didn't use docker eventually, but I managed to find the proper configuration in eclipse and everything is working!

Main challenges that I had and how I solved them in the order of implementation:
  1. Installing Cygwin: be sure to install the "devel" package in order to install cpputest via cygwin
  2. The build location that comes with the imported project (after importing the project to eclipse using Import-->General-->Existing Projects) is not correct. The original path was: "${workspace_loc:/BookCode}/Default" but this is wrong. Instead, just remove the "/Default" from the path and then the make should work. 
  3. When assigning a path to CPPUTEST_HOME via eclipse go to:  project properties --> C/C++ Build --> Environment
  4. The path that is assigned to CPPUTEST_HOME must NOT include spaces AND ALSO must not include any "C:/" - instead if you want to include directory name use cygwin syntax: /cygdrive/c/
  5. By default the project is set to make both unity and cpputest so if you only want to check cpputest be sure to update the Makefile.
David
Reply all
Reply to author
Forward
0 new messages