testsuite: suppress mangling compatibility aliases
[official-gcc.git] / contrib / mdcompact / mdcompact-testsuite.el
blob494c0b5cd683e1d9fe0c15744f06a9042be84db9
1 ;;; -*- lexical-binding: t; -*-
3 ;; This file is part of GCC.
5 ;; GCC is free software: you can redistribute it and/or modify it
6 ;; under the terms of the GNU General Public License as published by
7 ;; the Free Software Foundation, either version 3 of the License, or
8 ;; (at your option) any later version.
10 ;; GCC is distributed in the hope that it will be useful, but WITHOUT
11 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
13 ;; License for more details.
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with GCC. If not, see <https://www.gnu.org/licenses/>.
18 ;;; Commentary:
20 ;;; Usage:
21 ;; $ emacs -batch -l mdcompact.el -l mdcompact-testsuite.el -f ert-run-tests-batch-and-exit
23 ;;; Code:
25 (require 'mdcompact)
26 (require 'ert)
28 (defconst mdcompat-test-directory (concat (file-name-directory
29 (or load-file-name
30 buffer-file-name))
31 "tests/"))
33 (defun mdcompat-test-run (f)
34 (with-temp-buffer
35 (insert-file-contents f)
36 (mdcomp-run-at-point)
37 (let ((a (buffer-string))
38 (b (with-temp-buffer
39 (insert-file-contents (concat f ".out"))
40 (buffer-string))))
41 (should (string= a b)))))
43 (defmacro mdcompat-gen-tests ()
44 `(progn
45 ,@(cl-loop
46 for f in (directory-files mdcompat-test-directory t "md$")
47 collect
48 `(ert-deftest ,(intern (concat "mdcompat-test-"
49 (file-name-sans-extension
50 (file-name-nondirectory f))))
52 (mdcompat-test-run ,f)))))
54 (mdcompat-gen-tests)
56 ;;; mdcompact-testsuite.el ends here