From 6bf3cb7adbd1bbcce99a8f4dbcadf580a5f209de Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Tue, 22 Sep 2009 21:58:41 +0000 Subject: [PATCH] 2009-09-22 Zoltan Varga * assembly-load-stress.cs: New stress test. svn path=/trunk/mono/; revision=142439 --- mono/tests/ChangeLog | 2 ++ mono/tests/Makefile.am | 3 ++- mono/tests/assembly-load-stress.cs | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 mono/tests/assembly-load-stress.cs diff --git a/mono/tests/ChangeLog b/mono/tests/ChangeLog index 9073d355f61..91cc0b98eb2 100644 --- a/mono/tests/ChangeLog +++ b/mono/tests/ChangeLog @@ -1,5 +1,7 @@ 2009-09-22 Zoltan Varga + * assembly-load-stress.cs: New stress test. + * Makefile.am: Disable filter-stack.cs on ia64. * appdomain-thread-abort.cs: Add a new test. diff --git a/mono/tests/Makefile.am b/mono/tests/Makefile.am index 04fb479248a..9ec6a0a483c 100644 --- a/mono/tests/Makefile.am +++ b/mono/tests/Makefile.am @@ -45,7 +45,8 @@ STRESS_TESTS_SRC= \ thread-stress.cs \ gc-stress.cs \ exit-stress.cs \ - process-stress.cs + process-stress.cs \ + assembly-load-stress.cs BASE_TEST_CS_SRC= \ array-init.cs \ diff --git a/mono/tests/assembly-load-stress.cs b/mono/tests/assembly-load-stress.cs new file mode 100644 index 00000000000..ceba7ccf9fd --- /dev/null +++ b/mono/tests/assembly-load-stress.cs @@ -0,0 +1,33 @@ +using System; +using System.Text; +using System.Globalization; +using System.Collections.Generic; +using System.Reflection; +using System.Threading; +using System.IO; + +public class Tests +{ + static int nloops = 1; + static int nthreads = 10; + + public static void Main (String[] args) { + if (args.Length > 0) + nloops = int.Parse (args [0]); + if (args.Length > 1) + nthreads = int.Parse (args [1]); + + for (int li = 0; li < nloops; ++li) { + Thread[] threads = new Thread [nthreads]; + for (int i = 0; i < nthreads; ++i) { + threads [i] = new Thread (delegate () { + foreach (string s in Directory.GetFiles ("/usr/local/lib/mono/2.0", "*.dll")) { + AssemblyName.GetAssemblyName (s); + } + }); + } + for (int i = 0; i < 10; ++i) + threads [i].Start (); + } + } +} -- 2.11.4.GIT