Merge pull request #1325 from madrang/CryptoToolsCtorCheck
[mono.git] / mcs / class / System.Windows.Forms / Test / System.Windows.Forms / tests2.sh
1 #!/bin/bash
2
3 function usage {
4 if [ $# -eq 0 ]; then
5         echo <<EOF '
6         Usage:  '$0' [--nunit] [--prefix] [--monooption] [--test] all|Fixture
7
8         --nunit            : path to nunit, if you want to use a different one than the default 2.0
9         --prefix           : prefix to use to pass options to nunit. Default is /, newer nunits use - instead
10         --monooption   : Options to pass on to mono, like --debug, --trace, etc.
11         --test             : Specific test to run, if the nunit you''re using supports it
12         all            : run all tests
13         Fixture        : Fixture is the name of the test you want to run. The MonoTests.System.Windows.Forms
14                                          namespace will be prepended automatically, so you don''t need to add it. You can
15                                          specify as many fixtures as you want, they will be run one after the other.
16
17         Example:
18                 '$0' --debug --trace=N:MonoTests.System.Windows.Forms all
19                 Runs all tests with debug and trace flags, roughly equivalent to:
20                 "mono --debug --trace=N:MonoTests.System.Windows.Forms nunit.exe System.Windows.Forms_test_net_2_0.dll"
21 '
22 EOF
23         exit 1
24 fi
25 }
26
27 cp ../../System.Windows.Forms_test_net_2_0.dll .
28
29 topdir=../../../..
30 NUNITCONSOLE=$topdir/class/lib/net_2_0/nunit-console.exe
31 MONO_PATH=$topdir/nunit20:$topdir/class/lib/net_2_0:.
32
33 opts=""
34 test=""
35 prefix="/"
36 ns="MonoTests."
37
38 for i in $@; do
39         case $i in
40                 --prefix*)
41                         prefix=${i:9}
42                         shift
43                 ;;
44                 --nunit*)
45                         NUNITCONSOLE="${i:8}/nunit-console.exe"
46                         MONO_PATH="${i:8}:."
47                         shift
48                 ;;
49                 --test*)
50                         test="-run=${i:7}"
51                         shift
52                 ;;
53                 -labels)
54                         NUNITCONSOLE="${NUNITCONSOLE} ${prefix}labels"
55                         shift
56                 ;;
57                 -defns)
58                         ns="MonoTests.System.Windows.Forms."
59                         shift
60                 ;;
61                 --*)
62                         opts="$opts $i"
63                         shift
64            ;;
65            *) continue ;;
66         esac
67 done
68
69 if [ $# -eq 0 ]; then
70         usage
71         exit 1
72 fi
73
74
75 for i in $@; do
76         case $i in
77                 all) fixture="" ;;
78                 *) fixture="${prefix}fixture:${ns}${i}" ;;
79         esac
80         echo "MONO_PATH=$MONO_PATH mono $opts ${NUNITCONSOLE} System.Windows.Forms_test_net_2_0.dll $fixture $test"
81         MONO_PATH=$MONO_PATH mono $opts ${NUNITCONSOLE} System.Windows.Forms_test_net_2_0.dll $fixture $test
82 done