Support for bootstrapped / self-host ClojureScript

Description

Revise test.check so that it can be used in bootstrapped environments. Additionally, add an ability to regression-test test.check for bootstrapped use.

Rationale: ClojureScript libraries and/or applications may wish to target bootstrapped ClojureScript while also making use of test.check.

Background: The cljs.test library has recently been ported for use with bootstrapped ClojureScript. (). It has been shown that the test.check library can be made work with minor modification (removal of the :clj reader conditional guarding defspec). Further work would need to be done to ensure that such a modification is acceptable and that test.check's unit tests can be executed in a bootstrap environment (perhaps via a script running the tests in Node.)

Environment

None

Attachments

2

Activity

Show:

Mike Fikes September 7, 2016 at 12:03 PM

Thanks Gary!

gfredericks September 7, 2016 at 3:34 AM

I just applied the patch to master, thanks for putting it together!

Unless self-hosted cljs becomes rather more popular, I'm not planning on putting active effort into supporting it, but I intend to at least keep the tests passing. If there's any particular regression you're worried about, feel free to add more tests.

Mike Fikes September 4, 2016 at 9:52 PM

Hi Gary, TCHECK-105-2.patch attached for your comment.

This revision passes when applied to master (you simply need to run script/test-self-host).

It makes use of lein to obtain the latest ClojureScript JAR (employing a special profile for self host). This differs from the previous patch which required you to manually grab cljs.jar and place it in the lib directory.

Since it depends on the shipping ClojureScript dep (and not the standalone cljs.jar, which bakes in Transit), the entire Transit issue is sidestepped: The ClojureScript compiler only emits Transit if the Transit dep is present; since it is not with this revision, everything works in terms of EDN.

Happy to revise things, and comment where you believe could be helpful, as you see fit.

Mike Fikes September 4, 2016 at 8:20 PM

Hi Gary, I'll see if I can get it to work with perhaps a special lein profile that specifies the latest ClojureScript along with Transit for the purposes of testing under self-hosted ClojureScript. That way there'd be no need to manually download anything and tests could be run in an automated fashion by just running script/test-self-host.

I'll also need to update things for the latest stuff in master of test.check.

gfredericks September 3, 2016 at 10:41 PM

Now that I'm rereading the comments, it sounds like we could have automated tests just by adding transit? If it's not difficult, I'd definitely prefer tests, since the code is uglier this well and I'll be forever tempted to make it nicer .

If so, I'd also prefer that most of the technical explanation live wherever the entrypoint to the tests is, with the inline comments just pointing to that.

Is there a reason why cljs.jar or something equivalent can't be obtained through maven?

Sorry for the slow turnaround.

Completed

Assignee

Reporter

Patch

Priority

Created May 1, 2016 at 9:02 PM
Updated September 7, 2016 at 12:03 PM
Resolved September 7, 2016 at 12:03 PM