emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

New package, faceup, for font-lock regression testing


From: Anders Lindgren
Subject: New package, faceup, for font-lock regression testing
Date: Thu, 26 Oct 2017 21:33:42 +0200

Hi!

I just added a new module to Emacs, "faceup". The main purpose of this
module is for regression testing of font-lock keywords. It is designed
to work with the built-in ERT regression test system. It has been
available on GitHub and on Melpa for a couple of years. The motivation
for including it in Emacs is to modernize the tests for the built-in
modes.

"Faceup" is a semi-human readable markup language, that looks like the
following:

    «k:this» is a keyword

Common font-lock keywords use a short form, "k" in this case represent
`font-lock-keyword-face'. Other faces, or plain face attributes, use a
more verbose format.

The idea is that test suites for various modes can use this markup
format to save a source file, with highlighting. The regression test
can later compare this with the current highlighting.

The system scales well. In some of my projects I've applied it to
files thousands of lines long.

Of course, the Faceup markup language can be used for other purposes
as well. One example that comes to mind is that it should be possible
to used it as the storage format for a rich-text mode.

The following are concrete examples where this package has been used
for regression testing:

    https://github.com/Lindydancer/lisp-extra-font-lock

    https://github.com/Lindydancer/cmake-font-lock

    https://github.com/Lindydancer/nocomments-mode

    https://github.com/Lindydancer/preproc-font-lock

    https://github.com/Lindydancer/objc-font-lock

In addition, for various major modes, I've collected "typical"
non-trivial source files:

    https://github.com/Lindydancer/font-lock-regression-suite

See bug#16063 and bug#28311 for more information.

    -- Anders Lindgren


reply via email to

[Prev in Thread] Current Thread [Next in Thread]