Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 254983

Summary: Unit testing suite for CDT project model
Product: [Tools] CDT Reporter: Andrew Gvozdev <angvoz.dev>
Component: cdt-buildAssignee: cdt-build-inbox <cdt-build-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: jamesblackburn+eclipse
Version: 6.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 251962, 259964    
Bug Blocks:    
Attachments:
Description Flags
work-in-progress test suite
none
testExecutableCygwinGcc added none

Description Andrew Gvozdev CLA 2008-11-12 00:00:04 EST
There are some attempts in progress to revise project description model/persistence/build which may benefit from a test suite covering existing project model in detail. Having assurance that project model is unchanged after refactorings hopefully may facilitate these efforts.
Comment 1 Andrew Gvozdev CLA 2008-11-12 00:13:21 EST
Created attachment 117622 [details]
work-in-progress test suite

Here is the first version, please feel free to give any feedback. Number of files in the patch and the size of this thing corresponds to the complexity of project description model, so the patch is compressed. So far there are 3 test cases, one covers loading project description from sample .cproject, another creating/persisting project from build definition extension point, and third one creates and examines a Standard Make project. I'd say the tests are pretty thorough.
Comment 2 Andrew Gvozdev CLA 2008-11-12 00:51:02 EST
Btw, if you have NPE in the second test case, try to apply patch from bug 251962.
Comment 3 Andrew Gvozdev CLA 2008-11-16 23:46:27 EST
Created attachment 118020 [details]
testExecutableCygwinGcc added

Refactored quite a bit and a new test case added. Still work in progress.
Comment 4 James Blackburn CLA 2008-11-30 11:19:16 EST
Hi Andrew,

Just had a quick look at these tests.  Unfortunately all of them are failing on current HEAD. (Also testProjectDescriptionSerializationFromFile appears to be missing some required resources.)

Maybe there's a less brittle way of testing the project model funcationality?  I think concrete tests for existing funcatinality / API is good, but tests which are implementation specific are likely to break more easily.
Comment 5 Andrew Gvozdev CLA 2012-12-12 09:43:51 EST
This test suite is not nearly robust enough to sustain even miniscule changes in project model. It was more of a personal learning experience.