maxitg / SetReplace

C++/Wolfram Language package for exploring set and graph rewriting systems
MIT License
216 stars 43 forks source link

New flags and QoL improvements in test script #526

Closed taliesinb closed 3 years ago

taliesinb commented 3 years ago

This change introduces the following improvements to the test.wls script:


This change is Reviewable

taliesinb commented 3 years ago

@maxitg , I've made sure that if the RequiresFrontEnd option is not explicitly set, then the default will be True for existing test files that use the frontend through graphicsQ etc (it is a no-op to nest UsingFrontEnd, of course).

Also, this PR switches the default for ./test.wls from loading the installed paclet (e.g. requiring you to call ./install.wls first), to loading "Kernel/init.m", e.g. the local file tree of which test.wls is a part. This PR therefore should wait until we have landed another PR which will switch to "in-place builds" that remove the need for the "/Build" subdirectory. That will come later tonight!

Also, if desired I can add the functionality that will automatically fail the test suite if the C++ code doesn't match the built hash.

Now, this change in which file is loaded will break the CI testing system, we can discuss what to do about that. I see three options:

  1. have "./test.wls" load the local tree by default, and change the CI testing system so that it calls ./test.wls with the special "--load-installed-paclet" flag to have it load the installed paclet instead.
  2. keep the current behavior, and have developers have to call "./test.wls --load-local-codebase" explicitly to load the local tree instead of the installed paclet.
  3. check some AntProperty to figure out if we are being run on the CI servers, and pick the right default behavior that way.

I prefer 1, since it is the behavior that developers will want to use on a day-to-day basis.

maxitg commented 3 years ago

@taliesinb, I agree with 1, however, ./build.wls && ./install.wls && ./test.wls (and even ./build.wls && ./test.wls) should still cause the tests to pass (it would not be user friendly otherwise), which means CI should not fail (although we do want to change it to use -lip to make sure the paclet is built correctly).

It's actually very easy to modify what the CI does by changing this file and the scripts used therein (it has nothing to do with Ants, it's just using ordinary build/install/test scripts).

taliesinb commented 3 years ago

Oh, I should also mention that I've included a hack to fixed the nasty InputForm spew that used to happen if a subkernel prints anything or issues a message. It is now much more readable (and even colored orange to draw attention!).