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 255659 - C Makefile project fails to declare relative TESTDIR
Summary: C Makefile project fails to declare relative TESTDIR
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: UnitTest Support (show other bugs)
Version: 8.0.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: ilia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-02 10:05 UTC by ILMostro7
Modified: 2016-07-19 12:28 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (70.19 KB, text/plain)
2015-10-02 10:05 UTC, ILMostro7
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ILMostro7 2015-10-02 10:05:22 UTC
Product Version = NetBeans IDE 8.0.2 (Build 201411181905)
Operating System = Linux version 3.10.0-306.0.1.el7.x86_64 running on amd64
Java; VM; Vendor = 1.8.0_51
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.51-b03

Creating a C Makefile project and creating a "simple C unit test" attempts to create "TestFiles" directory on the root (/) folder.
I'm assuming this is because the linkertool is referring to an undeclared variable "{TESTDIR}" in "{TESTDIR}/TestFiles/...".

Here's the configuration.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="95">
  <logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
    <logicalFolder name="HeaderFiles"
                   displayName="Header Files"
                   projectFiles="true">
    </logicalFolder>
    <logicalFolder name="ResourceFiles"
                   displayName="Resource Files"
                   projectFiles="true">
    </logicalFolder>
    <logicalFolder name="SourceFiles"
                   displayName="Source Files"
                   projectFiles="true">
      <itemPath>main.c</itemPath>
    </logicalFolder>
    <logicalFolder name="TestFiles"
                   displayName="Test Files"
                   projectFiles="false"
                   kind="TEST_LOGICAL_FOLDER">
    </logicalFolder>
    <logicalFolder name="ExternalFiles"
                   displayName="Important Files"
                   projectFiles="false"
                   kind="IMPORTANT_FILES_FOLDER">
      <itemPath>Makefile</itemPath>
    </logicalFolder>
  </logicalFolder>
  <projectmakefile>Makefile</projectmakefile>
  <confs>
    <conf name="Debug" type="1">
      <toolsSet>
        <compilerSet>default</compilerSet>
        <dependencyChecking>true</dependencyChecking>
        <rebuildPropChanged>false</rebuildPropChanged>
      </toolsSet>
      <compileType>
      </compileType>
      <folder path="TestFiles/f1">
        <cTool>
          <incDir>
            <pElem>.</pElem>
          </incDir>
        </cTool>
        <ccTool>
          <incDir>
            <pElem>.</pElem>
          </incDir>
        </ccTool>
        <linkerTool>
          <output>${TESTDIR}/TestFiles/f1</output>
        </linkerTool>
      </folder>
      <item path="main.c" ex="false" tool="0" flavor2="0">
      </item>
    </conf>
    <conf name="Release" type="1">
      <toolsSet>
        <compilerSet>default</compilerSet>
        <dependencyChecking>true</dependencyChecking>
        <rebuildPropChanged>false</rebuildPropChanged>
      </toolsSet>
      <compileType>
        <cTool>
          <developmentMode>5</developmentMode>
        </cTool>
        <ccTool>
          <developmentMode>5</developmentMode>
        </ccTool>
        <fortranCompilerTool>
          <developmentMode>5</developmentMode>
        </fortranCompilerTool>
        <asmTool>
          <developmentMode>5</developmentMode>
        </asmTool>
      </compileType>
      <folder path="TestFiles/f1">
        <cTool>
          <incDir>
            <pElem>.</pElem>
          </incDir>
        </cTool>
        <ccTool>
          <incDir>
            <pElem>.</pElem>
          </incDir>
        </ccTool>
        <linkerTool>
          <output>${TESTDIR}/TestFiles/f1</output>
        </linkerTool>
      </folder>
      <item path="main.c" ex="false" tool="0" flavor2="0">
      </item>
    </conf>
  </confs>
</configurationDescriptor>

Finally, the build output follows:

"/usr/bin/gmake" -f nbproject/Makefile-Release.mk QMAKE= SUBPROJECTS= .build-conf
gmake[1]: Entering directory `/home/user/NetBeansProjects/capp2'
"/usr/bin/gmake"  -f nbproject/Makefile-Release.mk /TestFiles/f1
gmake[2]: Entering directory `/home/user/NetBeansProjects/capp2'
mkdir -p build/Release/GNU-Linux-x86
rm -f "build/Release/GNU-Linux-x86/main.o.d"
gcc    -c -O2 -I. -MMD -MP -MF "build/Release/GNU-Linux-x86/main.o.d" -o build/Release/GNU-Linux-x86/main.o main.c
mkdir -p /TestFiles
mkdir: cannot create directory ‘/TestFiles’: Permission denied
gmake[2]: *** [/TestFiles/f1] Error 1
gmake[2]: Leaving directory `/home/user/NetBeansProjects/capp2'
gmake[1]: *** [.build-conf] Error 2
gmake[1]: Leaving directory `/home/user/NetBeansProjects/capp2'
gmake: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 231ms)
Comment 1 ILMostro7 2015-10-02 10:05:25 UTC
Created attachment 156489 [details]
IDE log