Author: gert
Date: 2007-05-11 14:59:21 -0400 (Fri, 11 May 2007)
New Revision: 77247

Added:
   trunk/gert/standalone/bug78455/
   trunk/gert/standalone/bug78455/default.build
   trunk/gert/standalone/bug78455/test1.cs
   trunk/gert/standalone/bug78455/test2.cs
   trunk/gert/standalone/known-issues
Modified:
   trunk/gert/standalone/default.build
Log:
Added test for bug #78455. Added exclude file for known issues.


Added: trunk/gert/standalone/bug78455/default.build
===================================================================
--- trunk/gert/standalone/bug78455/default.build        2007-05-11 18:37:43 UTC 
(rev 77246)
+++ trunk/gert/standalone/bug78455/default.build        2007-05-11 18:59:21 UTC 
(rev 77247)
@@ -0,0 +1,72 @@
+<project name="bug78455" default="rebuild">
+       <target name="mono-1.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,ONLY_1_1,MONO" />
+       </target>
+
+       <target name="mono-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0,MONO" />
+       </target>
+
+       <target name="net-1.1">
+               <property name="csc.defines" value="NET_1_0,NET_1_1,ONLY_1_1" />
+       </target>
+
+       <target name="net-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0" />
+       </target>
+
+       <property name="frameworks" value="mono-1.0,mono-2.0,net-1.1,net-2.0" />
+       
+       <target name="clean">
+               <delete>
+                       <fileset>
+                               <include name="out" />
+                               <include name="test1.exe" />
+                               <include name="test2.exe" />
+                       </fileset>
+               </delete>
+       </target>
+
+       <target name="build">
+               <property name="original.targetframework" 
value="${nant.settings.currentframework}" />
+
+               <foreach property="framework" item="String" in="${frameworks}" 
delim=",">
+                       <if test="${framework::exists(framework)}">
+                               <property name="nant.settings.currentframework" 
value="${framework}" />
+                               <call 
target="${nant.settings.currentframework}" />
+                               <call target="run" />
+                               <call target="clean" />
+                       </if>
+               </foreach>
+
+               <property name="nant.settings.currentframework" 
value="${original.targetframework}" />
+       </target>
+
+       <target name="compile">
+               <csc target="exe" define="${csc.defines}" output="test1.exe" 
warnaserror="true" warninglevel="4">
+                       <nowarn>
+                               <warning number="0618" />
+                       </nowarn>
+                       <sources>
+                               <include name="test1.cs" />
+                       </sources>
+               </csc>
+               <csc target="exe" define="${csc.defines}" output="test2.exe" 
warnaserror="true" warninglevel="4">
+                       <nowarn>
+                               <warning number="0618" />
+                       </nowarn>
+                       <sources>
+                               <include name="test2.cs" />
+                       </sources>
+               </csc>
+       </target>
+
+       <target name="run" depends="compile">
+               <exec program="test1.exe" managed="true" output="out" />
+               <fail if="${file::exists('out')}">#1</fail>
+               <exec program="test2.exe" managed="true" output="out" />
+               <fail if="${file::exists('out')}">#2</fail>
+       </target>
+
+       <target name="rebuild" depends="clean, build" />
+</project>


Property changes on: trunk/gert/standalone/bug78455/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug78455/test1.cs
===================================================================
--- trunk/gert/standalone/bug78455/test1.cs     2007-05-11 18:37:43 UTC (rev 
77246)
+++ trunk/gert/standalone/bug78455/test1.cs     2007-05-11 18:59:21 UTC (rev 
77247)
@@ -0,0 +1,22 @@
+using System;
+using System.Threading;
+
+class Program
+{
+       [STAThread]
+       static int Main ()
+       {
+               AutoResetEvent ae = new AutoResetEvent (true);
+               AutoResetEvent ae2 = new AutoResetEvent (true);
+
+               if (Thread.CurrentThread.ApartmentState != ApartmentState.STA)
+                       return 1;
+
+               try {
+                       WaitHandle.WaitAll (new WaitHandle [] { ae, ae2 }, 
1000, true);
+                       return 2;
+               } catch (NotSupportedException) {
+                       return 0;
+               }
+       }
+}


Property changes on: trunk/gert/standalone/bug78455/test1.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug78455/test2.cs
===================================================================
--- trunk/gert/standalone/bug78455/test2.cs     2007-05-11 18:37:43 UTC (rev 
77246)
+++ trunk/gert/standalone/bug78455/test2.cs     2007-05-11 18:59:21 UTC (rev 
77247)
@@ -0,0 +1,21 @@
+using System;
+using System.Threading;
+
+class Program
+{
+       static int Main ()
+       {
+#if NET_2_0
+               if (Thread.CurrentThread.ApartmentState != ApartmentState.MTA)
+#else
+               if (Thread.CurrentThread.ApartmentState != 
ApartmentState.Unknown)
+#endif
+                       return 1;
+
+               AutoResetEvent ae = new AutoResetEvent (true);
+               AutoResetEvent ae2 = new AutoResetEvent (true);
+               if (WaitHandle.WaitAll (new WaitHandle [] { ae, ae2 }, 1000, 
true))
+                       return 0;
+               return 2;
+       }
+}

Modified: trunk/gert/standalone/default.build
===================================================================
--- trunk/gert/standalone/default.build 2007-05-11 18:37:43 UTC (rev 77246)
+++ trunk/gert/standalone/default.build 2007-05-11 18:59:21 UTC (rev 77247)
@@ -1,12 +1,14 @@
 <?xml version="1.0"?>
 <project name="standalone" default="rebuild">
-    <target name="*">
-        <nant target="${target::get-current-target()}">
-            <buildfiles>
-                <include name="**/*.build" />
-                <!-- avoid recursive execution of current build file -->
-                <exclude name="${project::get-buildfile-path()}" />
-            </buildfiles>
-        </nant>
-    </target>
+       <target name="*">
+               <nant target="${target::get-current-target()}">
+                       <buildfiles>
+                               <include name="**/*.build" />
+                               <!-- avoid recursive execution of current build 
file -->
+                               <exclude 
name="${project::get-buildfile-path()}" />
+                               <!-- exclude known issues -->
+                               <excludesfile name="known-issues" />
+                       </buildfiles>
+               </nant>
+       </target>
 </project>

Added: trunk/gert/standalone/known-issues
===================================================================
--- trunk/gert/standalone/known-issues  2007-05-11 18:37:43 UTC (rev 77246)
+++ trunk/gert/standalone/known-issues  2007-05-11 18:59:21 UTC (rev 77247)
@@ -0,0 +1 @@
+bug78455/**
\ No newline at end of file

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to