Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328867 - Override some C++ 0x test cases in LR parser test suite in head stream
Summary: Override some C++ 0x test cases in LR parser test suite in head stream
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Chris Recoskie CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
: 335250 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-10-27 13:53 EDT by John Liu CLA
Modified: 2011-03-15 14:58 EDT (History)
6 users (show)

See Also:


Attachments
Applied to org.eclipse.cdt.core.lrparser.tests in head stream (5.04 KB, text/plain)
2010-10-27 13:54 EDT, John Liu CLA
no flags Details
This patch includes the above 181857 attached patch (5.70 KB, text/plain)
2011-01-25 11:11 EST, John Liu CLA
jamesblackburn+eclipse: iplog+
Details
Patch applied to 702 stream (1.10 KB, text/plain)
2011-01-25 11:41 EST, John Liu CLA
jamesblackburn+eclipse: iplog+
Details
patch to fix the last LR test failures, for Head stream (1.06 KB, text/plain)
2011-01-28 13:52 EST, John Liu CLA
no flags Details
The patch I mentioned, apply to Head stream (1.31 KB, text/plain)
2011-01-28 15:44 EST, John Liu CLA
vivkong: iplog+
Details
Token map fix patch to 70 stream (905 bytes, text/plain)
2011-02-01 15:58 EST, John Liu CLA
vivkong: iplog+
Details
patch applied to token maps of isocpp and xlc parser (1.77 KB, text/plain)
2011-02-07 11:32 EST, John Liu CLA
vivkong: iplog+
Details
lrparsers.tests patch to overwrite some new test cases (1.92 KB, text/plain)
2011-03-09 16:25 EST, John Liu CLA
recoskie: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Liu CLA 2010-10-27 13:53:26 EDT
Build Identifier: 

LR parser doesn't support some C++ 0x features yet, but its test suite inherits all of test cases from CDT core parser test suite, so we need to override these unsupported test cases for now.

Reproducible: Always
Comment 1 John Liu CLA 2010-10-27 13:54:31 EDT
Created attachment 181857 [details]
Applied to org.eclipse.cdt.core.lrparser.tests in head stream
Comment 2 John Liu CLA 2011-01-25 11:05:54 EST
*** Bug 335250 has been marked as a duplicate of this bug. ***
Comment 3 John Liu CLA 2011-01-25 11:11:21 EST
Created attachment 187532 [details]
This patch includes the above 181857 attached patch

Applied to org.eclipse.cdt.core.lrparser.tests in head stream
Comment 4 John Liu CLA 2011-01-25 11:41:35 EST
Created attachment 187538 [details]
Patch applied to 702 stream

Patch applied to 702 stream
Comment 5 James Blackburn CLA 2011-01-26 14:02:47 EST
I've committed the patches to nobble the tests. 

