From 1ad63f541b7d506a3661bed80280759ad48e7e2a Mon Sep 17 00:00:00 2001 From: onefang Date: Fri, 27 Aug 2021 08:32:22 +1000 Subject: Actually write the test sledjchisl command. --- src/sledjchisl/sledjchisl.c | 115 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index 436dd0e..443698c 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c @@ -2007,6 +2007,97 @@ static int filterARs(struct dirtree *node) return 0; } + +static void runTests(char *tests[], char *title, char* file) +{ + char *t = "export MONO_THREADS_PER_CPU=100;"; + int i = 0; + + // For printing out line numbers use "exec /usr/bin/cli --debug /usr/lib/nunit/nunit-console.exe" instead of "nunit-console". + if (FLAG(v)) + snprintf(toybuf, sizeof(toybuf), "echo '%s tests.'; cd %s; %s exec /usr/bin/cli --debug /usr/lib/nunit/nunit-console.exe ", title, scTemp, t); + else + snprintf(toybuf, sizeof(toybuf), "echo '%s tests.'; cd %s; %s nunit-console ", title, scTemp, t); + while(NULL != tests[i]) + { + t = xmprintf("%s/current/bin/%s.dll ", scRoot, tests[i++]); + strcat(toybuf, t); + free(t); + } + t = xmprintf("-nologo -output=Test%sOutput.txt -err=Test%sError.txt -labels -noxml ", file, file); + strcat(toybuf, t); + free(t); + I(toybuf); + shellMe(toybuf); +} +static void testOpenSim(simData *simd, char *sim, char *type, int count, int window, int panes, int pane) +{ + char *t = xmprintf("%s/../db", scTemp); + + if ((! qfile_exist(t)) && (! qfile_mkdir(t, S_IRWXU | S_IRGRP | S_IXGRP, true))) C("Unable to create path %s", t); + free(t); + char *standard0[] = + { + "OpenSim.Tests", + "OpenSim.Framework.Tests", + "OpenSim.Framework.Servers.Tests", + "OpenSim.Framework.Serialization.Tests", + "OpenSim.Region.ClientStack.LindenCaps.Tests", + "OpenSim.Region.ClientStack.LindenUDP.Tests", + "OpenSim.Region.ScriptEngine.Tests", + "OpenSim.Region.CoreModules.Tests", + "OpenSim.Region.Framework.Tests", + NULL + }; + runTests(standard0, "Standard", ""); + char *SQL[] = + { + "OpenSim.Data.Tests", + NULL + }; + runTests(SQL, "SQL", "SQL"); + char *standard1[] = + { + "OpenSim.Capabilities.Handlers.Tests", + "OpenSim.Server.Handlers.Tests", + "OpenSim.Services.InventoryService.Tests", + "OpenSim.Tests.Permissions", // Naturally OpenSim can't be consistent. + NULL + }; + runTests(standard1, "Standard part 2", "1"); + char *Physics[] = + { + "OpenSim.Region.PhysicsModule.BulletS.Tests", + "OpenSim.Region.PhysicsModule.Ode.Tests", + NULL + }; + runTests(Physics, "Physics", "Physics"); + char *Stress[] = + { + "OpenSim.Tests.Stress", + NULL + }; + runTests(Stress, "Stress", "Stress"); + char *Performance[] = + { + "OpenSim.Tests.Performance", + NULL + }; + runTests(Performance, "Performance", "Perf"); + char *Optional[] = + { + "OpenSim.Region.OptionalModules", + NULL + }; + runTests(Optional, "Optional", "Opt"); + char *Robust[] = + { + "Robust.Tests", + NULL + }; + runTests(Robust, "Robust", "Robust"); +} + // Forward declare this. my_ulonglong dbCount(char *table, char *where); void doSimsThing(simData *simd, char *sim, char *type, int count, int window, int panes, int pane) @@ -2344,6 +2435,30 @@ gitARend: break; } + case BUILD : + { + if (ourSims->doIt) +;// testOpenSim(simd, sim, type, count, window, panes, pane); + ourSims->doIt = 0; + break; + } + + case TEST : + { + if (ourSims->doIt) + testOpenSim(simd, sim, type, count, window, panes, pane); + ourSims->doIt = 0; + break; + } + + case UPDATE : + { + if (ourSims->doIt) +;// testOpenSim(simd, sim, type, count, window, panes, pane); + ourSims->doIt = 0; + break; + } + case STOP : // "stop 'Welcome sim'" "stop Welcome.shini" "Welcome.shini stop" "stop Welcome.ini" "stop Welcome" "stop" stop everything { stopSim(simd, sim, type, count, window, panes, pane); -- cgit v1.1