abmclin
2018-2-14 18:16:00

@mflatt are there any tests defined for various raco commands like raco make, raco test, raco pkg etc? I’m trying create unit tests for a raco command I’ve created but am finding it tricky since the main way to invoke a raco command programmatically seems to be dynamic-requireing the module but dynamic-require won’t reload the module if its already been required in a test-case earlier in the file.

I’m wondering if the right approach is to create a fresh namespace for each test-case and dynamic-requireing the raco command into that namespace. Not sure what’s the most effective way to unit test a raco command.


mflatt
2018-2-14 18:19:19

@abmclin The raco exe tests are in “pkgs/compiler-test/tests/compiler/embed/test.rkt”, and you’ll see that those use system*. The raco pkg tests do, too, with a more sophisticated harness. But using dynamic-require in a fresh namespace seems like a better idea.


abmclin
2018-2-14 18:19:58

thanks! I’ll go check those tests out


abmclin
2018-2-14 18:41:53

using the fresh namespace approach works very well but an argument can be made that using system* captures the natural way a raco command would be invoked so it’s debatable whether one or the other is better.


leif
2018-2-14 22:48:12

Does scale/improve-new-text still do anything different than scale?


leif
2018-2-14 22:48:46

I ask because the example in the docs look exactly the same to me, and when I try to make an example that would make it extremely obvious, it still looks exactly the same:


leif
2018-2-14 22:48:47

mflatt
2018-2-14 22:50:50

It depends on the graphics library, but I don’t know whether there are any left where scale/improve-new-text still improves new text.


leif
2018-2-14 22:51:16

AH, okay.


leif
2018-2-14 22:51:36

I guess I only tried it on macosx and linux builds.


leif
2018-2-14 22:51:51

Kind of interesting that that would make a difference, thanks. :slightly_smiling_face: