3 ;; Copyright (C) 2015-2016 Free Software Foundation, Inc.
5 ;; This file is part of GNU Emacs.
7 ;; GNU Emacs is free software: you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation, either version 3 of the License, or
10 ;; (at your option) any later version.
12 ;; GNU Emacs is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;; GNU General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22 ;; This file generates dependencies between test files and the files
25 ;; It has an .emacs-lisp extension because it makes the Makefile easier!
29 (defun make-test-deps (src-dir)
30 (let ((src-dir (file-truename src-dir)))
34 (make-test-deps-lisp src-dir)
35 (make-test-deps-src src-dir)))))
37 (defun make-test-deps-lisp (src-dir)
39 (lambda (file-without-suffix)
40 (format "./%s-tests.log: %s/../%s.el\n"
44 (make-test-test-files src-dir "lisp") ""))
46 (defun make-test-deps-src (src-dir)
48 (lambda (file-without-suffix)
49 (format "./%s-tests.log: %s/../%s.c\n"
53 (make-test-test-files src-dir "src") ""))
55 (defun make-test-test-files (src-dir sub-src-dir)
56 (make-test-munge-files
58 (directory-files-recursively
59 (concat src-dir "/" sub-src-dir)
62 (defun make-test-munge-files (src-dir files)
63 (make-test-sans-suffix
67 (make-test-no-test-dir
68 (make-test-no-resources
71 (defun make-test-sans-suffix (files)
74 (substring file 0 -9))
77 (defun make-test-de-stem (stem files)
85 (defun make-test-no-legacy (list)
86 (make-test-remove list "legacy/"))
88 (defun make-test-no-resources (list)
89 (make-test-remove list "-resources/"))
91 (defun make-test-no-test-dir (list)
92 (make-test-remove list "-tests/"))
94 (defun make-test-remove (list match)
97 (string-match-p match file))