This commit is contained in:
watrabi
2025-09-18 17:55:52 -04:00
commit 977f1ff4b8
15030 changed files with 17324420 additions and 0 deletions
+65
View File
@@ -0,0 +1,65 @@
using System;
using System.Drawing;
namespace Roblox.Test
{
/// <summary>
/// This class shall keep all the functionality for capturing
/// the desktop.
/// </summary>
public class CaptureScreen
{
#region Public Class Functions
public static Bitmap GetDesktopImage()
{
//In size variable we shall keep the size of the screen.
SIZE size;
//Variable to keep the handle to bitmap.
IntPtr hBitmap;
//Here we get the handle to the desktop device context.
IntPtr hDC = PlatformInvokeUSER32.GetDC(PlatformInvokeUSER32.GetDesktopWindow());
//Here we make a compatible device context in memory for screen device context.
IntPtr hMemDC = PlatformInvokeGDI32.CreateCompatibleDC(hDC);
//We pass SM_CXSCREEN constant to GetSystemMetrics to get the X coordinates of screen.
size.cx = PlatformInvokeUSER32.GetSystemMetrics(PlatformInvokeUSER32.SM_CXSCREEN);
//We pass SM_CYSCREEN constant to GetSystemMetrics to get the Y coordinates of screen.
size.cy = PlatformInvokeUSER32.GetSystemMetrics(PlatformInvokeUSER32.SM_CYSCREEN);
//We create a compatible bitmap of screen size using screen device context.
hBitmap = PlatformInvokeGDI32.CreateCompatibleBitmap(hDC, size.cx, size.cy);
//As hBitmap is IntPtr we can not check it against null. For this purspose IntPtr.Zero is used.
if (hBitmap!=IntPtr.Zero)
{
//Here we select the compatible bitmap in memeory device context and keeps the refrence to Old bitmap.
IntPtr hOld = (IntPtr) PlatformInvokeGDI32.SelectObject(hMemDC, hBitmap);
//We copy the Bitmap to the memory device context.
PlatformInvokeGDI32.BitBlt(hMemDC, 0, 0,size.cx,size.cy, hDC, 0, 0, PlatformInvokeGDI32.SRCCOPY);
//We select the old bitmap back to the memory device context.
PlatformInvokeGDI32.SelectObject(hMemDC, hOld);
//We delete the memory device context.
PlatformInvokeGDI32.DeleteDC(hMemDC);
//We release the screen device context.
PlatformInvokeUSER32.ReleaseDC(PlatformInvokeUSER32.GetDesktopWindow(), hDC);
//Image is created by Image bitmap handle and stored in local variable.
Bitmap bmp = System.Drawing.Image.FromHbitmap(hBitmap);
//Release the memory for compatible bitmap.
PlatformInvokeGDI32.DeleteObject(hBitmap);
//This statement runs the garbage collector manually.
GC.Collect();
//Return the bitmap
return bmp;
}
//If hBitmap is null retunrn null.
return null;
}
#endregion
}
}
+710
View File
@@ -0,0 +1,710 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Threading;
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Runtime.InteropServices;
using System.Drawing;
using System.Reflection;
namespace Roblox.Test
{
[TestClass]
[Serializable]
public class PerfGraphics
{
Process proc;
public PerfGraphics()
{
proc = new Process();
}
/*public PerfGraphics(string DeploymentDir, TextWriter result)
{
TestDeploymentDir = DeploymentDir;
Result = result;
//
// TODO: Add constructor logic here
//
}*/
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
private const string TestOutputDir = "S:\\Automation\\Results\\";
private const string RobloxAppBuildTypeConfigFile = "S:\\Automation\\Roblox\\bin\\dirs";
private string RobloxAppFilename;
private const string RobloxAppArgFormat = "/NonInteractive /Settings \"{0}\"";
private const string RobloxAppDefaultFilenameFormat = "S:\\Automation\\Roblox\\bin\\{0}\\RobloxApp.exe";
private string FindRobloxApp()
{
string publishbinrootenv = Environment.GetEnvironmentVariable("PublishedBinRoot");
List<string> searchPaths = new List<string>();
if (!String.IsNullOrEmpty(publishbinrootenv))
{
searchPaths.Add(Path.Combine(publishbinrootenv, "RobloxApp.exe"));
}
searchPaths.Add(Path.Combine(TestContext.TestDeploymentDir, "RobloxApp.exe"));
searchPaths.Add(Path.Combine(TestContext.TestDeploymentDir.Replace("Mixed Platforms", "Release"), "RobloxApp.exe"));
searchPaths.Add(Path.Combine(TestContext.TestDeploymentDir, "..\\..\\Win32\\Release\\RobloxApp.exe"));
foreach (var p in searchPaths)
{
if (File.Exists(p))
return p;
}
// default.
string flavor = "Release";
try
{
using (var sr = new StreamReader(RobloxAppBuildTypeConfigFile))
{
flavor = sr.ReadLine();
}
}
catch (FileNotFoundException)
{
}
return String.Format(RobloxAppDefaultFilenameFormat, flavor);
}
[TestInitialize()]
public void TestInitialize()
{
RobloxAppFilename = FindRobloxApp();
proc.StartInfo.FileName = RobloxAppFilename;
Process[] procs = System.Diagnostics.Process.GetProcessesByName("RobloxApp");
foreach (Process p in procs)
{
try
{
p.Kill();
}
catch
{
}
}
// register COM object.
string testdir = TestContext.TestDeploymentDir;
proc.StartInfo.Arguments = "/Register";
proc.Start();
proc.WaitForExit();
}
[TestCleanup()]
public void TestCleanup()
{
if (!proc.HasExited)
{
proc.Kill();
}
}
const uint ID_VIEW_FULLSCREEN = 33012;
const uint ID_VIEW_GAMELAYOUT = 33013;
const uint ID_IDE_RUN = 32966;
public enum RunMode
{
Static,
Run,
Visit
};
public class SecureWorkspace : RobloxLib.IWorkspace
{
RobloxLib.IWorkspace p;
ScriptSigner scriptSigner;
public SecureWorkspace(RobloxLib.IWorkspace ws)
{
p = ws;
scriptSigner = new ScriptSigner();
}
#region IWorkspace Members
public object[] ExecScript(string script, object arg1, object arg2, object arg3, object arg4)
{
return p.ExecScript(scriptSigner.SignScript(script), arg1, arg2, arg3, arg4);
}
public void Close()
{
p.Close();
}
public object[] ExecUrlScript(string url, object arg1, object arg2, object arg3, object arg4)
{
return p.ExecUrlScript(url, arg1, arg2, arg3, arg4);
}
public void Insert(string url)
{
p.Insert(url);
}
public void StartDrag(string url)
{
p.StartDrag(url);
}
public RobloxLib.Content Write()
{
return p.Write();
}
public RobloxLib.Content WriteSelection()
{
return p.WriteSelection();
}
#endregion
#region IWorkspace Members
public object[] GetPlayers()
{
throw new NotImplementedException();
}
public void JoinGame(string server, string port, string gameTicket)
{
throw new NotImplementedException();
}
public void ReportAbuse(int abuserId, string comment)
{
throw new NotImplementedException();
}
public void Save()
{
throw new NotImplementedException();
}
public void SaveUrl(string url)
{
throw new NotImplementedException();
}
#endregion
};
public void TestBasic(string settings, string place, RunMode runmode)
{
string testdir = TestContext.TestDeploymentDir;
string settingsdir = Path.Combine(Path.Combine(testdir,"TestFiles\\"),settings);
string placedir = Path.Combine(Path.Combine(testdir, "TestFiles\\"), place);
placedir = placedir.Replace("\\", "\\\\"); // double escape, for LUA scripting.
proc.StartInfo.Arguments = String.Format(RobloxAppArgFormat, settingsdir);
proc.Start();
proc.WaitForInputIdle();
HandleRef hr = new HandleRef(proc, proc.MainWindowHandle);
PlatformInvokeUSER32.PostMessage(hr, PlatformInvokeUSER32.WM_COMMAND, new IntPtr(ID_VIEW_GAMELAYOUT), IntPtr.Zero);
PlatformInvokeUSER32.ShowWindow(hr, PlatformInvokeUSER32.SW_SHOW);
PlatformInvokeUSER32.PostMessage(hr, PlatformInvokeUSER32.WM_COMMAND, new IntPtr(ID_VIEW_FULLSCREEN), IntPtr.Zero);
//PlatformInvokeUSER32.PostMessage(hr, PlatformInvokeUSER32.WM_ACTIVATE, new IntPtr(PlatformInvokeUSER32.WA_ACTIVE), IntPtr.Zero);
RobloxLib.IApp app = new RobloxLib.AppClass();
string statusmessage = "";
RobloxLib.IWorkspace workspace = null;
try
{
workspace = new SecureWorkspace(app.CreateGame("44340105256"));
}
catch (COMException comex)
{
if (comex.ErrorCode == unchecked ((int)0x80010105) /*RPC_E_SERVERFAULT*/)
{
//this is what you get when "Graphics fail to initialize".
//Unfortunately, it is rather difficult to know exactly at this point. there is too much catching/re-throwing.
TestContext.WriteLine("Graphics failed to initialize (maybe)");
return;
}
else
{
throw;
}
}
object[] ret = (object[])workspace.ExecScript("return settings().Diagnostics.RobloxVersion", null, null, null, null);
string rbxversion = (string)(ret[0]);
string testversion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
ret = (object[])workspace.ExecScript("game:load('" + placedir + "')", null, null, null, null);
if (runmode == RunMode.Visit)
{
// throttling only turns on with a character present.
workspace.ExecUrlScript("http://www.watrbx.wtf/game/visit.ashx", null, null, null, null);
}
else if (runmode == RunMode.Run)
{
PlatformInvokeUSER32.PostMessage(hr, PlatformInvokeUSER32.WM_COMMAND, new IntPtr(ID_IDE_RUN), IntPtr.Zero);
}
bool bHasFrameRateManager = (bool)(((object[])workspace.ExecScript("if stats():FindFirstChild(\"FrameRateManager\") then return true else return false end", null, null, null, null))[0]) ;
int frameRateManagerBuckets = 0;
int secondsElapsed = 0;
double numFramesElapsed = 0;
do
{
ret = (object[])workspace.ExecScript("return stats().Render:FindFirstChild(\"3D CPU Total\"):getTimesForFrames(200)", null, null, null, null);
numFramesElapsed = (double)ret[2];
Thread.Sleep(1000);
//walk back and forth every 30 seconds.
if ((secondsElapsed++ % 10) == 0 && runmode == RunMode.Visit)
{
int posz = ((secondsElapsed / 10) % 3 == 0) ? 100 : 40;
int posx = ((secondsElapsed / 10) % 3 == 1) ? 40 : 0;
workspace.ExecScript("game.Workspace.Player.Humanoid:MoveTo(Vector3.new(" + posx.ToString() + ",0," + posz.ToString() + "), game.Workspace:FindFirstChild('Base'))", null, null, null, null); // throttling only turns on with a character present.
}
// framerate manager will turn on when # buckets exceeds 30.
if (bHasFrameRateManager && runmode == RunMode.Visit)
{
ret = (object[])workspace.ExecScript(
"stats().FrameRateManager:getValue()" +
"return stats().FrameRateManager.Buckets:getValue()"
, null, null, null, null);
frameRateManagerBuckets = (int)((double)ret[0]);
}
else
{
frameRateManagerBuckets = 30;
}
} while ( (frameRateManagerBuckets < 30) ||
(numFramesElapsed < 200 && secondsElapsed < 30));
if (runmode == RunMode.Visit)
{
// get the viewpoint we want to measure.
workspace.ExecScript("game.Workspace.CurrentCamera.CameraSubject = game.Workspace:FindFirstChild('Roof')", null, null, null, null);
}
// idle untill we get 100 frames of stable blockCounts from the FrameRateManager
secondsElapsed = 0;
ret[0] = 0.0;
while(bHasFrameRateManager && ((double)ret[0] < 100))
{
ret = (object[])workspace.ExecScript("return stats().FrameRateManager.StableFramesCounter:getValue()", null, null, null, null);
Thread.Sleep(1000);
if (secondsElapsed++ >= 120)
{
statusmessage += "Unable to reach FrameRateManager stability. ";
break;
}
};
// now do actual test.
int numFrames = 100;
ret = (object[])workspace.ExecScript("return stats().Render:FindFirstChild(\"3D CPU Total\"):getTimesForFrames(" + numFrames.ToString() + ")", null, null, null, null);
double walltime = (double)ret[0];
double sampletime = (double)ret[1];
double frames = (double)ret[2];
int visibleBlockCount = -1;
double constant = 0;
double visibleBlockCountEffect = 0;
//double estimatedFrameTime = 0;
if (bHasFrameRateManager)
{
// refresh values.
ret = (object[])workspace.ExecScript(
"stats().FrameRateManager:getValue()"
, null, null, null, null);
ret = (object[])workspace.ExecScript("return stats().FrameRateManager.X.visibleBlockCount:getValue()", null, null, null, null);
visibleBlockCount = (int)((double)ret[0]);
ret = (object[])workspace.ExecScript("return stats().FrameRateManager.EstimatedFrameTime:getValue() - stats().FrameRateManager.X.visibleBlockCount:getValue() * stats().FrameRateManager.Beta.visibleBlockCount:getValue()", null, null, null, null);
constant = (double)ret[0];
ret = (object[])workspace.ExecScript("return stats().FrameRateManager.Beta.visibleBlockCount:getValue()", null, null, null, null);
visibleBlockCountEffect = (double)ret[0];
}
//take screenshot.
Bitmap screen = CaptureScreen.GetDesktopImage();
screen.Save(Path.Combine(TestOutputDir, Environment.MachineName + ".PNG"));
TestContext.WriteLine("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}", testversion, rbxversion, frames / sampletime, walltime / frames, constant, visibleBlockCountEffect, visibleBlockCount, statusmessage);
//app.Quit();
bool result = proc.CloseMainWindow();
proc.WaitForExit(30000);
}
[TestMethod]
[DeploymentItem("TestFiles\\StarterHappyHome.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestStarterHappyHome()
{
TestBasic("SettingsOgreD3DRenderer.xml", "StarterHappyHome.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\house.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestBasicHouseOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer.xml", "house.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\house_slate.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer_NoFrameLimit.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestBasicHouseSlateOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer_NoFrameLimit.xml", "house_slate.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\house.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer_NoFrameLimit.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestBasicHousePlasticOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer_NoFrameLimit.xml", "house.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\house_wood.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer_NoFrameLimit.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestBasicHouseWoodOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer_NoFrameLimit.xml", "house_wood.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\house_rust.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer_NoFrameLimit.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestBasicHouseRustOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer_NoFrameLimit.xml", "house_rust.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\house_concrete.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer_NoFrameLimit.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestBasicHouseConcreteOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer_NoFrameLimit.xml", "house_concrete.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\walltester1.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer_NoFrameLimit.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void WallTester1OgreD3D()
{
TestBasic("SettingsOgreD3DRenderer_NoFrameLimit.xml", "walltester1.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\walltester2.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer_NoFrameLimit.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void WallTester2OgreD3D()
{
TestBasic("SettingsOgreD3DRenderer_NoFrameLimit.xml", "walltester2.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\Village.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer_NoFrameLimit.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void VillageOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer_NoFrameLimit.xml", "Village.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\Town2.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer_NoFrameLimit.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void Town2OgreD3D()
{
TestBasic("SettingsOgreD3DRenderer_NoFrameLimit.xml", "Town2.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\LAHouse.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer_NoFrameLimit.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void LAHouseOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer_NoFrameLimit.xml", "LAHouse.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\Place1.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer_NoFrameLimit.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void Place1OgreD3D()
{
TestBasic("SettingsOgreD3DRenderer_NoFrameLimit.xml", "Place1.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\ShipHotel.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer_NoFrameLimit.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void ShipHotelOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer_NoFrameLimit.xml", "ShipHotel.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\house_dplate.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer_NoFrameLimit.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestBasicHouseDPlateOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer_NoFrameLimit.xml", "house_dplate.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\house_aluminum.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer_NoFrameLimit.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestBasicHouseAluminumOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer_NoFrameLimit.xml", "house_aluminum.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\house_grass.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer_NoFrameLimit.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestBasicHouseGrassOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer_NoFrameLimit.xml", "house_grass.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\house_ice.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer_NoFrameLimit.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestBasicHouseIceOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer_NoFrameLimit.xml", "house_ice.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\house.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreGLRenderer.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestBasicHouseOgreGL()
{
TestBasic("SettingsOgreGLRenderer.xml", "house.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\house.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsG3DGLRenderer.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestBasicHouseG3DGL()
{
TestBasic("SettingsG3DGLRenderer.xml", "house.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\house.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsDefaultRenderer.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestBasicHouseDefault()
{
TestBasic("SettingsDefaultRenderer.xml", "house.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\Hotels.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestFRMHotelsOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer.xml", "Hotels.rbxl", RunMode.Visit);
}
[TestMethod]
[DeploymentItem("TestFiles\\Hotels.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestBasicHotelsOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer.xml", "Hotels.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\CrossroadsPlastic.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\LowOgreD3DBench.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void RegressCrossroadsOgreD3D()
{
TestBasic("LowOgreD3DBench.xml", "CrossroadsPlastic.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\CrossroadsPlastic.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\LowG3DGLBench.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void RegressCrossroadsG3DGL()
{
TestBasic("LowG3DGLBench.xml", "CrossroadsPlastic.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\CrossroadsPlastic.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestCrossroadsPlasticOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer.xml", "CrossroadsPlastic.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\CrossroadsWood.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestCrossroadsWoodOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer.xml", "CrossroadsWood.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\CrossroadsSlate.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestCrossroadsSlateOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer.xml", "CrossroadsSlate.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\CrossroadsMixed.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestCrossroadsMixedOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer.xml", "CrossroadsMixed.rbxl", RunMode.Run);
}
[TestMethod]
[DeploymentItem("TestFiles\\CrossroadsMixed.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreGLRenderer.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestCrossroadsMixedOgreGL()
{
TestBasic("SettingsOgreGLRenderer.xml", "CrossroadsMixed.rbxl", RunMode.Run);
}
[TestMethod]
[DeploymentItem("TestFiles\\WoodenHouse.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestBasicWoodenHouseOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer.xml", "WoodenHouse.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\TrussStress.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsOgreD3DRenderer.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestBasicTrussOgreD3D()
{
TestBasic("SettingsOgreD3DRenderer.xml", "TrussStress.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\TrussStress.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\SettingsG3DGLRenderer.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void TestBasicTrussG3DGL()
{
TestBasic("SettingsG3DGLRenderer.xml", "TrussStress.rbxl", RunMode.Static);
}
[TestMethod]
[DeploymentItem("TestFiles\\8TowersHardMixed.rbxl", "TestFiles\\")]
[DeploymentItem("TestFiles\\OgreD3DXBricks.xml", "TestFiles\\")]
[HeaderString("testver\trbxver\tfps\tgfxtime_ms\tfrm_constant\tfrm_blockcost\tvisibleBlocks\tstatus")]
public void Test8TowersHardMixed()
{
TestBasic("OgreD3DXBricks.xml", "8TowersHardMixed.rbxl", RunMode.Run);
}
}
}
@@ -0,0 +1,45 @@
using System;
using System.Runtime.InteropServices;
namespace Roblox.Test
{
/// <summary>
/// This class shall keep the GDI32 APIs being used in our program.
/// </summary>
public class PlatformInvokeGDI32
{
#region Class Variables
public const int SRCCOPY = 13369376;
#endregion
#region Class Functions
[DllImport("gdi32.dll",EntryPoint="DeleteDC")]
public static extern IntPtr DeleteDC(IntPtr hDc);
[DllImport("gdi32.dll",EntryPoint="DeleteObject")]
public static extern IntPtr DeleteObject(IntPtr hDc);
[DllImport("gdi32.dll",EntryPoint="BitBlt")]
public static extern bool BitBlt(IntPtr hdcDest,int xDest,int yDest,int wDest,int hDest,IntPtr hdcSource,int xSrc,int ySrc,int RasterOp);
[DllImport ("gdi32.dll",EntryPoint="CreateCompatibleBitmap")]
public static extern IntPtr CreateCompatibleBitmap(IntPtr hdc, int nWidth, int nHeight);
[DllImport ("gdi32.dll",EntryPoint="CreateCompatibleDC")]
public static extern IntPtr CreateCompatibleDC(IntPtr hdc);
[DllImport ("gdi32.dll",EntryPoint="SelectObject")]
public static extern IntPtr SelectObject(IntPtr hdc,IntPtr bmp);
#endregion
#region Public Constructor
public PlatformInvokeGDI32()
{
//
// TODO: Add constructor logic here
//
}
#endregion
}
}
@@ -0,0 +1,84 @@
using System;
using System.Runtime.InteropServices;
namespace Roblox.Test
{
/// <summary>
/// This class shall keep the User32 APIs being used in
/// our program.
/// </summary>
public class PlatformInvokeUSER32
{
#region Class Variables
public const int SM_CXSCREEN=0;
public const int SM_CYSCREEN=1;
public const uint WM_COMMAND = 0x0111;
public const uint WM_ACTIVATE = 0x06;
public const uint WA_ACTIVE = 1;
/*
* ShowWindow() Commands
*/
public const int SW_HIDE = 0;
public const int SW_SHOW = 5;
/*#define SW_SHOWNORMAL 1
#define SW_NORMAL 1
#define SW_SHOWMINIMIZED 2
#define SW_SHOWMAXIMIZED 3
#define SW_MAXIMIZE 3
#define SW_SHOWNOACTIVATE 4
#define SW_MINIMIZE 6
#define SW_SHOWMINNOACTIVE 7
#define SW_SHOWNA 8
#define SW_RESTORE 9
#define SW_SHOWDEFAULT 10
#define SW_FORCEMINIMIZE 11
#define SW_MAX 11*/
#endregion
#region Class Functions
[DllImport("user32.dll", EntryPoint="GetDesktopWindow")]
public static extern IntPtr GetDesktopWindow();
[DllImport("user32.dll",EntryPoint="GetDC")]
public static extern IntPtr GetDC(IntPtr ptr);
[DllImport("user32.dll",EntryPoint="GetSystemMetrics")]
public static extern int GetSystemMetrics(int abc);
[DllImport("user32.dll",EntryPoint="GetWindowDC")]
public static extern IntPtr GetWindowDC(Int32 ptr);
[DllImport("user32.dll",EntryPoint="ReleaseDC")]
public static extern IntPtr ReleaseDC(IntPtr hWnd,IntPtr hDc);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("user32.dll", SetLastError = true)]
public static extern bool PostMessage(HandleRef hWnd, uint Msg, IntPtr wParam,
IntPtr lParam);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("user32.dll", SetLastError = true)]
public static extern bool ShowWindow(HandleRef hWnd, int nCmdShow);
#endregion
#region Public Constructor
public PlatformInvokeUSER32()
{
//
// TODO: Add constructor logic here
//
}
#endregion
}
//This structure shall be used to keep the size of the screen.
public struct SIZE
{
public int cx;
public int cy;
}
}
@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("TestCases")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TestCases")]
[assembly: AssemblyCopyright("Copyright © 2008")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM componenets. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4fb98db9-c80d-4af5-8007-00b98ed2430c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,198 @@
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{101C21F5-FB46-4E91-B5D4-6B6D87FA585A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Roblox.Test.TestCases</RootNamespace>
<AssemblyName>Roblox.Test.TestCases</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SccProjectName>Perforce Project</SccProjectName>
<SccLocalPath>..\..\..</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>MSSCCI:Perforce SCM</SccProvider>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\Rig\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\Rig\bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="RobloxLib, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Roblox\RobloxLib.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\Client.LegacyAssemblies\Roblox.Data\SharedSecurityNotary.cs">
<Link>SharedSecurityNotary.cs</Link>
</Compile>
<Compile Include="CaptureScreen.cs" />
<Compile Include="PerfGraphics.cs" />
<Compile Include="PlatFormInvokeGDI32.cs" />
<Compile Include="PlatformInvokeUSER32.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ScriptSigner.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RemoteTestShim\Roblox.Test.RemoteTestShim.csproj">
<Project>{3D66508E-ADA5-4C7B-BD79-53B20B6D4DAB}</Project>
<Name>Roblox.Test.RemoteTestShim</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\256balls_w_8000_fixed.rbxl">
<Link>TestFiles\256balls_w_8000_fixed.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\8TowersHardMixed.rbxl">
<Link>TestFiles\8TowersHardMixed.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\ChaosCanyon.rbxl">
<Link>TestFiles\ChaosCanyon.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\CrossroadsMixed.rbxl">
<Link>TestFiles\CrossroadsMixed.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\CrossroadsPlastic.rbxl">
<Link>TestFiles\CrossroadsPlastic.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\CrossroadsSlate.rbxl">
<Link>TestFiles\CrossroadsSlate.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\CrossroadsWood.rbxl">
<Link>TestFiles\CrossroadsWood.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\Hotels.rbxl">
<Link>TestFiles\Hotels.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\house.rbxl">
<Link>TestFiles\house.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\house_aluminum.rbxl">
<Link>TestFiles\house_aluminum.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\house_concrete.rbxl">
<Link>TestFiles\house_concrete.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\house_dplate.rbxl">
<Link>TestFiles\house_dplate.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\house_grass.rbxl">
<Link>TestFiles\house_grass.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\house_ice.rbxl">
<Link>TestFiles\house_ice.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\house_rust.rbxl">
<Link>TestFiles\house_rust.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\house_slate.rbxl">
<Link>TestFiles\house_slate.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\house_wood.rbxl">
<Link>TestFiles\house_wood.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\LAHouse.rbxl">
<Link>TestFiles\LAHouse.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\Place1.rbxl">
<Link>TestFiles\Place1.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\ShipHotel.rbxl">
<Link>TestFiles\ShipHotel.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\StarterHappyHome.rbxl">
<Link>TestFiles\StarterHappyHome.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\Town2.rbxl">
<Link>TestFiles\Town2.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\TrussStress.rbxl">
<Link>TestFiles\TrussStress.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\village.rbxl">
<Link>TestFiles\village.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\walltester1.rbxl">
<Link>TestFiles\walltester1.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\walltester2.rbxl">
<Link>TestFiles\walltester2.rbxl</Link>
</None>
<None Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\WoodenHouse.rbxl">
<Link>TestFiles\WoodenHouse.rbxl</Link>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\LowG3DGLBench.xml">
<Link>TestFiles\LowG3DGLBench.xml</Link>
</Content>
<Content Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\LowOgreD3DBench.xml">
<Link>TestFiles\LowOgreD3DBench.xml</Link>
</Content>
<Content Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\OgreD3DXBricks.xml">
<Link>TestFiles\OgreD3DXBricks.xml</Link>
</Content>
<Content Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\SettingsDefaultRenderer.xml">
<Link>TestFiles\SettingsDefaultRenderer.xml</Link>
</Content>
<Content Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\SettingsG3DGLRenderer.xml">
<Link>TestFiles\SettingsG3DGLRenderer.xml</Link>
</Content>
<Content Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\SettingsOgreD3DRenderer.xml">
<Link>TestFiles\SettingsOgreD3DRenderer.xml</Link>
</Content>
<Content Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\SettingsOgreD3DRenderer_NoFrameLimit.xml">
<Link>TestFiles\SettingsOgreD3DRenderer_NoFrameLimit.xml</Link>
</Content>
<Content Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\SettingsOgreGLRenderer.xml">
<Link>TestFiles\SettingsOgreGLRenderer.xml</Link>
</Content>
<Content Include="..\..\..\..\..\Trunk\Tools\ClientTestFiles\SettingsPhysicsBench.xml">
<Link>TestFiles\SettingsPhysicsBench.xml</Link>
</Content>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PostBuildEvent>copy $(SolutionDir)..\..\..\..\Trunk\Tools\ClientTestFiles\*.* \\fileserver\SharedDocs\automation\Roblox.Test\TestFiles\
copy Roblox.Test.TestCases.* \\fileserver\SharedDocs\automation\Roblox.Test
copy $(SolutionDir)..\..\Client.LegacyAssemblies\Roblox.Data\Resources\rbxPrivate.blob \\fileserver\SharedDocs\automation\Server\RobloxWebSite\Game\rbxPrivate.blob
</PostBuildEvent>
<PreBuildEvent>if exist %25RobloxBinDir%25\RobloxApp.exe %25RobloxBinDir%25\RobloxApp.exe /register
echo %25RobloxBinDir%25\RobloxApp.exe /register</PreBuildEvent>
</PropertyGroup>
</Project>
+34
View File
@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
using System.IO;
namespace Roblox.Test
{
public class ScriptSigner
{
public ScriptSigner()
{
string path = "Server/RobloxWebSite/Game/rbxPrivate.blob";
int upcount = 0;
while (!System.IO.File.Exists(path))
{
path = "../" + path;
if (upcount++ >= 10)
{
throw new FileNotFoundException("Cannot find Server/RobloxWebSite/Game/rbxPrivate.blob in any of the parent directories of the current dir");
}
}
blob = System.IO.File.ReadAllBytes(path);
}
private byte[] blob;
public string SignScript(string script)
{
return "%" + SharedSecurityNotary.CreateSignature(script, blob) + "%" + script;
}
}
}