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

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.

What are the types of scenarios where you are not getting the exception, when you think you should be?

===========================
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

GIF image

GIF image

GIF image


Back to the top