Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] IProject#build does not throw exception on build failure

Chris Recoskie wrote:
I guess it depends on the cirumstances for the failure. There is a difference between "the build attempt completed, but the build itself had compile/link errors" and "something went wrong and the build attempt failed to execute (e.g. couldn't invoke the build command)." I think we will throw the exceptions for the latter, but not the former. This is by design.

Ok, that's probably it. I'm getting an (expected) link failure due to a missing symbol, and I thought that that would generate an exception.

Is there a way to know if there were any compile/link errors? In my case I can just hook into my error-parser to figure out if a failure has occured, but it kind of would be nice if there was a status code somewhere I could check.

===========================
Chris Recoskie
Team Lead, IBM CDT and RDT
IBM Toronto
Inactive hide details for Jesper Eskilson <jesper.eskilson@xxxxxx>Jesper Eskilson <jesper.eskilson@xxxxxx>


                        *Jesper Eskilson <jesper.eskilson@xxxxxx>*
                        Sent by: cdt-dev-bounces@xxxxxxxxxxx

                        05/24/2009 02:45 AM
                        Please respond to
                        "CDT General developers list." <cdt-dev@xxxxxxxxxxx>

	

To
	
"CDT General developers list." <cdt-dev@xxxxxxxxxxx>

cc
	

Subject
	
[cdt-dev] IProject#build does not throw exception on build failure

	



I'm trying to adapt the managedbuilder toolchain tests to our toolchain
implementation, and attempted to generate a small project, build it and
make sure it fails under certain conditions. The test method looks like
this:

 >     public void testBuild() throws CoreException {
> IProject project = ManagedBuildTestHelper.createProject(PROJECT_NAME,
 >                 "iar.toolchain.exe");
 >
 >         ManagedBuildTestHelper.createFile(project, C_SRC_NAME);
> // IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); > // IConfiguration cfg = info.getManagedProject().getConfigurations()[0];
 >
 >         project.build(IncrementalProjectBuilder.FULL_BUILD, null);
 >         project.refreshLocal(IResource.DEPTH_INFINITE, null);
 >         IResource res = project.findMember(C_OBJ_NAME);
 >         assertNotNull(res);
 >
 >         ManagedBuildTestHelper.removeProject(PROJECT_NAME);
 >     }

The build() method in IProject is documented to throw a CoreException if
the build fails, but nothing is thrown, but stepping through the code
shows that the build does fail.

Is this a (known) bug?

--
/Jesper


_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


------------------------------------------------------------------------

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


--
/Jesper




Back to the top