jwgrenning / cpputest-starter-project Goto Github PK
View Code? Open in Web Editor NEWgcc cpputest starter project, with instructions to help get your legacy code into cpputest for the first time
License: MIT License
gcc cpputest starter project, with instructions to help get your legacy code into cpputest for the first time
License: MIT License
Hi, I get the following error when running "make all" according to the guide in the README,
compiling ExampleTest.cpp
tests/ExampleTest.cpp:10:10: fatal error: 'setup' overrides a member function but is not marked 'override' [-Wsuggest-override]
void setup()
^
/Users/xx/tools/cpputest/include/CppUTest/Utest.h:55:18: note: overridden virtual function is here
virtual void setup();
^
1 error generated.
make: *** [test-obj/tests/ExampleTest.o] Error 1
Im running on Mac
However when using the alternative in step 7) Docker support,
docker-compose run cpputest make all
Everything compiles and the tests run as expected.
Any idea whats going wrong here?
Hello
In your readme there are some commands like the following one:
./unit-tests/docker/run.sh "make -C unit-test"
I think there is an 's' missing at the end:
./unit-tests/docker/run.sh "make -C unit-tests"
Hello James
do you know, is there a way to activate html coverage output in the startup project?
My best to you
Marco
There is a good chance I misunderstood the reason for the docker image as I am not too familiar with it..... My initial thoughts was that it contains cpputest and all that is needed to run the tests. However the container doesn't have it.
I ask because I'm developing on Windows and installing CppUTest on Windows has proven difficult and I thought this would be a quick way to have CppUTest on my dev machine!
Thanks James and everyone else for making these great tools, they are really such a time saver.
Thanks for the awesome tools!
I am targeting a 32bit embedded system and so wanted my tests to have a similar setup. I spent a while trying to get this starter project and cpputest to work together but in 32bit rather than 64.
I managed it by changing the docker image from gcc to debian with the dockerfile below, reconfiguring cpputest for 32bit and installing gcc and multilib myself:
FROM debian:bullseye
RUN apt-get update \
&& apt-get install --assume-yes --no-install-recommends --quiet \
build-essential \
gcc-multilib \
g++-multilib \
git \
autoconf \
automake \
libtool
RUN apt-get install --assume-yes --reinstall ca-certificates
WORKDIR /home/cpputest
RUN git clone --depth 1 --branch v4.0 https://github.com/cpputest/cpputest.git .
RUN autoreconf . -i
RUN ./configure CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 --build=x86_64-pc-linux-gnu --host=i686-pc-linux-gnu
RUN make install
ENV CPPUTEST_HOME=/home/cpputest
WORKDIR /home/legacy-build
RUN git clone https://github.com/jwgrenning/legacy-build.git .
RUN git submodule update --init
RUN bash test/all-tests.sh
WORKDIR /home/src
In the makefile I needed to pass the appropriate m32 args to the compiler and linker via the cpputest make variables:
CPPUTEST_CFLAGS += -m32
CPPUTEST_LDFLAGS += -m32
CPPUTEST_CXXFLAGS += -m32
CPPUTEST_CPPFLAGS += -m32
Is there an easier way I am missing? If not then maybe this can be turned into some docs somewhere and might help others.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.