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