[Libreoffice-commits] .: 2 commits - idlc/CustomTarget_parser_test.mk idlc/Module_idlc.mk idlc/source idlc/test

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jan 22 09:39:58 PST 2013


 idlc/CustomTarget_parser_test.mk |   74 ++++++++++++++++++++++++++++++++
 idlc/Module_idlc.mk              |    1 
 idlc/source/parser.y             |   20 +-------
 idlc/test/parser/constant.tests  |   88 +++++++++++++++++++--------------------
 idlc/test/parser/makefile.mk     |   46 --------------------
 idlc/test/parser/published.tests |   69 +-----------------------------
 6 files changed, 127 insertions(+), 171 deletions(-)

New commits:
commit 3b269d6d2d679536e9cbabc5b2d2339ef4bd75d2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jan 22 17:53:33 2013 +0100

    API CHANGE: Remove support for individual constants from UNOIDL
    
    ...i.e., "const X = N;" declarations outside of constant groups.  This appears
    to be unused in practice, and removing it will allow to simplify future code
    related to UNO type information.
    
    This removes the definition of "constant-decl", and the branch mentioning
    "constant-decl" from the definition of "declaration" at
    <http://wiki.openoffice.org/w/index.php?title=Documentation/DevGuide/AppendixD/UNOIDL_Syntax_Specification&oldid=137490>.
    
    Change-Id: I218626f02ebd46ee438bf5453ca1510c9ed8e5f0

diff --git a/idlc/source/parser.y b/idlc/source/parser.y
index 2b5997d..629c2f2 100644
--- a/idlc/source/parser.y
+++ b/idlc/source/parser.y
@@ -361,7 +361,7 @@ bool includes(AstDeclaration const * type1, AstDeclaration const * type2) {
 /*
  * These are production names:
  */
-%type <dclval>	type_dcl const_dcl
+%type <dclval>	type_dcl
 %type <dclval>	array_declarator
 %type <dclval>  exception_name
 %type <cdclval> array_type constructed_type_spec enum_type op_type_spec
@@ -448,14 +448,6 @@ publishable_definition:
 	{
 		idlc()->setParseState(PS_NoState);
 	}
-	| const_dcl
-	{
-		idlc()->setParseState(PS_ConstantDeclSeen);
-	}
-	';'
-	{
-		idlc()->setParseState(PS_NoState);
-	}
 	| exception_dcl
 	{
 		idlc()->setParseState(PS_ExceptionDeclSeen);
@@ -1288,13 +1280,6 @@ constants_exports :
 	;
 
 constants_export :
-	const_dcl
-	{
-		idlc()->setParseState(PS_ConstantDeclSeen);
-	}
-	';' {};
-
-const_dcl : 
 	IDL_CONST
 	{
 		idlc()->setParseState(PS_ConstSeen);
@@ -1331,7 +1316,10 @@ const_dcl :
 			}
 		}
 		delete $5;
+
+		idlc()->setParseState(PS_ConstantDeclSeen);
 	}
+	';' {};
 	;
 
 constants_dcl : 
diff --git a/idlc/test/parser/constant.tests b/idlc/test/parser/constant.tests
index 4d4f5f2..505a8c2 100644
--- a/idlc/test/parser/constant.tests
+++ b/idlc/test/parser/constant.tests
@@ -31,7 +31,7 @@ constants C {
 };
 
 
