[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Testing errors from macros with ERT and byte-compilation
From: |
David Engster |
Subject: |
Testing errors from macros with ERT and byte-compilation |
Date: |
Sun, 18 Aug 2013 12:56:51 +0200 |
User-agent: |
Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux) |
I have a bit of a hard time porting the EIEIO test suite to use ERT. My
problem is with testing failures from macros and their byte
compilation. An example:
(require 'eieio)
(require 'ert)
(ert-deftest eieio-broken-initform ()
(should-error
(defclass broken-init nil
((broken :initform 1
:type string))
"This class should break.")
:type 'invalid-slot-type))
While this works fine when eval'ed, I cannot byte-compile this because
the macro expansion fails, obviously:
Compiling file /home/void/foo.el at Sun Aug 18 12:48:13 2013
foo.el:4:1:Error: Invalid slot type: broken, string, 1
Is there some trick I could use? Simply wrapping the defclass in 'progn'
does not work.
Or should I just use 'no-byte-compile: t' for the test suite?
-David
- Testing errors from macros with ERT and byte-compilation,
David Engster <=