Replaying a Test from the Command Line

To run Silk4NET tests from the command line, you can use VSTest.Console.exe. This command line executable is included in Visual Studio and does not require any additional tools in addition to Silk4NET to be installed. For additional information on using the VSTest.console from the command line, refer to Using VSTest.console from the command line.

To run your Silk4NET tests from the command line, perform the following actions:

  1. Create a DLL with the tests to be executed. For example, call the DLL myTestFile.dll.
    Note: You can include multiple test classes in a single DLL. All tests in the various test classes will be executed.
  2. Run the tests in the DLL by typing:
    Vstest.console.exe [TestFileNames] [Options]
    For example, to execute the tests in myTestFile.dll, type the following:
    vstest.console.exe myTestFile.dll
    Note: For information on the available command line options, refer to Using VSTest.console from the command line.
  3. To create a TrueLog for a test class, use the <SilkTestClass> annotation. For example, to run the class MyTestClass with TrueLog enabled, use the following class header in your script:
    <SilkTestClass> Public Class MyTestClass
    Then create the DLL, for example myTestClass.dll and execute the tests from the command line by typing:
    vstest.console.exe myTestClass.dll