Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
GraphicsTestBase.Deprecated.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Diagnostics;
4 using System.IO;
5 using System.Linq;
6 using System.Net;
7 using System.Net.NetworkInformation;
8 using System.Net.Sockets;
9 using System.Reflection;
10 using System.Runtime.InteropServices;
11 using System.Text;
12 using System.Threading;
13 
14 using NUnit.Framework;
15 
16 using SiliconStudio.Paradox.Games;
17 
18 namespace SiliconStudio.Paradox.Graphics.Regression
19 {
20  [TestFixture]
21  public class GraphicsTestBase : TestGameBase
22  {
23  #region Constant strings
24 
25  private const string SaveDirectory = @"";
26 
27  private const string AndroidReferenceName = @"SC-02C";
28 
29  private const string PcReferenceName = @"";
30 
31  private const string IosReferenceName = @"";
32 
33  private const char IpAddressesSplitCharacter = '%';
34 
35  #endregion
36 
37  #region Private members
38 
39  /// <summary>
40  /// A flag stating if the program is run from a unit test session.
41  /// </summary>
42  private bool isServer;
43 
44  /// <summary>
45  /// A flag to enable local save.
46  /// </summary>
47  private bool saveLocally;
48 
49  /// <summary>
50  /// The current buildNumber.
51  /// </summary>
52  private int buildNumber;
53 
54  /// <summary>
55  /// The address of the server.
56  /// </summary>
57  private string serverAddresses;
58 
59  /// <summary>
60  /// The port used to communicate with the server.
61  /// </summary>
62  private int serverPort;
63 
64  /// <summary>
65  /// The server used to get results from the test.
66  /// </summary>
67  private TcpListener server;
68 
69  /// <summary>
70  /// A boolean stating if the server is up.
71  /// </summary>
72  private bool serverUp;
73 
74  /// <summary>
75  /// Reset event used to correctly terminate the listening thread.
76  /// </summary>
77  private ManualResetEvent dataReceivedEvent;
78 
79  /// <summary>
80  /// The client used to send data.
81  /// </summary>
82  private TcpClient client;
83 
84  /// <summary>
85  /// The current device.
86  /// </summary>
87  private ConnectedDevice currentDevice;
88 
89  /// <summary>
90  /// A flag stating if the image was received.
91  /// </summary>
92  private bool imageReceived;
93 
94  /// <summary>
95  /// A flag stating if the test was performed.
96  /// </summary>
97  private bool testPerformed;
98 
99  /// <summary>
100  /// A flag stating if the test is executed on bamboo.
101  /// </summary>
102  private bool onBamboo;
103 
104  /// <summary>
105  /// The directory containing the Paradox SDK.
106  /// </summary>
107  private string paradoxSdkDir;
108 
109  /// <summary>
110  /// A flag stating if the client is connected.
111  /// </summary>
112  private bool isClientConnected;
113 
114  /// <summary>
115  /// Name of the assembly.
116  /// </summary>
117  private string assemblyNameForAndroid = "SiliconStudio.Paradox.Graphics.Regression";
118 
119  /// <summary>
120  /// The name of the branch the test is done on;
121  /// </summary>
122  private string branchName;
123 
124  /// <summary>
125  /// A flag that can be used to tell the program to run tests. Can be used to switch from visual check to actual unit test. Is handled automatically.
126  /// </summary>
127  private bool runTests;
128 
129  #endregion
130 
131  #region Public properties
132 
133  public FrameGameSystem FrameGameSystem { get; private set; }
134 
135  #endregion
136 
137  #region Public members
138 
139  /// <summary>
140  /// The version to compare to.
141  /// </summary>
142  public int BaseVersionNumber;
143 
144  /// <summary>
145  /// The current version of the test
146  /// </summary>
148 
149  /// <summary>
150  /// The timeout of the server in milliseconds.
151  /// </summary>
152  public int Timeout;
153 
154  /// <summary>
155  /// Forced name of the base version.
156  /// </summary>
157  public string BaseVersionFileName;
158 
159  /// <summary>
160  /// Location of the csproj.
161  /// </summary>
162  public string CsprojLocationForAndroid = @"sources\engine\SiliconStudio.Paradox.Graphics.Regression\SiliconStudio.Paradox.Graphics.Regression.Android.csproj";
163 
164  #endregion
165 
166  #region Constructors
167 
169  {
170  isServer = false;
171  saveLocally = false;
172  BaseVersionNumber = 0;
173  CurrentVersionNumber = 0;
174  Timeout = 120000;
175  server = null;
176  client = null;
177  serverUp = false;
178  runTests = false;
179  isClientConnected = false;
180 
181  onBamboo = Environment.GetEnvironmentVariable("PARADOX_BAMBOO_TEST") != null;
182  if (!Int32.TryParse(Environment.GetEnvironmentVariable(@"BAMBOO_BUILD_NUMBER"), out buildNumber))
183  buildNumber = 0;
184 
185  paradoxSdkDir = Environment.GetEnvironmentVariable(@"ParadoxSdkDir");
186 
187  if (onBamboo)
188  {
189  branchName = Environment.GetEnvironmentVariable("PARADOX_BAMBOO_BRANCH_NAME");
190  if (branchName != null)
191  branchName = branchName.Trim();
192  }
193  else
194  branchName = null;
195 
196  assemblyNameForAndroid = this.GetType().Assembly.ManifestModule.ScopeName;
197 
198  FrameGameSystem = new FrameGameSystem(this.Services);
199  FrameGameSystem.Visible = true;
200  FrameGameSystem.Enabled = true;
201  this.GameSystems.Add(FrameGameSystem);
202  }
203 
204  /// <summary>
205  /// Initialize the game with the corresponding values.
206  /// </summary>
207  /// <param name="ipString">THe IP address of the server.</param>
208  /// <param name="port">The listening port.</param>
209  /// <param name="bNumber">The build number.</param>
210  /// <param name="serial">The serial of the device.</param>
211  public void Init(string ipString, int port, int bNumber, string serial)
212  {
213  serverAddresses = ipString;
214  serverPort = port;
215  buildNumber = bNumber;
216  }
217 
218  #endregion
219 
220  #region public methods
221 
222  [TestFixtureSetUp]
223  public void SetUpServerFlag()
224  {
225  isServer = true;
226  FrameGameSystem.Visible = false;
227  FrameGameSystem.Enabled = false;
228  }
229 
230  [TestFixtureTearDown]
231  public void StopServer()
232  {
233  if (server != null)
234  {
235  server.Stop();
236  server = null;
237  }
238  }
239 
240  /// <summary>
241  /// Run the test.
242  /// </summary>
243  /// <param name="device">The device where to run the test.</param>
244  /// <param name="gameContext">The game context.</param>
245  public void RunTest(ConnectedDevice device, GameContext gameContext = null)
246  {
247  currentDevice = device;
248  runTests = true;
249  Console.WriteLine(@"Running test " + this.GetType().Name + @" on device " + device.Name + @" (" + device.Platform + @")");
250 
251  // TODO: should be executed after LoadContent for client - or at the first frame?
252  RegisterTests();
253 
254  if (isServer)
255  {
256  Console.WriteLine(@"Running server" + (onBamboo ? @" on Bamboo" : @"" ));
257  // Launch server
258  SetUpServer();
259 
260  if (!serverUp)
261  {
262  Assert.Fail("Unable to create a server.");
263  return;
264  }
265 
266  // Reset some variables
267  imageReceived = false;
268  testPerformed = false;
269  dataReceivedEvent = new ManualResetEvent(false);
270 
271  // Launch remote test
272  Console.WriteLine(@"Waiting for a connection... ");
273  //server.BeginAcceptTcpClient(GetClientResultCallback, server);
274  RunTestOnDevice(device);
275 
276  // Wait until data is received or timeout
277  dataReceivedEvent.WaitOne(Timeout);
278 
279  try
280  {
281  Console.WriteLine(@"Stopping the server.");
282  serverUp = false;
283  StopServer();
284  }
285  catch (Exception)
286  {
287  Console.WriteLine(@"Stopping the server threw an error.");
288  }
289  finally
290  {
291  // Some tests
292  Assert.IsTrue(imageReceived, "The image was not received.");
293  Assert.IsTrue(testPerformed, "The tests were not correctly performed");
294  }
295  }
296  else
297  {
298  Console.WriteLine(@"Running test client");
299  // 1. Create client
300  SetUpClient();
301 
302  // 2. Run game
303  Run(gameContext);
304  }
305  }
306 
307  /// <summary>
308  /// Get the name of the base image to compare the generated images to.
309  /// </summary>
310  /// <param name="platform">The platform the test is performed on.</param>
311  /// <param name="deviceName">The name of the device.</param>
312  /// <returns>The name of the file.</returns>
313  public string GenerateBaseFileNameFromVersion(TestPlatform platform, string deviceName)
314  {
315  return this.GetType().Name + @"_" + PlatformPermutator.GetPlatformName(platform) + @"_" + deviceName + @"_v" + BaseVersionNumber + @".png";
316  }
317 
318  /// <summary>
319  /// Save the image locally or on the server.
320  /// </summary>
321  /// <param name="textureToSave">The texture to save.</param>
322  /// <param name="frameIndex">The index of the frame.</param>
323  public void SaveImage(Texture textureToSave, int frameIndex)
324  {
325  if (textureToSave == null)
326  return;
327 
328  Console.WriteLine(@"Saving non null image");
329  var testName = NUnit.Framework.TestContext.CurrentContext.Test.FullName;
330  if (saveLocally)
331  {
332  Console.WriteLine(@"saving locally.");
333  using (var image = textureToSave.GetDataAsImage())
334  {
335  var textureName = testName + "_" + PlatformPermutator.GetCurrentPlatformName();
336  using (var resultFileStream = File.OpenWrite(FileNameGenerator.GetFileName(textureName)))
337  {
338  image.Save(resultFileStream, ImageFileType.Png);
339  }
340  }
341  }
342  else if (client != null)
343  {
344  Console.WriteLine(@"saving remotely.");
345  using (var image = textureToSave.GetDataAsImage())
346  {
347  try
348  {
349  SendImage(image, currentDevice.Serial, testName, frameIndex);
350  }
351  catch (Exception e)
352  {
353  Console.WriteLine(@"An error occured when trying to send the data to the server.");
354  }
355  }
356  }
357  }
358 
359  /// <summary>
360  /// Save the image locally or on the server.
361  /// </summary>
362  /// <param name="frameIndex">The index of the frame.</param>
363  public void SaveBackBuffer(int frameIndex)
364  {
365  Console.WriteLine(@"Saving the backbuffer");
366  SaveImage(GraphicsDevice.BackBuffer.Texture, frameIndex);
367  }
368 
369  /// <summary>
370  /// Lists all the devices accessible from the computer.
371  /// </summary>
372  /// <returns>The list of all the available devices.</returns>
374  {
375  var devices = new List<ConnectedDevice>();
376 
377  var addPcD3DDevices = Environment.GetEnvironmentVariable("PARADOX_PC_DIRECT3D_DEVICES") != null;
378  var addPcOglDevices = Environment.GetEnvironmentVariable("PARADOX_PC_OPENGL_DEVICES") != null;
379  var addPcOglEsDevices = Environment.GetEnvironmentVariable("PARADOX_PC_OPENGLES_DEVICES") != null;
380  var addAndroidDevices = Environment.GetEnvironmentVariable("PARADOX_ANDROID_DEVICES") != null;
381  var addiOsDevices = Environment.GetEnvironmentVariable("PARADOX_IOS_DEVICES") != null;
382 
383  if (!(addPcD3DDevices || addPcOglDevices || addPcOglEsDevices || addAndroidDevices || addiOsDevices))
384  {
385  devices.AddRange(ListPcD3DDevices());
386  devices.AddRange(ListPcOglDevices());
387  devices.AddRange(ListPcOglEsDevices());
388  devices.AddRange(ListAndroidDevices());
389  devices.AddRange(ListIOsDevices());
390  }
391  else
392  {
393  if (addPcD3DDevices)
394  devices.AddRange(ListPcD3DDevices());
395  if (addPcOglDevices)
396  devices.AddRange(ListPcOglDevices());
397  if (addPcOglEsDevices)
398  devices.AddRange(ListPcOglEsDevices());
399  if (addAndroidDevices)
400  devices.AddRange(ListAndroidDevices());
401  if (addiOsDevices)
402  devices.AddRange(ListIOsDevices());
403  }
404 
405  return devices.ToArray();
406  }
407 
408  /// <summary>
409  /// Lists all the Android devices accessible from the computer.
410  /// </summary>
411  /// <returns>The list of all the available Android devices.</returns>
413  {
414  var devices = new List<ConnectedDevice>();
415 
416  var devicesOutputs = ShellHelper.RunProcessAndGetOutput(@"adb", @"devices");
417  var whitespace = new[] { ' ', '\t' };
418  for (var i = 1; i < devicesOutputs.OutputLines.Count; ++i) // from the second line
419  {
420  var line = devicesOutputs.OutputLines[i];
421  if (line != null)
422  {
423  var res = line.Split(whitespace);
424  if (res.Length == 2)
425  {
426  ConnectedDevice device;
427  device.Serial = res[0];
428  device.Name = res[1];
429  device.Platform = TestPlatform.Android;
430  devices.Add(device);
431  }
432  }
433  }
434 
435  // Set the real name of the Android device.
436  for (var i = 0; i < devices.Count; ++i)
437  {
438  var device = devices[i];
439  //TODO: doing a grep instead will be better
440  var deviceNameOutputs = ShellHelper.RunProcessAndGetOutput(@"adb", @"-s " + device.Serial + @" shell cat /system/build.prop");
441  foreach (var line in deviceNameOutputs.OutputLines)
442  {
443  if (line != null && line.StartsWith(@"ro.product.model")) // correct line
444  {
445  var parts = line.Split('=');
446 
447  if (parts.Length > 1)
448  {
449  device.Name = parts[1];
450  devices[i] = device;
451  }
452 
453  break; // no need to search further
454  }
455  }
456  }
457 
458  // get the name of the base device.
459  foreach (var device in devices)
460  {
461  if (device.Name.Equals(AndroidReferenceName))
462  {
463  //device = device.Serial;
464  break;
465  }
466  }
467 
468  return devices.ToArray();
469  }
470 
471  /// <summary>
472  /// Lists all the Android devices accessible from the computer.
473  /// </summary>
474  /// <returns>The list of all the available Android devices.</returns>
476  {
477  var devices = new List<ConnectedDevice>();
478  return devices.ToArray();
479  }
480 
481  /// <summary>
482  /// Lists all the D3D PC devices accessible from the computer.
483  /// </summary>
484  /// <returns>The list of all the available D3D PC devices.</returns>
486  {
487  var devices = new List<ConnectedDevice>();
488 
489  ConnectedDevice pcDdevice;
490  pcDdevice.Serial = "Local";
491  pcDdevice.Name = "LocalPC";
492  pcDdevice.Platform = TestPlatform.WindowsDx;
493  devices.Add(pcDdevice);
494 
495  return devices.ToArray();
496  }
497 
498  /// <summary>
499  /// Lists all the OpenGL PC devices accessible from the computer.
500  /// </summary>
501  /// <returns>The list of all the available OpenGL PC devices.</returns>
503  {
504  var devices = new List<ConnectedDevice>();
505 
506  ConnectedDevice pcDdevice;
507  pcDdevice.Serial = "Local";
508  pcDdevice.Name = "LocalPC";
509  pcDdevice.Platform = TestPlatform.WindowsOgl;
510  devices.Add(pcDdevice);
511 
512  return devices.ToArray();
513  }
514 
515  /// <summary>
516  /// Lists all the OpenGL ES PC devices accessible from the computer.
517  /// </summary>
518  /// <returns>The list of all the available OpenGL ES PC devices.</returns>
520  {
521  var devices = new List<ConnectedDevice>();
522 
523  ConnectedDevice pcDdevice;
524  pcDdevice.Serial = "Local";
525  pcDdevice.Name = "LocalPC";
526  pcDdevice.Platform = TestPlatform.WindowsOgles;
527  //devices.Add(pcDdevice);
528 
529  return devices.ToArray();
530  }
531 
532  #endregion
533 
534  #region Protected methods
535 
536  /// <summary>
537  /// Method to register the tests.
538  /// </summary>
539  protected virtual void RegisterTests()
540  {
541  }
542 
543  /// <summary>
544  /// Loop through all the tests and save the images.
545  /// </summary>
546  /// <param name="gameTime">the game time.</param>
547  protected override void Draw(GameTime gameTime)
548  {
549  base.Draw(gameTime);
550 
551  if (runTests && !isServer)
552  {
554  {
555  CloseClient();
556  Exit();
557 #if SILICONSTUDIO_PLATFORM_ANDROID
558  Android.OS.Process.KillProcess(Android.OS.Process.MyPid());
559 #endif
560  }
561  else if (FrameGameSystem.TakeSnapshot)
562  SaveBackBuffer(gameTime.FrameCount - 1); // because first draw happens at frame 1
563  }
564  }
565 
566  #endregion
567 
568  #region Private methods
569 
570  /// <summary>
571  /// Create the server and start it.
572  /// </summary>
573  private void SetUpServer()
574  {
575  //TODO: IPv6 ?
576  NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
577 
578  serverAddresses = "";
579 
580  foreach (var adapter in nics)
581  {
582  var ip = adapter.GetIPProperties();
583  foreach (var addr in ip.UnicastAddresses)
584  {
585  if (addr.Address.AddressFamily == AddressFamily.InterNetwork && !String.IsNullOrEmpty(addr.Address.ToString()) && !addr.Address.ToString().Equals(@"127.0.0.1"))
586  serverAddresses = String.Join(IpAddressesSplitCharacter.ToString(), serverAddresses, addr.Address);
587  }
588  }
589 
590  if (serverAddresses.Equals(""))
591  {
592  Console.WriteLine(@"No IP address found.");
593  return;
594  }
595 
596  var rand = new Random();
597  serverPort = 20000 + (int)(100.0 * rand.NextDouble()); // range [20000, 20100]
598  server = new TcpListener(IPAddress.Any, serverPort);
599  Console.WriteLine(@"Server listening to port {0}", serverPort);
600  serverUp = true;
601  server.Start();
602  }
603 
604  /// <summary>
605  /// Setup all needed for the client.
606  /// </summary>
607  public void SetUpClient()
608  {
609  client = new TcpClient();
610  }
611 
612  /// <summary>
613  /// Run the test on the specified device.
614  /// </summary>
615  /// <param name="device">The device.</param>
616  private void RunTestOnDevice(ConnectedDevice device)
617  {
618  switch (device.Platform)
619  {
620  case TestPlatform.WindowsDx:
621  case TestPlatform.WindowsOgl:
622  case TestPlatform.WindowsOgles:
623  RunWindowsTest(device.Serial, device.Platform);
624  break;
625  case TestPlatform.Android:
626  if (onBamboo)
627  RunAndroidTestOnBamboo(device.Serial);
628  else
629  RunAndroidTest(device.Serial);
630  break;
631  case TestPlatform.Ios:
632  break;
633  default:
634  throw new ArgumentOutOfRangeException();
635  }
636  }
637 
638  /// <summary>
639  /// Run the test on Android through a bat file.
640  /// </summary>
641  private void RunAndroidTest(string serial)
642  {
643  try
644  {
645  var testName = this.GetType().Name;
646  Process.Start(
647  new ProcessStartInfo(@"Scripts\RunAndroidUnitTest.bat", serverAddresses + " "
648  + serverPort + " "
649  + buildNumber + " "
650  + serial + " "
651  + testName + " "
652  + assemblyNameForAndroid + " "
653  + CsprojLocationForAndroid)
654  {
655  UseShellExecute = false,
656  CreateNoWindow = false,
657  });
658  }
659  catch
660  {
661  Console.WriteLine(@"An error was thrown when running the test on Android.");
662  dataReceivedEvent.Set();
663  }
664  }
665 
666  /// <summary>
667  /// Run the test on Android through a bat file.
668  /// </summary>
669  private void RunAndroidTestOnBamboo(string serial)
670  {
671  try
672  {
673  // force stop - only works for Android 3.0 and above.
674  var o0 = ShellHelper.RunProcessAndGetOutput(@"adb", @"-s " + serial + @" am shell force-stop " + assemblyNameForAndroid);
675 
676  // install
677  var o1 = ShellHelper.RunProcessAndGetOutput(@"adb", @"-s " + serial + @" -d install -r ..\..\Bin\Android-AnyCPU-OpenGLES\" + assemblyNameForAndroid + "-Signed.apk");
678 
679  // run
680  var parameters = new StringBuilder();
681  parameters.Append("-s "); parameters.Append(serial);
682  parameters.Append(@" shell am start -a android.intent.action.MAIN -n " + assemblyNameForAndroid + "/siliconstudio.paradox.graphicstests.GraphicsTestRunner");
683  AddAndroidParameter(parameters, TestRunner.ParadoxServerIp, serverAddresses);
684  AddAndroidParameter(parameters, TestRunner.ParadoxServerPort, serverPort.ToString());
685  AddAndroidParameter(parameters, TestRunner.ParadoxBuildNumber, buildNumber.ToString());
686  AddAndroidParameter(parameters, TestRunner.ParadoxDeviceSerial, serial);
687  AddAndroidParameter(parameters, TestRunner.ParadoxTestName, this.GetType().Name);
688 
689  Console.WriteLine(parameters.ToString());
690 
691  ShellHelper.RunProcess(@"adb", parameters.ToString());
692  }
693  catch
694  {
695  Console.WriteLine(@"An error was thrown when running the test on Android.");
696  dataReceivedEvent.Set();
697  }
698  }
699 
700  /// <summary>
701  /// Run the test on Windows through a bat file.
702  /// </summary>
703  private void RunWindowsTest(string serial, TestPlatform platform)
704  {
705  try
706  {
707  var command = new StringBuilder();
708  var parameters = new StringBuilder();
709  command.Append(@"..\..\Bin\");
710  switch (platform)
711  {
712  case TestPlatform.WindowsDx:
713  command.Append(@"Windows-AnyCPU-Direct3D\");
714  break;
715  case TestPlatform.WindowsOgl:
716  command.Append(@"Windows-AnyCPU-OpenGL\");
717  break;
718  case TestPlatform.WindowsOgles:
719  command.Append(@"Windows-AnyCPU-OpenGLES\");
720  break;
721  default:
722  throw new ArgumentOutOfRangeException("platform");
723  }
724  command.Append(@"SiliconStudio.Paradox.Graphics.Regression.exe");
725 
726  parameters.Append(serverAddresses);
727  parameters.Append(" "); parameters.Append(serverPort);
728  parameters.Append(" "); parameters.Append(buildNumber);
729  parameters.Append(" "); parameters.Append(serial);
730  parameters.Append(" "); parameters.Append(this.GetType().Name);
731  parameters.Append(" "); parameters.Append(this.GetType().Assembly.ManifestModule.Name);
732 
733  Console.WriteLine(@"Running: " + command.ToString() + @" " + parameters.ToString());
734 
735  var outputs = ShellHelper.RunProcessAndGetOutput(command.ToString(), parameters.ToString());
736  foreach (var output in outputs.OutputLines)
737  Console.WriteLine(output);
738 
739  foreach (var output in outputs.OutputErrors)
740  Console.WriteLine(output);
741  }
742  catch (Exception e)
743  {
744  Console.WriteLine(@"An error was thrown when running the test on Windows.");
745  dataReceivedEvent.Set();
746  }
747  }
748 
749  /// <summary>
750  /// Send the data of the test to the server.
751  /// </summary>
752  /// <param name="image">The image to send.</param>
753  /// <param name="serial">The serial of the device.</param>
754  /// <param name="testName">The name of the test.</param>
755  public void SendImage(Image image, string serial, string testName, int frameIndex)
756  {
757  ImageTester.SendImage(new TestResultImage { BaseVersionFileName = BaseVersionFileName, BaseVersion = BaseVersionNumber, CurrentVersion = CurrentVersionNumber, Image = image }, testName);
758  }
759 
760  /// <summary>
761  /// Closes the client.
762  /// </summary>
763  private void CloseClient()
764  {
765  if (isClientConnected)
766  {
767  Console.WriteLine(@"Close client.");
768  client.GetStream().Close();
769  client.Close();
770  isClientConnected = false;
771  }
772  }
773 
774  #endregion
775 
776  #region Helper structures and classes
777 
778  /// <summary>
779  /// A structure to store information about the connected test devices.
780  /// </summary>
781  public struct ConnectedDevice
782  {
783  public string Serial;
784  public string Name;
785  public TestPlatform Platform;
786 
787  public override string ToString()
788  {
789  return Name + " " + Serial + " " + PlatformPermutator.GetPlatformName(Platform);
790  }
791  }
792 
793  #endregion
794  }
795 }
ConnectedDevice[] ListIOsDevices()
Lists all the Android devices accessible from the computer.
void Init(string ipString, int port, int bNumber, string serial)
Initialize the game with the corresponding values.
void SaveBackBuffer(int frameIndex)
Save the image locally or on the server.
Provides method to instantiate an image 1D/2D/3D supporting TextureArray and mipmaps on the CPU or to...
Definition: Image.cs:88
RenderTarget BackBuffer
Gets the back buffer sets by the current Presenter setup on this device.
ConnectedDevice[] ListAndroidDevices()
Lists all the Android devices accessible from the computer.
string GenerateBaseFileNameFromVersion(TestPlatform platform, string deviceName)
Get the name of the base image to compare the generated images to.
void RunTest(ConnectedDevice device, GameContext gameContext=null)
Run the test.
Performs primitive-based rendering, creates resources, handles system-level variables, adjusts gamma ramp levels, and creates shaders. See The+GraphicsDevice+class to learn more about the class.
Current timing used for variable-step (real time) or fixed-step (game time) games.
Definition: GameTime.cs:31
ConnectedDevice[] ListDevices()
Lists all the devices accessible from the computer.
bool TakeSnapshot
Flag stating that a screenshot should be taken.
int FrameCount
Gets the current frame count since the start of the game.
Definition: GameTime.cs:97
ConnectedDevice[] ListPcD3DDevices()
Lists all the D3D PC devices accessible from the computer.
void SendImage(Image image, string serial, string testName, int frameIndex)
Send the data of the test to the server.
bool AllTestsCompleted
Flag stating that all the tests have been rendered.
Contains context used to render the game (Control for WinForm, a DrawingSurface for WP8...
Definition: GameContext.cs:31
override void Draw(GameTime gameTime)
Loop through all the tests and save the images.
readonly Texture Texture
The underlying texture.
Definition: RenderTarget.cs:17
ConnectedDevice[] ListPcOglEsDevices()
Lists all the OpenGL ES PC devices accessible from the computer.
void SaveImage(Texture textureToSave, int frameIndex)
Save the image locally or on the server.
ConnectedDevice[] ListPcOglDevices()
Lists all the OpenGL PC devices accessible from the computer.
Base class for texture resources.
Definition: Texture.cs:38
A structure to store information about the connected test devices.