diff options
author | onefang | 2021-08-26 06:21:19 +1000 |
---|---|---|
committer | onefang | 2021-08-26 06:21:19 +1000 |
commit | cdfbb899f1112dab44d5490838765e9bd73bc60e (patch) | |
tree | 52cddd0b76e7ad8544a0ada533f91bb5fc402025 /TESTING.txt | |
parent | Still failing to reconnect for dbCount(), just set the fucking timeout to a y... (diff) | |
parent | Don't strip (OWNER) out of script error report. (diff) | |
download | opensim-SC-cdfbb899f1112dab44d5490838765e9bd73bc60e.zip opensim-SC-cdfbb899f1112dab44d5490838765e9bd73bc60e.tar.gz opensim-SC-cdfbb899f1112dab44d5490838765e9bd73bc60e.tar.bz2 opensim-SC-cdfbb899f1112dab44d5490838765e9bd73bc60e.tar.xz |
Merge branch 'switch' into Domme.
Diffstat (limited to 'TESTING.txt')
-rw-r--r-- | TESTING.txt | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/TESTING.txt b/TESTING.txt new file mode 100644 index 0000000..da9dd60 --- /dev/null +++ b/TESTING.txt | |||
@@ -0,0 +1,74 @@ | |||
1 | = The Quick Guide to OpenSim Unit Testing = | ||
2 | |||
3 | == Running Tests == | ||
4 | |||
5 | On Linux you will need to have NUnit installed (http://www.nunit.org). | ||
6 | This is commonly available in distribution package repositories. | ||
7 | |||
8 | When this is installed, run the command | ||
9 | |||
10 | > nant test | ||
11 | |||
12 | Please see the TESTING ON WINDOWS section below for Windows instructions. | ||
13 | |||
14 | == Adding Tests == | ||
15 | |||
16 | Tests should not be added to production assemblies. They should | ||
17 | instead be added to assemblies of the name | ||
18 | My.Production.Assembly.Tests.dll. This lets them easily be removed | ||
19 | from production environments that don't want the bloat. | ||
20 | |||
21 | Tests should be as close to the code as possible. It is recommended | ||
22 | that if you are writing tests they end up in a "Tests" sub-directory | ||
23 | of the directory where the code you are testing resides. | ||
24 | |||
25 | If you have added a new test assembly that hasn't existed before you | ||
26 | must list it in both ".nant/local.include" | ||
27 | for it to be accessible to Linux users and to the continuous | ||
28 | integration system. | ||
29 | |||
30 | == TESTING ON WINDOWS == | ||
31 | |||
32 | To use nunit testing on opensim code, you have a variety of methods. The | ||
33 | easiast methods involve using IDE capabilities to test code. Using | ||
34 | VS2005/2008 I recommend using the testing capabilities of Resharper(commercial) | ||
35 | or TestDriven.Net(free). Both will recognize nunit tests within your | ||
36 | application and allow you to test them individually, or all at once, etc. You | ||
37 | will also be able to step into debug mode into a test through these add-ins | ||
38 | enabling a developer to jump right in and see how a specific | ||
39 | test-case/scenerio works. | ||
40 | |||
41 | Additionally, it is my understanding that sharpdevelop and monodevelop have | ||
42 | their own nunit testing plugins within their IDE. Though I am not certain of | ||
43 | their exact feature set or stability. | ||
44 | |||
45 | == Using NUnit Directly == | ||
46 | The NUnit project is a very mature testing application. It can be obtained | ||
47 | from www.nunit.org are via various package distrobutions for Linux. Please be | ||
48 | sure to get a .Net 2.0 version of Nunit, as OpenSim makes use of .Net 2.0 | ||
49 | functionality. | ||
50 | |||
51 | Nunit comes with 2 tools that will enable you to run tests from assembly | ||
52 | inputs. Nunit-gui and nunit-console. NUnit-gui is a console that will let | ||
53 | you view the execution of various tests within your assemblies and give visual | ||
54 | indication of teir success or failure. This is a useful tool for those who | ||
55 | lack IDE addins ( or lack IDEs at all ). | ||
56 | |||
57 | Nunit console allows you to execute the nunit tests of assemblies via console. | ||
58 | Its output will show test failures and successes and a summary of what | ||
59 | happened. This is very useful for a quick overview and/or automated testing. | ||
60 | |||
61 | === Windows === | ||
62 | Windows version of nunit-console is by default .Net 2.0 if you downloaded the | ||
63 | .Net 2.0 version of Nunit. Be sure to setup your PATH environment variable. | ||
64 | |||
65 | === Linux & OSX === | ||
66 | On these operating systems you will have to use the command "nunit-console2" | ||
67 | |||
68 | === Example === | ||
69 | |||
70 | nunit-console2 OpenSim.Framework.Tests.dll (on linux) | ||
71 | nunit-console OpenSim.Framework.Tests.dll (on windows) | ||
72 | |||
73 | See the file OpenSim/Data/Tests/Resources/TestDataConnections.ini | ||
74 | for information to setup testing for data | ||