-EXPECT SUCCESS "constant.tests 2":
+EXPECT FAILURE "constant.tests 2":
 module m {
     const boolean C1 = FALSE;
     const byte C2 = 0;
@@ -75,7 +75,7 @@ constants C {};
 
 
 EXPECT SUCCESS "constant.tests 8":
-module m {
+constants C {
     const byte C1 = -128;
     const byte C2 = -0200;
     const byte C3 = -0x80;
@@ -119,168 +119,168 @@ module m {
 
 
 EXPECT FAILURE "constant.tests 9":
-module m { const byte C = -129; };
+constants C { const byte C1 = -129; };
 
 
 EXPECT FAILURE "constant.tests 10":
-module m { const byte C = -0201; };
+constants C { const byte C1 = -0201; };
 
 
 EXPECT FAILURE "constant.tests 11":
-module m { const byte C = -0x81; };
+constants C { const byte C1 = -0x81; };
 
 
 EXPECT FAILURE "constant.tests 12":
-module m { const byte C = 256; };
+constants C { const byte C1 = 256; };
 
 
 EXPECT FAILURE "constant.tests 13":
-module m { const byte C = 0400; };
+constants C { const byte C1 = 0400; };
 
 
 EXPECT FAILURE "constant.tests 14":
-module m { const byte C = 0x100; };
+constants C { const byte C1 = 0x100; };
 
 
 EXPECT FAILURE "constant.tests 15":
-module m { const short C = -32769; };
+constants C { const short C1 = -32769; };
 
 
 EXPECT FAILURE "constant.tests 16":
-module m { const short C = -0100001; };
+constants C { const short C1 = -0100001; };
 
 
 EXPECT FAILURE "constant.tests 17":
-module m { const short C = -0x8001; };
+constants C { const short C1 = -0x8001; };
 
 
 EXPECT FAILURE "constant.tests 18":
-module m { const short C = 32768; };
+constants C { const short C1 = 32768; };
 
 
 EXPECT FAILURE "constant.tests 19":
-module m { const short C = 0100000; };
+constants C { const short C1 = 0100000; };
 
 
 EXPECT FAILURE "constant.tests 20":
-module m { const short C = 0x8000; };
+constants C { const short C1 = 0x8000; };
 
 
 EXPECT FAILURE "constant.tests 21":
-module m { const unsigned short C = -1; };
+constants C { const unsigned short C1 = -1; };
 
 
 EXPECT FAILURE "constant.tests 22":
-module m { const unsigned short C = -01; };
+constants C { const unsigned short C1 = -01; };
 
 
 EXPECT FAILURE "constant.tests 23":
-module m { const unsigned short C = -0x1; };
+constants C { const unsigned short C1 = -0x1; };
 
 
 EXPECT FAILURE "constant.tests 24":
-module m { const unsigned short C = 65536; };
+constants C { const unsigned short C1 = 65536; };
 
 
 EXPECT FAILURE "constant.tests 25":
-module m { const unsigned short C = 0200000; };
+constants C { const unsigned short C1 = 0200000; };
 
 
 EXPECT FAILURE "constant.tests 26":
-module m { const unsigned short C = 0x10000; };
+constants C { const unsigned short C1 = 0x10000; };
 
 
 EXPECT FAILURE "constant.tests 27":
-module m { const long C = -2147483649; };
+constants C { const long C1 = -2147483649; };
 
 
 EXPECT FAILURE "constant.tests 28":
-module m { const long C = -020000000001; };
+constants C { const long C1 = -020000000001; };
 
 
 EXPECT FAILURE "constant.tests 29":
-module m { const long C = -0x80000001; };
+constants C { const long C1 = -0x80000001; };
 
 
 EXPECT FAILURE "constant.tests 30":
-module m { const long C = 2147483648; };
+constants C { const long C1 = 2147483648; };
 
 
 EXPECT FAILURE "constant.tests 31":
-module m { const long C = 020000000000; };
+constants C { const long C1 = 020000000000; };
 
 
 EXPECT FAILURE "constant.tests 32":
-module m { const long C = 0x80000000; };
+constants C { const long C1 = 0x80000000; };
 
 
 EXPECT FAILURE "constant.tests 33":
-module m { const unsigned long C = -1; };
+constants C { const unsigned long C1 = -1; };
 
 
 EXPECT FAILURE "constant.tests 34":
-module m { const unsigned long C = -01; };
+constants C { const unsigned long C1 = -01; };
 
 
 EXPECT FAILURE "constant.tests 35":
-module m { const unsigned long C = -0x1; };
+constants C { const unsigned long C1 = -0x1; };
 
 
 EXPECT FAILURE "constant.tests 36":
-module m { const unsigned long C = 4294967296; };
+constants C { const unsigned long C1 = 4294967296; };
 
 
 EXPECT FAILURE "constant.tests 37":
-module m { const unsigned long C = 040000000000; };
+constants C { const unsigned long C1 = 040000000000; };
 
 
 EXPECT FAILURE "constant.tests 38":
-module m { const unsigned long C = 0x100000000; };
+constants C { const unsigned long C1 = 0x100000000; };
 
 
 EXPECT FAILURE "constant.tests 39":
-module m { const hyper C = -9223372036854775809; };
+constants C { const hyper C1 = -9223372036854775809; };
 
 
 EXPECT FAILURE "constant.tests 40":
-module m { const hyper C = -01000000000000000000001; };
+constants C { const hyper C1 = -01000000000000000000001; };
 
 
 EXPECT FAILURE "constant.tests 41":
-module m { const hyper C = -0x8000000000000001; };
+constants C { const hyper C1 = -0x8000000000000001; };
 
 
 EXPECT FAILURE "constant.tests 42":
-module m { const hyper C = 9223372036854775808; };
+constants C { const hyper C1 = 9223372036854775808; };
 
 
 EXPECT FAILURE "constant.tests 43":
-module m { const hyper C = 01000000000000000000000; };
+constants C { const hyper C1 = 01000000000000000000000; };
 
 
 EXPECT FAILURE "constant.tests 44":
-module m { const hyper C = 0x8000000000000000; };
+constants C { const hyper C1 = 0x8000000000000000; };
 
 
 EXPECT FAILURE "constant.tests 45":
-module m { const unsigned hyper C = -1; };
+constants C { const unsigned hyper C1 = -1; };
 
 
 EXPECT FAILURE "constant.tests 46":
-module m { const unsigned hyper C = -01; };
+constants C { const unsigned hyper C1 = -01; };
 
 
 EXPECT FAILURE "constant.tests 47":
-module m { const unsigned hyper C = -0x1; };
+constants C { const unsigned hyper C1 = -0x1; };
 
 
 EXPECT FAILURE "constant.tests 48":
-module m { const unsigned hyper C = 18446744073709551616; };
+constants C { const unsigned hyper C1 = 18446744073709551616; };
 
 
 EXPECT FAILURE "constant.tests 49":
-module m { const unsigned hyper C = 02000000000000000000000; };
+constants C { const unsigned hyper C1 = 02000000000000000000000; };
 
 
 EXPECT FAILURE "constant.tests 50":
-module m { const unsigned hyper C = 0x10000000000000000; };
+constants C { const unsigned hyper C1 = 0x10000000000000000; };
diff --git a/idlc/test/parser/published.tests b/idlc/test/parser/published.tests
index e2bb7b7..e19a0f0 100644
--- a/idlc/test/parser/published.tests
+++ b/idlc/test/parser/published.tests
@@ -23,7 +23,6 @@ published struct Struct2<T> { T member; };
 published exception E1 {};
 published interface I1 {};
 published typedef long Typedef;
-published const long Constant = 1;
 published constants Constants { const long Constant = 1; };
 published service Service1: I1 {};
 published service Service2 { interface I1; };
@@ -413,26 +412,6 @@ published typedef E T;
 published struct S { T m; };
 
 
-EXPECT SUCCESS "published.tests 69":
-const long C1 = 1;
-const long C2 = C1 + 1;
-
-
-EXPECT FAILURE "published.tests 70":
-const long C1 = 1;
-published const long C2 = C1 + 1;
-
-
-EXPECT SUCCESS "published.tests 71":
-published const long C1 = 1;
-const long C2 = C1 + 1;
-
-
-EXPECT SUCCESS "published.tests 72":
-published const long C1 = 1;
-published const long C2 = C1 + 1;
-
-
 EXPECT SUCCESS "published.tests 73":
 constants Cs {
 	const long C1 = 1;
@@ -447,46 +426,6 @@ published constants Cs {
 };
 
 
-EXPECT SUCCESS "published.tests 75":
-constants Cs { const long C1 = 1; };
-const long C2 = Cs::C1 + 1;
-
-
-EXPECT FAILURE "published.tests 76":
-constants Cs { const long C1 = 1; };
-published const long C2 = Cs::C1 + 1;
-
-
-EXPECT SUCCESS "published.tests 77":
-published constants Cs { const long C1 = 1; };
-const long C2 = Cs::C1 + 1;
-
-
-EXPECT SUCCESS "published.tests 78":
-published constants Cs { const long C1 = 1; };
-published const long C2 = Cs::C1 + 1;
-
-
-EXPECT SUCCESS "published.tests 79":
-const long C1 = 1;
-constants Cs { const long C2 = C1 + 1; };
-
-
-EXPECT FAILURE "published.tests 80":
-const long C1 = 1;
-published constants Cs { const long C2 = C1 + 1; };
-
-
-EXPECT SUCCESS "published.tests 81":
-published const long C1 = 1;
-constants Cs { const long C2 = C1 + 1; };
-
-
-EXPECT SUCCESS "published.tests 82":
-published const long C1 = 1;
-published constants Cs { const long C2 = C1 + 1; };
-
-
 EXPECT SUCCESS "published.tests 83":
 constants Cs1 { const long C1 = 1; };
 constants Cs2 { const long C2 = Cs1::C1 + 1; };
@@ -509,22 +448,22 @@ published constants Cs2 { const long C2 = Cs1::C1 + 1; };
 
 EXPECT SUCCESS "published.tests 87":
 typedef long T;
-const T C = 1;
+constants Cs { const T C = 1; };
 
 
 EXPECT FAILURE "published.tests 88":
 typedef long T;
-published const T C = 1;
+published constants Cs { const T C = 1; };
 
 
 EXPECT SUCCESS "published.tests 89":
 published typedef long T;
-const T C = 1;
+constants Cs { const T C = 1; };
 
 
 EXPECT SUCCESS "published.tests 90":
 published typedef long T;
-published const T C = 1;
+published constants Cs { const T C = 1; };
 
 
 EXPECT SUCCESS "published.tests 91":
commit 147b7f0df3af28fbe6df36a2b25408fbe69cb876
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jan 22 17:38:26 2013 +0100

    Adapt idlc/test/parser/ to gbuild
    
    Change-Id: If57ab37dd4d062e3f6bbf5b75a0cde2524b635bd

diff --git a/idlc/CustomTarget_parser_test.mk b/idlc/CustomTarget_parser_test.mk
new file mode 100644
index 0000000..e0521b2
--- /dev/null
+++ b/idlc/CustomTarget_parser_test.mk
@@ -0,0 +1,74 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_CustomTarget_CustomTarget,idlc/parser_test))
+
+# this target is phony to run it every time
+.PHONY : $(call gb_CustomTarget_get_target,idlc/parser_test)
+
+$(call gb_CustomTarget_get_target,idlc/parser_test) : \
+            $(call gb_Executable_get_runtime_dependencies,idlc) \
+            $(SRCDIR)/solenv/bin/exectest.pl \
+            $(SRCDIR)/idlc/test/parser/attribute.tests \
+            $(SRCDIR)/idlc/test/parser/constant.tests \
+            $(SRCDIR)/idlc/test/parser/constructor.tests \
+            $(SRCDIR)/idlc/test/parser/interfaceinheritance.tests \
+            $(SRCDIR)/idlc/test/parser/methodoverload.tests \
+            $(SRCDIR)/idlc/test/parser/polystruct.tests \
+            $(SRCDIR)/idlc/test/parser/published.tests \
+            $(SRCDIR)/idlc/test/parser/struct.tests \
+            $(SRCDIR)/idlc/test/parser/typedef.tests
+	$(call gb_Helper_abbreviate_dirs, \
+            $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \
+                $(SRCDIR)/idlc/test/parser/attribute.tests \
+                $(call gb_Executable_get_command,idlc) \
+                -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) \
+                -stdin && \
+            $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \
+                $(SRCDIR)/idlc/test/parser/constant.tests \
+                $(call gb_Executable_get_command,idlc) \
+                -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) \
+                -stdin && \
+            $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \
+                $(SRCDIR)/idlc/test/parser/constructor.tests \
+                $(call gb_Executable_get_command,idlc) \
+                -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) \
+                -stdin && \
+            $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \
+                $(SRCDIR)/idlc/test/parser/interfaceinheritance.tests \
+                $(call gb_Executable_get_command,idlc) \
+                -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) \
+                -stdin && \
+            $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \
+                $(SRCDIR)/idlc/test/parser/methodoverload.tests \
+                $(call gb_Executable_get_command,idlc) \
+                -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) \
+                -stdin && \
+            $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \
+                $(SRCDIR)/idlc/test/parser/polystruct.tests \
+                $(call gb_Executable_get_command,idlc) \
+                -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) \
+                -stdin && \
+            $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \
+                $(SRCDIR)/idlc/test/parser/published.tests \
+                $(call gb_Executable_get_command,idlc) \
+                -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) \
+                -stdin && \
+            $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \
+                $(SRCDIR)/idlc/test/parser/struct.tests \
+                $(call gb_Executable_get_command,idlc) \
+                -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) \
+                -stdin && \
+            $(PERL) $(SRCDIR)/solenv/bin/exectest.pl \
+                $(SRCDIR)/idlc/test/parser/typedef.tests \
+                $(call gb_Executable_get_command,idlc) \
+                -O $(call gb_CustomTarget_get_workdir,idlc/parser_test) \
+                -stdin)
+
+# vim: set noet sw=4 ts=4:
diff --git a/idlc/Module_idlc.mk b/idlc/Module_idlc.mk
index bd82e2b..28113f1 100644
--- a/idlc/Module_idlc.mk
+++ b/idlc/Module_idlc.mk
@@ -11,6 +11,7 @@ $(eval $(call gb_Module_Module,idlc))
 
 ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
 $(eval $(call gb_Module_add_targets,idlc,Executable_idlc))
