diff options
author | Adam Frisby | 2008-03-25 16:29:54 +0000 |
---|---|---|
committer | Adam Frisby | 2008-03-25 16:29:54 +0000 |
commit | 8c05b81d6860d8e0da4098cc6f59f630d7c53037 (patch) | |
tree | 3325e09660ee8ad5a12cc19c8da6c4bd8bff5c21 /share/perl/test/OpenSimTest.pm | |
parent | * On Ray casting. Now returning the face normal of the collision face. (diff) | |
download | opensim-SC_OLD-8c05b81d6860d8e0da4098cc6f59f630d7c53037.zip opensim-SC_OLD-8c05b81d6860d8e0da4098cc6f59f630d7c53037.tar.gz opensim-SC_OLD-8c05b81d6860d8e0da4098cc6f59f630d7c53037.tar.bz2 opensim-SC_OLD-8c05b81d6860d8e0da4098cc6f59f630d7c53037.tar.xz |
* Committing Lulurun's Cgi/Perl implementation of the UGAI servers.
* I love you long time.
Diffstat (limited to '')
-rw-r--r-- | share/perl/test/OpenSimTest.pm | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/share/perl/test/OpenSimTest.pm b/share/perl/test/OpenSimTest.pm new file mode 100644 index 0000000..a24ae22 --- /dev/null +++ b/share/perl/test/OpenSimTest.pm | |||
@@ -0,0 +1,53 @@ | |||
1 | package OpenSimTest; | ||
2 | |||
3 | use strict; | ||
4 | use PerformanceTest; | ||
5 | use OpenSimTest::Config; | ||
6 | use OpenSimTest::UserTester; | ||
7 | use OpenSimTest::GridTester; | ||
8 | use OpenSimTest::AssetTester; | ||
9 | use OpenSimTest::InventoryTester; | ||
10 | |||
11 | sub init { | ||
12 | UserTester::init(); | ||
13 | GridTester::init(); | ||
14 | AssetTester::init(); | ||
15 | InventoryTester::init(); | ||
16 | } | ||
17 | |||
18 | sub SingleTest { | ||
19 | my $url = shift; | ||
20 | my $methodname = shift; | ||
21 | my @ARGS = @_; | ||
22 | |||
23 | if (!$OpenSimTest::Config::HANDLER_LIST{$methodname}) { | ||
24 | Carp::croak("unknown handler name: [$methodname]"); | ||
25 | } else { | ||
26 | my $handler = $OpenSimTest::Config::HANDLER_LIST{$methodname}; | ||
27 | my $result = $handler->($url, @ARGS); | ||
28 | return $result; | ||
29 | } | ||
30 | } | ||
31 | |||
32 | sub PerformanceCompare { | ||
33 | my $server_name = shift; | ||
34 | my $count = shift; | ||
35 | my @args = @_; | ||
36 | my $test = new PerformanceTest(); | ||
37 | { | ||
38 | my @params = @args; | ||
39 | unshift(@params, $OpenSimTest::Config::APACHE_SERVERS{$server_name}); | ||
40 | $test->add_test("APACHE::$args[0]", \&OpenSimTest::SingleTest, \@params); | ||
41 | } | ||
42 | { | ||
43 | my @params = @args; | ||
44 | unshift(@params, $OpenSimTest::Config::OPENSIM_SERVERS{$server_name}); | ||
45 | $test->add_test("OPENSIM::$args[0]", \&OpenSimTest::SingleTest, \@params); | ||
46 | } | ||
47 | $test->set_count($count); | ||
48 | $test->start(); | ||
49 | print "\n\n"; | ||
50 | #$test->bref_result(); | ||
51 | } | ||
52 | |||
53 | 1; | ||