Are you responsible for the XLC tests as well?
Comment 7 John Liu CLA 2011-01-26 16:08:07 EST
(In reply to comment #5)
> I've committed the patches to nobble the tests. 
> Are you responsible for the XLC tests as well?

Thanks James, for checking the patch in. It covers the XLC tests as well.
Comment 8 James Blackburn CLA 2011-01-26 16:51:00 EST
Great that's made a big difference! A few still remain:
https://hudson.eclipse.org/hudson/job/cdt-nightly/lastCompletedBuild/testReport/
Comment 9 John Liu CLA 2011-01-26 23:59:21 EST
(In reply to comment #8)
> Great that's made a big difference! A few still remain:
> https://hudson.eclipse.org/hudson/job/cdt-nightly/lastCompletedBuild/testReport/

Hmm... It passed all tests in my workspace.. I will take a look at it tomorrow.
Comment 10 Markus Schorn CLA 2011-01-27 04:53:21 EST
(In reply to comment #9)
> (In reply to comment #8)
> > Great that's made a big difference! A few still remain:
> > https://hudson.eclipse.org/hudson/job/cdt-nightly/lastCompletedBuild/testReport/
> Hmm... It passed all tests in my workspace.. I will take a look at it tomorrow.

Because I have just caused a junit-failure, I came accross the remaining failures in the LR-parser test. They are due to a failling assertion. To see it you need to enable assertions using the option -ea.
The particular assertion shall help to detect cases where the parser attempts to compute the string-representation for a template-id. However, this is ok when used for reporting a problem-binding, I have changed org.eclipse.cdt.core.lrparser.tests.ParseHelper accordingly.
Comment 11 John Liu CLA 2011-01-27 10:28:15 EST
(In reply to comment #10)
> (In reply to comment #9)
> > (In reply to comment #8)
> > > Great that's made a big difference! A few still remain:
> > > https://hudson.eclipse.org/hudson/job/cdt-nightly/lastCompletedBuild/testReport/
> > Hmm... It passed all tests in my workspace.. I will take a look at it tomorrow.
> Because I have just caused a junit-failure, I came accross the remaining
> failures in the LR-parser test. They are due to a failling assertion. To see it
> you need to enable assertions using the option -ea.
> The particular assertion shall help to detect cases where the parser attempts
> to compute the string-representation for a template-id. However, this is ok
> when used for reporting a problem-binding, I have changed
> org.eclipse.cdt.core.lrparser.tests.ParseHelper accordingly.

I still can't see these failures in my workspace. Is it because I didn't enable assertion option -ea? How can I enable this option?
Comment 12 John Liu CLA 2011-01-27 15:39:16 EST
(In reply to comment #11)
> (In reply to comment #10)
> > (In reply to comment #9)
> > > (In reply to comment #8)
> > > > Great that's made a big difference! A few still remain:
> > > > https://hudson.eclipse.org/hudson/job/cdt-nightly/lastCompletedBuild/testReport/
> > > Hmm... It passed all tests in my workspace.. I will take a look at it tomorrow.
> > Because I have just caused a junit-failure, I came accross the remaining
> > failures in the LR-parser test. They are due to a failling assertion. To see it
> > you need to enable assertions using the option -ea.
> > The particular assertion shall help to detect cases where the parser attempts
> > to compute the string-representation for a template-id. However, this is ok
> > when used for reporting a problem-binding, I have changed
> > org.eclipse.cdt.core.lrparser.tests.ParseHelper accordingly.
> I still can't see these failures in my workspace. Is it because I didn't enable
> assertion option -ea? How can I enable this option?

I guess I see the reasons.

The test failures James mentioned from yesterday afternoon build maybe because of the delay of cdt cvs code checking in, my patch was not in cvs yet when the build started.

The test failure Markus mentioned is a new one and has been fixed in XLC parser helper class by Markus.

There is one xlc parser failure left in the latest build, but it is passed in my workspace. Let's see next build if we can resolve all these xlc parser failures.
Comment 13 James Blackburn CLA 2011-01-27 15:48:20 EST
-ea is a VM argument you can pass it to the JVM in the launch configuration.
Comment 14 John Liu CLA 2011-01-28 13:52:31 EST
Created attachment 187864 [details]
patch to fix the last LR test failures, for Head stream

I see the problem, '#' is not a legal token in LR parser but is a valid token in GNU parser, when LR parser tries to map it, the token mapper asserts false for an invalid token (#), the AssertionError is caught by the test.

To get around of it, I add a catch block in the test case to bypass this false alarm.
Comment 15 Mike Kucera CLA 2011-01-28 14:07:45 EST
(In reply to comment #14)
> I see the problem, '#' is not a legal token in LR parser but is a valid token
> in GNU parser, when LR parser tries to map it, the token mapper asserts false
> for an invalid token (#), the AssertionError is caught by the test.
> 
> To get around of it, I add a catch block in the test case to bypass this false
> alarm.

How is this a false alarm? If the scanner is returning this token then the parser needs to deal with it somehow. Is this not a real issue that needs to be fixed?
Comment 16 John Liu CLA 2011-01-28 15:40:29 EST
(In reply to comment #15)
> (In reply to comment #14)
> > I see the problem, '#' is not a legal token in LR parser but is a valid token
> > in GNU parser, when LR parser tries to map it, the token mapper asserts false
> > for an invalid token (#), the AssertionError is caught by the test.
> > 
> > To get around of it, I add a catch block in the test case to bypass this false
> > alarm.
> How is this a false alarm? If the scanner is returning this token then the
> parser needs to deal with it somehow. Is this not a real issue that needs to be
> fixed?

LR parsers have dealt with '#', but just treat it as an invalid token. This is because LR parsers reuse GNU parser's preprocessor to handle the preprocessing.

The reason why the test case is failed because DOMToGPPTokenMap asserts 'false' when it sees an unknown GNU token, like '#', I guess this is a special case which is not considered well by the mapper - it should not be so assertive for this case actually.

I will create another patch to update DOMToGPPTokenMap by removing the assert call for '#', like:

     case tPOUND : return TK_Invalid;
			
     default:
	assert false : "token not recognized by the GPP parser: " +   
                       token.getType(); //$NON-NLS-1$
	return TK_Invalid;

Please let me know if you think this is a better solution. 

Mike: can you please also see if this fix is reasonable?
Comment 17 John Liu CLA 2011-01-28 15:44:03 EST
Created attachment 187876 [details]
The patch I mentioned, apply to Head stream
Comment 18 John Liu CLA 2011-02-01 15:57:30 EST
(In reply to comment #17)
> Created attachment 187876 [details]
> The patch I mentioned, apply to Head stream

Talked with Mike, He agreed with the fix in the above patch.
Comment 19 John Liu CLA 2011-02-01 15:58:58 EST
Created attachment 188087 [details]
Token map fix patch to 70 stream
Comment 20 Vivian Kong CLA 2011-02-03 10:08:27 EST
Thanks John I've applied your latest patches to HEAD and cdt_7_0
Comment 21 John Liu CLA 2011-02-07 11:32:47 EST
Created attachment 188451 [details]
patch applied to token maps of isocpp and xlc parser
Comment 22 Vivian Kong CLA 2011-02-07 12:36:06 EST
Comment on attachment 188451 [details]
patch applied to token maps of isocpp and xlc parser

Applied patch to cdt_7_0 and HEAD.  Thanks John.  Also updated copyright year.
Comment 23 CDT Genie CLA 2011-02-10 09:12:03 EST
*** cdt cvs genie on behalf of vkong ***
Bug 328867 for John Liu

[*] DOMToISOCPPTokenMap.java 1.6.4.1 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/cpp/DOMToISOCPPTokenMap.java?root=Tools_Project&r1=1.6&r2=1.6.4.1

[*] XlcCPPTokenMap.java 1.5.2.1 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/core/lrparser/xlc/XlcCPPTokenMap.java?root=Tools_Project&r1=1.5&r2=1.5.2.1

[*] feature.xml 1.7.2.1 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/lrparser/org.eclipse.cdt.core.lrparser.feature/feature.xml?root=Tools_Project&r1=1.7&r2=1.7.2.1

[*] MANIFEST.MF 1.13.4.1 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/lrparser/org.eclipse.cdt.core.lrparser/META-INF/MANIFEST.MF?root=Tools_Project&r1=1.13&r2=1.13.4.1

[*] MANIFEST.MF 1.4.6.1 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/xlc/org.eclipse.cdt.core.lrparser.xlc/META-INF/MANIFEST.MF?root=Tools_Project&r1=1.4&r2=1.4.6.1

[*] feature.xml 1.9 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/lrparser/org.eclipse.cdt.core.lrparser.feature/feature.xml?root=Tools_Project&r1=1.8&r2=1.9

[*] MANIFEST.MF 1.14 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/lrparser/org.eclipse.cdt.core.lrparser/META-INF/MANIFEST.MF?root=Tools_Project&r1=1.13&r2=1.14

[*] DOMToISOCPPTokenMap.java 1.7 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/cpp/DOMToISOCPPTokenMap.java?root=Tools_Project&r1=1.6&r2=1.7

[*] MANIFEST.MF 1.5 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/xlc/org.eclipse.cdt.core.lrparser.xlc/META-INF/MANIFEST.MF?root=Tools_Project&r1=1.4&r2=1.5

[*] XlcCPPTokenMap.java 1.6 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/core/lrparser/xlc/XlcCPPTokenMap.java?root=Tools_Project&r1=1.5&r2=1.6

[*] feature.xml 1.4.2.1 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/lrparser/org.eclipse.cdt.core.lrparser.sdk.feature/feature.xml?root=Tools_Project&r1=1.4&r2=1.4.2.1

[*] feature.xml 1.7 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/lrparser/org.eclipse.cdt.core.lrparser.sdk.feature/feature.xml?root=Tools_Project&r1=1.6&r2=1.7

[*] DOMToGPPTokenMap.java 1.6 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/gnu/DOMToGPPTokenMap.java?root=Tools_Project&r1=1.5&r2=1.6

[*] DOMToGPPTokenMap.java 1.5.6.1 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/gnu/DOMToGPPTokenMap.java?root=Tools_Project&r1=1.5&r2=1.5.6.1
Comment 24 CDT Genie CLA 2011-02-10 09:12:40 EST
*** cdt cvs genie on behalf of vkong ***
Bug 328867 for John Liu

[*] DOMToISOCPPTokenMap.java 1.6.4.1 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/cpp/DOMToISOCPPTokenMap.java?root=Tools_Project&r1=1.6&r2=1.6.4.1

[*] XlcCPPTokenMap.java 1.5.2.1 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/core/lrparser/xlc/XlcCPPTokenMap.java?root=Tools_Project&r1=1.5&r2=1.5.2.1

[*] feature.xml 1.7.2.1 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/lrparser/org.eclipse.cdt.core.lrparser.feature/feature.xml?root=Tools_Project&r1=1.7&r2=1.7.2.1

[*] MANIFEST.MF 1.13.4.1 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/lrparser/org.eclipse.cdt.core.lrparser/META-INF/MANIFEST.MF?root=Tools_Project&r1=1.13&r2=1.13.4.1

[*] MANIFEST.MF 1.4.6.1 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/xlc/org.eclipse.cdt.core.lrparser.xlc/META-INF/MANIFEST.MF?root=Tools_Project&r1=1.4&r2=1.4.6.1

[*] feature.xml 1.9 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/lrparser/org.eclipse.cdt.core.lrparser.feature/feature.xml?root=Tools_Project&r1=1.8&r2=1.9

[*] MANIFEST.MF 1.14 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/lrparser/org.eclipse.cdt.core.lrparser/META-INF/MANIFEST.MF?root=Tools_Project&r1=1.13&r2=1.14

[*] DOMToISOCPPTokenMap.java 1.7 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/cpp/DOMToISOCPPTokenMap.java?root=Tools_Project&r1=1.6&r2=1.7

[*] MANIFEST.MF 1.5 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/xlc/org.eclipse.cdt.core.lrparser.xlc/META-INF/MANIFEST.MF?root=Tools_Project&r1=1.4&r2=1.5

[*] XlcCPPTokenMap.java 1.6 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/xlc/org.eclipse.cdt.core.lrparser.xlc/parser/org/eclipse/cdt/core/lrparser/xlc/XlcCPPTokenMap.java?root=Tools_Project&r1=1.5&r2=1.6
Comment 27 John Liu CLA 2011-03-09 16:25:03 EST
Created attachment 190795 [details]
lrparsers.tests patch to overwrite some new test cases
Comment 28 Chris Recoskie CLA 2011-03-09 16:43:36 EST
(In reply to comment #27)
> Created attachment 190795 [details]
> lrparsers.tests patch to overwrite some new test cases

Applied.

I see there is another patch previously posted that is not marked iplog+.  Did that one get committed previously?  If so it should be flagged.
Comment 30 Andrew Gvozdev CLA 2011-03-15 14:29:37 EDT
I don't see the test cases failing anymore, should this bug be closed?
Comment 31 Chris Recoskie CLA 2011-03-15 14:58:15 EDT
(In reply to comment #30)
> I don't see the test cases failing anymore, should this bug be closed?

Agreed.