Menu

Automatically Run Tests

Help
2006-08-11
2012-10-22
  • BinaryRefinary

    BinaryRefinary - 2006-08-11

    I'd like to be able to automatically run all the tests when my test harness app starts (e.g. to run unit tests from a command line after a project build). Is there any way to do this?

    Cheers,

    Trev.

     
    • Kelly Ethridge

      Kelly Ethridge - 2006-08-17

      Ok ok, you can use the great hack of SendKeys "{enter}" in the Form_Load event to hit the run button! That's just funny, but it works heh.

       
    • Kelly Ethridge

      Kelly Ethridge - 2006-08-14

      Hello,

      Are you refering to running the GUI frontend from the command line? If so, have you tried checking the "Automatically Run Tests" box on the GUI? Or are you using some other reporting mechanism?

      Kelly

       
    • BinaryRefinary

      BinaryRefinary - 2006-08-17

      Aha... thanks... that worked.

      From a design standpoint, I'm not sure if I like this approach. I'd prefer a RunTests() method that I could manually call from the form at startup. This way, I wouldn't have to worry about making sure the checkbox was checked before running the tests from a command line script.

      In the end, I'm aiming at a GUI-less unit test app that is run as part of the build process - test results would be logged to the build log file. A RunTests() method would make it a lot easier.

      Thanks for the great work... it really is a masterpiece.

       
    • Kelly Ethridge

      Kelly Ethridge - 2006-08-17

      I understand what you're saying. You can build your own GUI-less test-runner and just use a reference to the SimplyVBUnitLib DLL. That would cut out the entire GUI side. For instance, I included a simple non-gui project that just runs in a module and outputs to the immediate window.

      If you want to keep the GUI side still, you could create a new TestSuite object and add your tests to that instead of using AddTest. After all the tests are added you could run the test suite directly if you ran the app with a command-line parameter or you could add that TestSuite object to the AddTests method and let the GUI run it.

       

Log in to post a comment.