summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2024-09-28 18:29:17 +0200
committerUlrich Müller <ulm@gentoo.org>2024-10-02 23:00:39 +0200
commit34bb7dbb2d527e839dd13b4faf67a919a8fa8921 (patch)
treea8a0d17368be45fb24076a319cb858ab5d011d71
parentEnable bug-reference-prog-mode in ebuild-repo-mode (diff)
downloadebuild-mode-34bb7dbb2d527e839dd13b4faf67a919a8fa8921.tar.gz
ebuild-mode-34bb7dbb2d527e839dd13b4faf67a919a8fa8921.tar.bz2
ebuild-mode-34bb7dbb2d527e839dd13b4faf67a919a8fa8921.zip
Support skip-unless in XEmacs test wrapper
* test/xemacs-test-wrapper.el (skip-unless): New function. (test-skipped): New error symbol. (ert-deftest): Handle it. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r--ChangeLog4
-rw-r--r--test/xemacs-test-wrapper.el11
2 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 81da37f..c03e250 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2024-09-28 Ulrich Müller <ulm@gentoo.org>
+ * test/xemacs-test-wrapper.el (skip-unless): New function.
+ (test-skipped): New error symbol.
+ (ert-deftest): Handle it.
+
* ebuild-mode.el (ebuild-mode-enable-bug-reference):
New custom variable.
(ebuild-mode-bug-regexp, ebuild-mode-bug-url-format):
diff --git a/test/xemacs-test-wrapper.el b/test/xemacs-test-wrapper.el
index 930d7ff..1410015 100644
--- a/test/xemacs-test-wrapper.el
+++ b/test/xemacs-test-wrapper.el
@@ -13,8 +13,15 @@
(require 'test-harness)
(provide 'ert) ; pretend that ERT is present
-(defmacro ert-deftest (_name _args &rest body)
- `(progn ,@body))
+(define-error 'test-skipped "Test skipped")
+
+(defmacro ert-deftest (name _args &rest body)
+ `(condition-case nil
+ (progn ,@body)
+ (test-skipped (message "SKIP: %s" ',name))))
+
+(defun skip-unless (cond)
+ (unless cond (signal 'test-skipped nil)))
(defmacro should (assertion)
(let ((args (ignore-errors