4
$\begingroup$

Say I have a couple of tests like the following:

Test[ g[f[10]], 100, TestID -> "Test-1-g" ] Test[ h[f[10]], 200, TestID -> "Test-2-h" ] 

Further, assume that f[10] is not cheap. So I would like to initialize it as an environment variable for this suite of tests. What is the correct way to do this in MUnit? I cannot seem to find any documentation on the official page for an initialization function.

$\endgroup$
4
  • $\begingroup$ Never mind! I think just defining a variable at the top of the file, like a = f[10]; works fine! I just thought that everything in a .mt file had to be inside a Test* function of some kind. $\endgroup$ Commented Oct 8, 2014 at 0:14
  • $\begingroup$ read this $\endgroup$ Commented Oct 8, 2014 at 5:44
  • $\begingroup$ @molekyla777 Post it as an answer and I will upvote it. $\endgroup$ Commented Oct 8, 2014 at 10:14
  • $\begingroup$ @Shredderroy I have removed your comment in your question to close it. I think it is a valid and good question and someone else might stumble upon the same issue at some point. I asked molekyla777 to post an answer. If he doesn't, feel free to do it yourself and include his link to the documentation. $\endgroup$ Commented Oct 8, 2014 at 10:17

1 Answer 1

4
$\begingroup$

Probably Child Test Files can help in your case. link

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.