Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Boost .TEST macros and VA
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

xxluda
Senior Member

27 Posts

Posted - Mar 10 2009 :  07:30:05 AM  Show Profile  Reply with Quote
Hi,
After solving problem with Boost foreach macro, I want to solve similar problem with Boost .TEST macros.

In copy of VA's StdAfx in current user directory I added following lines:

#define BOOST_AUTO_TEST_CASE(x) void x::x()
#define BOOST_FIXTURE_TEST_CASE(X,Y) void X_Y()
#define BOOST_AUTO_TEST_SUITE(x) class x {
#define BOOST_FIXTURE_TEST_SUITE(X,Y) class Y { 
#define BOOST_AUTO_TEST_SUITE_END };
#define BOOST_REQUIRE_EQUAL(x,y)  x;
#define BOOST_TEST_MESSAGE(x) x;
#define BOOST_REQUIRE(x) x;
#define BOOST_CHECK_EQUAL(x, y) x;


( examples with correct use of these macros are e.g. here http://www.boost.org/doc/libs/1_38_0/libs/test/doc/html/utf/user-guide/fixture/test-suite-shared.html)

But when VA parser found following lines in my code, starts underline all correct expressions:



//...
//Code before this macro is correctly parsed...
//..

BOOST_FIXTURE_TEST_SUITE( RestProtocol, RestProtocolBasicFixture)

//
//after this macro, all variables are underlined ( variables pConnection1, pConnection2, pConnStruct, pConnStructErr, ... )
//
void Initialization(CVirtualDataProvider * pConnection1, CVirtualDataProvider * pConnection2)
{
	DataProviderConnectionStruct * pConnStruct = CGlobalAtomixORM::Instance().GetConnectionStruct();
	DataProviderConnectionStruct * pConnStructErr = pConnStruct->CreateConnectionStructCopy();
	pConnStructErr->strCatalog = _T("ERR");



Is anything wrong in VA's StdAfx.h definitions ?

Thanks for reply
Ludek Vodicka

Ludek Vodicka
ORM-Designer Chief developer www.orm-designer.com

xxluda
Senior Member

27 Posts

Posted - Mar 10 2009 :  07:44:11 AM  Show Profile  Reply with Quote
I'm also try :


#define BOOST_FIXTURE_TEST_SUITE(X,Y) void Y::Test() { 


without any change.

But I find out, that when I move mouse over BOOST_FIXTURE_TEST_SUITE macro, VA show me following tooltip :


This mean, that VA use default BOOST macro instead of VA's stdaf.h macro ?


Thanks,
LV

Ludek Vodicka
ORM-Designer Chief developer www.orm-designer.com
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16945 Posts

Posted - Mar 11 2009 :  4:04:30 PM  Show Profile  Reply with Quote
I also had problems with your test code and these macros in VA's StdAfx.h file. However even if VA uses these dummy macros correctly, the code you posted with produce this effect, since you have introduced an unmatched curly bracket.

As a test I added:

#define BOOST_FIXTURE_TEST_SUITE

to VA's StdAfx.h file, rebuilt VA's symbol database (required after you edit the StdAfx.h file) and then re-tried your test code. This fixed the extra underlining, and now only the unknown types are underlined for me.

zen is the art of being at one with the two'ness
Go to Top of Page

xxluda
Senior Member

27 Posts

Posted - Mar 12 2009 :  09:13:01 AM  Show Profile  Reply with Quote
Hi,
when I use your macro :
#define BOOST_FIXTURE_TEST_SUITE

instead of mine :
#define BOOST_FIXTURE_TEST_SUITE(X,Y) class Y {
,
VA doesn't help me with Fixtures variables.
Boost .Test provide fixture mechanism, which offer initial and deinitial code. In whole test suite I'm able to access fixture variables, as demonstrate following code :


struct RestProtocolBasicFixture 
{
 int nVariable;
 RestProtocolBasicFixture() {}
 ~ RestProtocolBasicFixture() {}
};

BOOST_FIXTURE_TEST_SUITE( RestProtocol, RestProtocolBasicFixture)

void Initialization(CVirtualDataProvider * pConnection1, CVirtualDataProvider * pConnection2)
{
  //Access fixture "RestProtocolBasicFixture" variable nVariable
  nVariable = 10;
}

BOOST_AUTO_TEST_SUITE_END
...


You wrote "since you have introduced an unmatched curly bracket.". I don't know if I understand correctly, but my macro "BOOST_FIXTURE_TEST_SUITE" is translated to "class Y {" and closing macro "BOOST_AUTO_TEST_SUITE_END" is translated to "};" . After that, I don't have any unmatched bracket.



Ludek Vodicka
ORM-Designer Chief developer www.orm-designer.com
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16945 Posts

Posted - Mar 12 2009 :  3:11:09 PM  Show Profile  Reply with Quote
Your first sample code did not call BOOST_AUTO_TEST_SUITE_END, so I did not know you were closing the curly bracket like that.

I have run some tests here. Simply turning on deep macro parsing, as explained in this FAQ entry:

http://docs.wholetomato.com?W363

helped, but it did not help enough. With this turned on, and your dummy macro's added to VA's StdAfx.h file this appears to be working correctly. "nVariable" is recognised as a member of the struct RestProtocolBasicFixture when used inside the Initialization function.

Can you try turning on deep macro parsing and see what results you get?

zen is the art of being at one with the two'ness
Go to Top of Page

xxluda
Senior Member

27 Posts

Posted - Mar 12 2009 :  3:50:21 PM  Show Profile  Reply with Quote
When I turn deep macro parsing on, then whole file looks ok.
I try this deep macro settings later but without VA's stdafx.h modifications, which leads to massive slowdown of whole Visual studio. With VA's stdafx.h #defines I didn't notice any slowdown.

Thanks for help.
LV

Ludek Vodicka
ORM-Designer Chief developer www.orm-designer.com
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16945 Posts

Posted - Mar 16 2009 :  2:16:13 PM  Show Profile  Reply with Quote
I am not surprised this causes VA to slow down. The deep macro parsing is telling VA to do a lot more work, on complex macros.

We are working on some changes that *may* help with these macro's. Hopefully we will have something in the next build or two, but you will have to try it and see if it helps or not in your case:

case=25115

zen is the art of being at one with the two'ness
Go to Top of Page

xxluda
Senior Member

27 Posts

Posted - Mar 16 2009 :  3:01:37 PM  Show Profile  Reply with Quote
After several days with these VA settings I found following things.

First, sometimes whole file was underlined as errors, after few seconds is all ok, and after next few seconds is all wrong again.

Second thing, sometimes after I changed VA's stdafx, full rebuild didn't help and I have to delete all tmp VA's file manually to perform correct rebuild.

And occasionally, I have to rebuild symbol database twice, because in first attempt some macros aren't recognized correctly (I'm deleting symbol DB before every try).

I'm looking forward to next version of these parsers, because editing files without VA's help is realy frustrating ;-).

Ludek Vodicka
ORM-Designer Chief developer www.orm-designer.com
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16945 Posts

Posted - Mar 17 2009 :  1:29:07 PM  Show Profile  Reply with Quote
I am not sure what is going on here, but clearly VA is having some problems with these macro's.

The underlining disappearing and reappearing, VA only applies underlining after editing a file. Simply opening a file is not enough to trigger underlining.

Secondly underlining can disappear after an edit, only to re-appear when VA has recalculated what to underline. Adding new lines to a file moves the underlining down, and editing the code can significantly change what should be underlined, so this will partly explain what you are seeing with the underlining.

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16945 Posts

Posted - Apr 16 2009 :  5:46:19 PM  Show Profile  Reply with Quote
If you are using VA 1721 or above then there is something you can try to speed things up. Firstly make sure you have turned on macro parsing as described in this FAQ entry:

http://docs.wholetomato.com?W363

Then with all instances of the IDE closed set the registry key:

HKCU \\ Software \\ Whole Tomato \\ Visual Assist X \\ LimitMacro = "NoDepthLimit"

instead of the old value of "No".

The macro parsing should be quite a bit faster. Can you please let me know if this makes any difference or not.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000