+$(eval $(call gb_Module_add_check_targets,idlc,CustomTarget_parser_test))
 endif
 
 # vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/idlc/test/parser/makefile.mk b/idlc/test/parser/makefile.mk
deleted file mode 100644
index d81eb20..0000000
--- a/idlc/test/parser/makefile.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-#   Licensed to the Apache Software Foundation (ASF) under one or more
-#   contributor license agreements. See the NOTICE file distributed
-#   with this work for additional information regarding copyright
-#   ownership. The ASF licenses this file to you under the Apache
-#   License, Version 2.0 (the "License"); you may not use this file
-#   except in compliance with the License. You may obtain a copy of
-#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-PRJ := ..$/..
-PRJNAME := idlc
-TARGET := test_parser
-
-.INCLUDE: settings.mk
-.INCLUDE: target.mk
-
-ALLTAR: test
-
-test .PHONY:
-    $(EXECTEST) attribute.tests $(BIN)/idlc$(EXECPOST) \
-        -O $(MISC)/$(TARGET) -stdin
-    $(EXECTEST) constant.tests $(BIN)/idlc$(EXECPOST) \
-        -O $(MISC)/$(TARGET) -stdin
-    $(EXECTEST) constructor.tests $(BIN)/idlc$(EXECPOST) \
-        -O $(MISC)/$(TARGET) -stdin
-    $(EXECTEST) interfaceinheritance.tests $(BIN)/idlc$(EXECPOST) \
-        -O $(MISC)/$(TARGET) -stdin
-    $(EXECTEST) methodoverload.tests $(BIN)/idlc$(EXECPOST) \
-        -O $(MISC)/$(TARGET) -stdin
-    $(EXECTEST) polystruct.tests $(BIN)/idlc$(EXECPOST) \
-        -O $(MISC)/$(TARGET) -stdin
-    $(EXECTEST) published.tests $(BIN)/idlc$(EXECPOST) \
-        -O $(MISC)/$(TARGET) -stdin
-    $(EXECTEST) struct.tests $(BIN)/idlc$(EXECPOST) \
-        -O $(MISC)/$(TARGET) -stdin
-    $(EXECTEST) typedef.tests $(BIN)/idlc$(EXECPOST) \
-        -O $(MISC)/$(TARGET) -stdin


More information about the Libreoffice-commits mailing list