[mono-vb] Patch for mbas for ByRef parameters from a DLL

Bernie Solomon bernard@ugs.com
Tue, 3 Aug 2004 17:05:47 -0700


This is a multi-part message in MIME format.

------=_NextPart_000_0007_01C4797C.1F145BB0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

This is my proposed test for my change. Just posting it because of
the Makefile changes and if they are OK. I have added some source
for support DLLs and have them built first and referenced by the later
.EXE builds.

I also attach the new test files which are really simple so far.

Note I may not check in the enum bit of the change as I've found
other issues with enum handling and suspect it is in the wrong place
(my guess is the enum type should be preserved longer than it
seems to be at the moment).

Bernie Solomon
----- Original Message ----- 
From: "Jambunathan Jambunathan" <kjambunathan@novell.com>
To: <mono-vb@lists.ximian.com>; <bernard@ugs.com>
Sent: Tuesday, August 03, 2004 2:43 AM
Subject: Re: [mono-vb] Patch for mbas for ByRef parameters from a DLL


> > Also I was trying to get the tests going as they were before
> > changing them and found that seem to fail compilation
> > for me (e.g. LongTypeCharTestA.vb).
> 
> It apparently has nothing to do with your patch. The test fails
> in my work area as well and my work area doesn't have your
> patch.
> 
> > confused as to what the current state of tests was and how
> > I could tell if I broke anything.
> 
> Under mcs/btests there is Readme that should provide some
> information to go about. This is just a bare bone doc and we 
> are exploring ways of running/reporting of test cases
> better.
> 
> Currently there are number of test cases that break. One 
> approach that you could take is run a 'make all' under mcs/btests
> and save the results.out file and then diff this against the new  
> results.out after yourchanges. 
> 
> This is the approach we take. Painful but that's the way it is now.
> 
> > I can check in the code without the tests but thought I'd
> > try and do both at once.
> 
> The right way to go.
> 
> So hope to see your patches and test cases soon.
> 
> Thanks a lot.
> 
> Regards,
> Jambunathan K.
> 
> >>> "Bernie Solomon" <bernard@ugs.com> 8/2/2004 10:15:49 PM >>>
> There were a couple of reasons I hadn't checked this in yet.
> 
> Being a little busy was one but there were some technical
> reasons too.
> 
> In order to check in tests I need to modify the test setup
> so that there are some separate DLLs built as well as individual
> EXEs and I hadn't got round to do that yet (my original tests
> I did by hand).
> 
> Also I was trying to get the tests going as they were before
> changing them and found that seem to fail compilation
> for me (e.g. LongTypeCharTestA.vb) and was then a little
> confused as to what the current state of tests was and how
> I could tell if I broke anything. Can you explain the setup or
> is it my setup is broken and this should compile?
> 
> I can check in the code without the tests but thought I'd
> try and do both at once.
> 
> Bernie
> 
> ----- Original Message ----- 
> From: "Jambunathan Jambunathan" <kjambunathan@novell.com>
> To: <mono-vb@lists.ximian.com>; <bernard@ugsolutions.com>
> Sent: Monday, August 02, 2004 5:24 AM
> Subject: Re: [mono-vb] Patch for mbas for ByRef parameters from a DLL
> 
> 
> > Bernie
> > 
> > We can integrate this patch in to cvs on behalf of you. But 
> > nevertheless if you could mail us your test cases we will be
> > reassured that the patch really works.
> > 
> > I am sure you have test samples that you used for testing the
> > patch still lurking in your work area. Just grab it and mail across 
> > to us.
> > 
> > Thanks once again for the patch.
> > 
> > Regards,
> > Jambunathan K.
> > 
> > >>> "Bernie Solomon" <bernard@ugsolutions.com> 7/28/2004 11:37:12 PM
> > >>>
> > Here's a refinement which also allows use of enums declared in other
> > DLLs
> > (includes
> > the previous patch too).
> > 
> > Bernie
> > ----- Original Message ----- 
> > From: "Solomon, Bernard" <bernard.solomon@ugs.com>
> > To: <mono-vb@lists.ximian.com>
> > Sent: Wednesday, July 28, 2004 10:37 AM
> > Subject: [mono-vb] Patch for mbas for ByRef parameters from a DLL
> > 
> > 
> > [mono-vb] Patch for mbas for ByRef parameters from a DLLI attach a
> > patch so
> > that you can call methods in a referenced DLL that take
> > reference parameters and things compile. To do this I have made
> > ReflectionParameters return similar data to InternalParameters for
> > ByRef
> > parameters - and also use them when GetFullParameters doesn't return
> > anything (presumably currently you can't call a method with optional
> > parameters in a different DLL).
> > 
> > Since I haven't done anything inside mbas before I may not have done
> > this in
> > the right way. But if it is OK I can commit this.
> > 
> > Presumably a test case might be good but I am not quite sure where
> to
> > add
> > this.
> > 
> > Bernie Solomon
> > _______________________________________________
> > Mono-vb mailing list
> > Mono-vb@lists.ximian.com 
> > http://lists.ximian.com/mailman/listinfo/mono-vb 
> > 
> _______________________________________________
> Mono-vb mailing list
> Mono-vb@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-vb
> 
------=_NextPart_000_0007_01C4797C.1F145BB0
Content-Type: text/plain;
	name="Import1.vb"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="Import1.vb"

