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 227010 - NetBeans 7.3 fails to build CUnit tests under Windows 7
Summary: NetBeans 7.3 fails to build CUnit tests under Windows 7
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.3
Hardware: PC All
: P2 normal (vote)
Assignee: igor_nikiforov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-05 00:22 UTC by wissenstein
Modified: 2013-05-15 10:56 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (49.63 KB, text/plain)
2013-03-05 00:22 UTC, wissenstein
Details
netbeans 7.3 not open (29.88 KB, application/octet-stream)
2013-04-18 07:19 UTC, kuldeepsuman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description wissenstein 2013-03-05 00:22:11 UTC
Product Version = NetBeans IDE 7.3 (Build 201302132200)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.7.0_11
Runtime = Java HotSpot(TM) Client VM 23.6-b04
Cygwin version 1.7.17-1
CUnit version 2.1-2 installed on Cygwin.

Create C project with default settings.
In main.c add function 

int add(int addend, int augend) {
    return (addend + augend);
}

In Projects pane right-click main.c and choose Create Test — New CUnit Test.
In the master select function add(int,int):int to generate tests for it.
Click button Next.

Actual result: Message appears on the bottom of the master panel: "cunit library is not detected. Test compilation might fail".
Expected result: CUnit is detected successfully.

Click button Finish.
Folder Test Files in Projects pane contains node New CUnit Test and file newcunittest.c in it.
Right-click on the project root and choose Test.

Actual result: Building tests fails with such output:

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/cunit-experiments.exe
make[2]: Entering directory `/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments'
make[2]: `dist/Debug/Cygwin-Windows/cunit-experiments.exe' is up to date.
make[2]: Leaving directory `/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments'
make[1]: Leaving directory `/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-tests-conf
make[1]: Entering directory `/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/Cygwin-Windows/cunit-experiments.exe
make[2]: Entering directory `/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments'
make[2]: `dist/Debug/Cygwin-Windows/cunit-experiments.exe' is up to date.
make[2]: Leaving directory `/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments'
mkdir -p build/Debug/Cygwin-Windows/tests/TestFiles
gcc       -o build/Debug/Cygwin-Windows/tests/TestFiles/f1 build/Debug/Cygwin-Windows/tests/tests/newcunittest.o build/Debug/Cygwin-Windows/main_nomain.o  `cppunit-config --libs`   
/bin/sh: cppunit-config: command not found
build/Debug/Cygwin-Windows/tests/tests/newcunittest.o: In function `testAdd':
/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments/tests/newcunittest.c:31: undefined reference to `_CU_assertImplementation'
build/Debug/Cygwin-Windows/tests/tests/newcunittest.o: In function `main':
/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments/tests/newcunittest.c:39: undefined reference to `_CU_initialize_registry'
/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments/tests/newcunittest.c:40: undefined reference to `_CU_get_error'
/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments/tests/newcunittest.c:43: undefined reference to `_CU_add_suite'
/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments/tests/newcunittest.c:45: undefined reference to `_CU_cleanup_registry'
/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments/tests/newcunittest.c:46: undefined reference to `_CU_get_error'
/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments/tests/newcunittest.c:50: undefined reference to `_CU_add_test'
/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments/tests/newcunittest.c:51: undefined reference to `_CU_cleanup_registry'
/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments/tests/newcunittest.c:52: undefined reference to `_CU_get_error'
/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments/tests/newcunittest.c:56: undefined reference to `_CU_basic_set_mode'
/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments/tests/newcunittest.c:57: undefined reference to `_CU_basic_run_tests'
/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments/tests/newcunittest.c:58: undefined reference to `_CU_cleanup_registry'
/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments/tests/newcunittest.c:59: undefined reference to `_CU_get_error'
collect2: ld returned 1 exit status
nbproject/Makefile-Debug.mk:82: recipe for target `build/Debug/Cygwin-Windows/tests/TestFiles/f1' failed
make[1]: *** [build/Debug/Cygwin-Windows/tests/TestFiles/f1] Error 1
make[1]: Leaving directory `/cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments'
nbproject/Makefile-impl.mk:67: recipe for target `.build-tests-impl' failed
make: *** [.build-tests-impl] Error 2


BUILD TESTS FAILED (exit value 2, total time: 2s)

Expected result: Test Results pane appears.
Comment 1 wissenstein 2013-03-05 00:22:16 UTC
Created attachment 132176 [details]
IDE log
Comment 2 soldatov 2013-03-07 06:59:51 UTC
(In reply to comment #0)
> gcc       -o build/Debug/Cygwin-Windows/tests/TestFiles/f1
> build/Debug/Cygwin-Windows/tests/tests/newcunittest.o
> build/Debug/Cygwin-Windows/main_nomain.o  `cppunit-config --libs`   
> /bin/sh: cppunit-config: command not found
> build/Debug/Cygwin-Windows/tests/tests/newcunittest.o: In function `testAdd':
> /cygdrive/d/Users/Wissenstein/projekte/netbeans-testing/cunit-experiments/tests/newcunittest.c:31:
> undefined reference to `_CU_assertImplementation'
Your build log has strange line (cppunit-config). cppunit-config is CppUnit framework.
Comment 3 wissenstein 2013-03-07 22:38:54 UTC
Yes, it is. Therefore I think that this is a bug.
Comment 4 soldatov 2013-03-14 08:45:34 UTC
Scenario:
- Create "Input Output Application" sample
- Call context menu on io.c
- Select Create Test|New CUnit Test ...
- Select 'go()' node. Press Next. Press Finish
- Call context menu on 'New CUnit Test' node. Select Properties.
==>
"C Compiler", "C++ Compiler" and "Linker" categories contains `cppunit-config --cflags` or `cppunit-config --libs`

Workaround:
remove all cppunit-*
add "-lcunit" into Linker|Libraries|Add Option...|Other Option field
Comment 5 kuldeepsuman 2013-04-18 07:19:37 UTC
Created attachment 133549 [details]
netbeans 7.3 not open
Comment 6 igor_nikiforov 2013-05-15 10:56:45 UTC
The issue can be reproduced on any system where cppunit is not installed.

Here is the fix:
  http://hg.netbeans.org/cnd-main/rev/9efbd069e1f3