Beef icon indicating copy to clipboard operation
Beef copied to clipboard

[Enhancement] A few ideas for tests

Open xposure opened this issue 5 years ago • 3 comments

  • Ability to add attributes to categorize tests so you can only run a set of tests
  • Ability to right click a function that has [Test] and debug it without going in to menus.
  • Look at test specific helper methods (something like shouldly for .net for example). Its possible these methods could use the compiler features for capturing caller information like source file, line numbers, etc. So prior to dumping a fatal error it can dump source information to the console.
  • Possibly add support for Console.WriteLine or System.Diagnostics.Debug to have its output redirected to the Output window.

xposure avatar Dec 23 '20 18:12 xposure

Adding your thoughts you posted in chat for reference...

1) Test.Assert / Test.Fail should just continue execution. 
2) We should report all failed tests, not just stop at the first one. For crashes we should just restart the test program and begin at the test index after the one that just crashed
3) There should be a Test.WriteLine output method. Or Console.WriteLine should just be redirected back to the test harness during testing...
Oh, and 4) Tests should actually print some "failure text" when they fail.

xposure avatar Dec 26 '20 16:12 xposure

Provide better test reporting on memory leaks instead of the following error.

ERROR: Test process exited with error code: 2147483651

xposure avatar Dec 26 '20 19:12 xposure

There are some improvements checked in at https://github.com/beefytech/Beef/commit/78ae79b802f97aaf3c76fea6caf1598e0462c2e7

  1. All tests are run even if they crash
  2. Test.Assert / Test.Fail don't crash anymore, they just mark the test as failed
  3. You get error text with source and line info on failures
  4. You can see Console output from the tests

bfiete avatar Dec 29 '20 17:12 bfiete