From 664927b5257fdaf26f24063edb1f41c407805ed8 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 25 Sep 2020 14:46:36 +0200 Subject: [PATCH] Add an expensive test for defcustom types * admin/cus-test.el (cus-test-opts): Return the tests. * test/lisp/custom-tests.el (check-for-wrong-custom-types): Test custom types (bug#30990). --- admin/cus-test.el | 11 ++++++++--- test/lisp/custom-tests.el | 5 +++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/admin/cus-test.el b/admin/cus-test.el index 842240946eb..cee8c19ba12 100644 --- a/admin/cus-test.el +++ b/admin/cus-test.el @@ -370,7 +370,9 @@ This function is suitable for batch mode. E.g., invoke in the Emacs source directory. Normally only tests options belonging to files in loaddefs.el. -If optional argument ALL is non-nil, test all files with defcustoms." +If optional argument ALL is non-nil, test all files with defcustoms. + +Returns a list of variables with suspicious types." (interactive) (and noninteractive command-line-args-left @@ -382,9 +384,12 @@ If optional argument ALL is non-nil, test all files with defcustoms." (message "Running %s" 'cus-test-apropos) (cus-test-apropos "") (if (not cus-test-errors) - (message "No problems found") + (progn + (message "No problems found") + nil) (message "The following options might have problems:") - (cus-test-message cus-test-errors))) + (cus-test-message cus-test-errors) + cus-test-errors)) (defun cus-test-deps () "Run a verbose version of `custom-load-symbol' on all atoms. diff --git a/test/lisp/custom-tests.el b/test/lisp/custom-tests.el index cabbf861f14..d94527b558f 100644 --- a/test/lisp/custom-tests.el +++ b/test/lisp/custom-tests.el @@ -147,4 +147,9 @@ (widget-apply field :value-to-internal origvalue) "bar")))))) +(ert-deftest check-for-wrong-custom-types () + :tags '(:expensive-test) + (load (concat installation-directory "admin/cus-test.el")) + (should (null (cus-test-opts t)))) + ;;; custom-tests.el ends here -- 2.39.5