[Elements feature request] Tests in the same project

This request is not limited to Mercury, but for all languages in the Elements Suite. For this request I use the Mercury Syntax.

In Elements, we have test projects - that are completely integrated in Water and Fire.

Request 1: Can it be integrated in VS too - That, when we do a debug build the tests are executed?

Request 2: I always found it hard to maintain tests in a separate project (this is true for all test suites); I would like to have my test methods in the same project as the code.

To add a test method, it would be nice if I could just use the attribute to make a Sub a test method, which is only compiled into the Debug version and run on each build.

Prerequisites: A test method can not have a return value and should be shared (static).

With EUnit you can already do that; all you need is a way in main() to optionally run the test runner instead of tour actual app entry point, say based on the presence of the --EUNIT_PARSABLE_MESSAGES parameter that Fire/Water pass to your exe when run in Test mode.

If your project references EUnit, the Test command in the menu becomes available automaticallty, too.

Sure,; just as with everything, VS takes more effort to do and the team has more on their plate that with Fire/Water :(. I’ll log a feature request.

No, this would have to be a separate command? You’d still wanna be a le to run for actual app in Debug mode as well…

1 Like

Thanks, logged as bugs://84295

1 Like