Imports System=0A=
Imports Dll1=0A=
=0A=
Module Test=0A=
Sub Main=0A=
    Dim i As Integer=0A=
    Dll1.OutInt(i)=0A=
    If i <> 123 Then=0A=
        Throw New Exception("#A1: Wrong value returned: " & i.ToString())=0A=
    End If=0A=
End Sub=0A=
End Module=0A=

------=_NextPart_000_0007_01C4797C.1F145BB0
Content-Type: text/plain;
	name="Dll1.vb"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="Dll1.vb"

Imports System=0A=
=0A=
Public Class Dll1=0A=
=0A=
Public Shared Sub OutInt(ByRef i As Integer)=0A=
    i =3D 123=0A=
End Sub=0A=
=0A=
End Class=0A=
=0A=
=0A=

------=_NextPart_000_0007_01C4797C.1F145BB0
Content-Type: text/plain;
	name="btests.diff.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="btests.diff.txt"

Index: Makefile=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /cvs/public/mcs/btests/Makefile,v=0A=
retrieving revision 1.8=0A=
diff -u -p -r1.8 Makefile=0A=
--- Makefile	11 Jun 2004 09:22:59 -0000	1.8=0A=
+++ Makefile	3 Aug 2004 22:47:52 -0000=0A=
@@ -1,7 +1,8 @@=0A=
 thisdir =3D btests=0A=
 SUBDIRS =3D =0A=
 TEST_RUNTIME =3D mono=0A=
-COMPILER_FLAGS =3D /libpath:../class/lib/default/ /imports:System=0A=
+COMPILER_FLAGS =3D /libpath:../class/lib/default/ /imports:System =0A=
+EXE_FLAGS =3D /r:./Dll1.dll=0A=
 INTERNAL_MBAS =3D $(TEST_RUNTIME) --debug ../mbas/mbas.exe --stacktrace =
$(COMPILER_FLAGS)=0A=
 #INTERNAL_MBAS =3D vbc $(COMPILER_FLAGS)=0A=
 all: test-compiler-jit =0A=
@@ -37,15 +38,34 @@ run-test-local: test-compiler-jit =0A=
 test-compiler-jit: test-compiler-jit-real =
test-compiler-jit-ngtive_compile \=0A=
 test-compiler-jit-ngtive_run=0A=
 =0A=
-=0A=
-test-compiler-jit-real:=0A=
-	@rm -f *.exe *.out ; \=0A=
-	/bin/echo "********** Positive Tests ************" > results.out; \=0A=
+test-dlls:=0A=
+	@rm -f *.dll *.out ; \=0A=
+	/bin/echo "********** Support DLLs ************" > results.out; \=0A=
+	/bin/echo "********** Support DLLs ************" ; \=0A=
+	for i in $(TEST_DLL_SOURCES) ; do \=0A=
+		/bin/echo -n -e =
"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
\n$$i: " >> results.out; \=0A=
+		/bin/echo -n "$$i: "; \=0A=
+		if $(INTERNAL_MBAS) /target:library $$i.vb 1>output ; then \=0A=
+			/bin/echo "COMPILED OK" >> results.out; \=0A=
+			/bin/echo "COMPILED OK" ;\=0A=
+			true ; \=0A=
+		else \=0A=
+			/bin/echo  -e "FAILED COMPILATION" >> results.out; \=0A=
+			cat output >> results.out; \=0A=
+			/bin/echo FAILED COMPILATION ;  \=0A=
+			continue;\=0A=
+		fi ; \=0A=
+	done; \=0A=
+	/bin/echo =
"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
" >> results.out=0A=
+=0A=
+test-compiler-jit-real: test-dlls=0A=
+	@rm -f *.exe ; \=0A=
+	/bin/echo "********** Positive Tests ************" >> results.out; \=0A=
 	/bin/echo "********** Positive Tests ************" ; \=0A=
 	for i in $(TEST_SOURCES) ; do \=0A=
 		/bin/echo -n -e =
"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
\n$$i: " >> results.out; \=0A=
 	    /bin/echo -n "$$i: "; \=0A=
-	    if $(INTERNAL_MBAS) $$i.vb 1>output ; then \=0A=
+	    if $(INTERNAL_MBAS) $(EXE_FLAGS) $$i.vb 1>output ; then \=0A=
             /bin/echo -n "COMPILED OK : " >> results.out; \=0A=
 	        /bin/echo -n "COMPILED OK : " ;\=0A=
 			true ; \=0A=
Index: Test.Sources=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
RCS file: /cvs/public/mcs/btests/Test.Sources,v=0A=
retrieving revision 1.20=0A=
diff -u -p -r1.20 Test.Sources=0A=
--- Test.Sources	1 Aug 2004 13:49:31 -0000	1.20=0A=
+++ Test.Sources	3 Aug 2004 22:47:52 -0000=0A=
@@ -1,4 +1,11 @@=0A=
 #=0A=
+# Support DLL source files go here=0A=
+#=0A=
+=0A=
+TEST_DLL_SOURCES =3D \=0A=
+Dll1=0A=
+=0A=
+#=0A=
 # All positive test cases goes here=0A=
 #=0A=
 =0A=
@@ -11,6 +18,7 @@ Test1 \=0A=
 Test2 \=0A=
 misc2 \=0A=
 Identifier \=0A=
+Import1 \=0A=
 IntegerTypeCharTest\=0A=
 IntegerTypeCharTestA \=0A=
 IntegerTypeCharTestB \=0A=

------=_NextPart_000_0007_01C4797C.1F145BB0--