This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 245538 - Makefile .test-conf always returns true
Summary: Makefile .test-conf always returns true
Status: RESOLVED WONTFIX
Alias: None
Product: cnd
Classification: Unclassified
Component: UnitTest Support (show other bugs)
Version: 8.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: ilia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-10 08:56 UTC by mark.r.cullen
Modified: 2016-06-15 13:28 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mark.r.cullen 2014-07-10 08:56:36 UTC
I have written a script which uses lcov to produce a coverage report. It is very simple and basically just runs:

make clean &> /tmp/<some file>
make build &> /tmp/<some file>
make test &> /tmp/<some file>
lcov

For each of these steps, I check the exit code to see if I need to stop and dump the contents of the redirected output.

I am using gtest for a unit test framework. I would like the `make test` step to stop if any unit tests fail, but the .test-conf target seems to fudge the exit code such that it always returns 0 / "true".

# Run Test Targets
.test-conf:
	@if [ "${TEST}" = "" ]; \
	then  \
	    ${TESTDIR}/TestFiles/f1 || true; \
	else  \
	    ./${TEST} || true; \
	fi

Is there any particular reason for this behaviour? Is it a bug? Is there a workaround so that `make test` will return the exit code of the test, rather than always returning "true"?
Comment 1 ilia 2016-06-15 13:28:44 UTC
Hi,

.test-conf is intended to work like this.
The "|| true" command is needed to continiue test execution even if one of them fails. It's a project managed by IDE, you can create the unmanaged one (with existing sources) and customize a makefile.

A temporary workaraund may be:
add echoing of "FAILED" string to your tests and grep the output.