Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] indexer timeout while debugging index tests

I have a special method that I use for debugging.  You can see the implementation at the bottom of the BaseQtTestCase
class in the org.eclipse.cdt.qt.tests plugin.

I use this for debugging by putting a call to this method into the test method after the point where the indexer
activity is launched.  When I eventually finish debugging, I manually suspend the main thread and then change the value
of pause to false (the comment on line 156 is so that I can use Ctrl-U to do this) and step out of the method.

For example, QtIndexTests has:

	// #include "junit-QObject.hh"
	// class B : public QObject
	// {
	// Q_OBJECT
	// };
	public void testLookup() throws Exception {
		loadComment(Filename_testCache);

		QtIndex qtIndex = QtIndex.getIndex(fProject);
		assertNotNull(qtIndex);
	...

So I would use this with:


	// #include "junit-QObject.hh"
	// class B : public QObject
	// {
	// Q_OBJECT
	// };
	public void testLookup() throws Exception {
		loadComment(Filename_testCache);
	pause();
		QtIndex qtIndex = QtIndex.getIndex(fProject);
		assertNotNull(qtIndex);
	...

The call to loadComment kicks off the indexer activity returns.  The main thread then goes into a loop that wakes every
10 seconds to see if it should continue.  I can pause for as long as I want in the indexer.  Then (through manual
intervention) I can continue the test case to check the results.

-Andrew

On 13-12-14 07:40 PM, Nathan Ridge wrote:
> Every time I try to debug an index test (e.g. a test case in
> IndexCPPTemplateResolutionTests), I run into the problem that the
> indexer timeout is reached while I am stopped at a breakpoint.
> 
> I have been working around this by manually adjusting
> BaseTestCase.INDEXER_TIMEOUT_SEC every time I debug a test case,
> but I am wondering, is there a better way?
> 
> Thanks,
> Nate 		 	   		  
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 



Back to the top