External testing frameworks revisited
Last week I blogged about external testing frameworks. Summary: There are (were) no good ones.
While writing the post, it occured to me how I could extend my own Emtest testing framework to do this sort of thing. I hadn't designed Emtest for this sort of work, but I had designed it to be very modular and extensible.
Since then, I have gone ahead and added a runner to Emtest that does external testing. So I have to modify my previous position. This one, while it's young, is usable and you don't have to write in TCL.
What it is
It's called "external.el" and it's rather like "expect", but all in Elisp.
Its test cases look almost the same as the existing test cases. They are declared in `deftest-3', same as the others. They take a governor of `external' rather than `nil'. The test clause itself consists of, first, a list of bindings, and then a series of interaction forms. The bindings tell how to launch the external process and give other config information. The interaction forms each start with a string to be sent to the external process. They typically also contain a form that receives the response and tests it. The form can be omitted for prompts whose response is not tested.
I am already using this for testing Klink and it's much nicer to use the DejaGNU was, and works whereas Greg doesn't work here.
No comments:
Post a Comment