automated testing with CL & darcs

I spent a good chunk of today trying to get darcs to run my unit tests automatically. I haven\’t actually gotten it right yet, but at least I have it running the tests before each commit (even if the commit happens regardless).

I set up the auto-testing with darcs setpref test \"chmod +x test/run-tests; test/run-tests\". test/run-tests is the test script, but darcs doesn\’t allow you to add executable files to the repository, so you have to run chmod on the script before it can actually be executed.

Here\’s the test script itself:

enscript: couldn't find prolog "enscript.pro": No such file or directory %!PS-Adobe-3.0 %%BoundingBox: 24 24 571 818 %%Title: Enscript Output %%For: Greg Pfeil %%Creator: GNU enscript 1.6.4 %%CreationDate: Fri Sep 19 08:47:52 2014 %%Orientation: Portrait %%Pages: (atend) %%DocumentMedia: A4 595 842 0 () () %%DocumentNeededResources: (atend) %%EndComments %%BeginProlog %%BeginResource: procset Enscript-Prolog 1.6 4

What it should be doing is running the tests, and returning non-zero on failure. It runs the tests, but the failure bit isn\’t exactly happening yet.

I figured I\’d throw this out there and see if anyone else has a decent way of getting automated testing happening. The more I try to bridge between Lisp and Unix, the more I just want to live in a Lisp REPL.

4 Responses to “automated testing with CL & darcs”

  1. D Herring Says:

    Have you considered switching to git?

    • stores unix permissions (i.e. can store executables)
    • easy commit hooks; each .git directory contains a hooks subdir; you simply edit and chmod the script; in your case, the pre-commit hook would do the job
    • much other goodness (speed, gitk, git-citool, git-gui, crypto hash checks, …)
  2. Greg Pfeil Says:

    I actually meant to mention that in the post. I do plan to use git on any new projects. I don’t know if it’s available for common-lisp.net projects yet, though.

  3. D Herring Says:

    Unfortunately, Git is not yet installed on c-l.net. There is a consensus to install it, but nobody with the permissions has had the time.

  4. Robert Goldman Says:

    One of the issues you are running against is the fact that the asdf:test-op doesn’t have a nice means of returning answers to you to tell you if the test was passed or not. You might suggest modifying ASDF to make this possible (you can find the ASDF maintainers on cclan-list).

Leave a Reply