all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Testing errors from macros with ERT and byte-compilation
@ 2013-08-18 10:56 David Engster
  2013-08-18 18:55 ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: David Engster @ 2013-08-18 10:56 UTC (permalink / raw)
  To: emacs-devel

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-18 19:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-18 10:56 Testing errors from macros with ERT and byte-compilation David Engster
2013-08-18 18:55 ` Glenn Morris
2013-08-18 19:13   ` David Engster

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.