jenkins does not recognize the errors when building the cpp code

I am using jenkins for my CI server but i have problems when i want to build the project because jenkins does not recognize the compilation errors.This is my problem:

creating objects directory obj
g++ -I../src -I third-party/cppunit-1.12.1/include -fPIC -g -Wall -c booktest.cpp -o obj/booktest.o
g++ -I../src -I third-party/cppunit-1.12.1/include -fPIC -g -Wall -c reader/bookreadertest.cpp -o obj/reader/bookreadertest.o
g++ -I../src -I third-party/cppunit-1.12.1/include -fPIC -g -Wall -c indexer/indexertest.cpp -o obj/indexer/indexertest.o
indexer/indexertest.cpp: In constructor ‘IndexerTest::IndexerTest()’:
indexer/indexertest.cpp:17:12: error: ‘failMethod’ was not declared in this scope
make: *** [obj/indexer/indexertest.o] Error 1
creating objects directory obj
g++ -I ../src -fPIC -g -Wall -c src/main.cpp -o obj/src/main.o
g++ -o oreallybooks -fPIC -g -Wall obj/src/main.o -L/user/local/lib -L../src/lib -loreally -lm
Finished: SUCCESS



I am using  bash files to build and clean the cpp project
I "execute shell" for "build steps" in jenkins and this is the command:

/var/lib/jenkins/jobs/OreallyBooks/workspace/buildProject

"buildProject" is bash file and contains:


!/bin/bash
cd src;
make;
cd ../test;
make;
cd ../ui
make;

Someone can help me please? thanks all

Answers


If anything other than the final make fails then the bash script will ignore the error.

You need to set the script to fail on first error

#!/bin/bash -e

Stop on first error


Need Your Help

SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”. when running JUnit test

java spring hibernate junit slf4j

I'm building some test cases with JUnit to test my application, but when I try to run them I get the error:

An entity object cannot be referenced by multiple instances of IEntityChangeTracker

asp.net-mvc entity-framework asp.net-mvc-2 entity-framework-4

hey guys, i am working in a MVC2 project with EF4 and i am having the following exception:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.