[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/merge-cedet-tests b0da906 144/316: New unit test f
From: |
Edward John Steere |
Subject: |
[Emacs-diffs] scratch/merge-cedet-tests b0da906 144/316: New unit test for EDE project detection. |
Date: |
Sat, 28 Jan 2017 09:09:55 +0000 (UTC) |
branch: scratch/merge-cedet-tests
commit b0da9061e11e08cfcc9474197ef4fa7b5fe98010
Author: Eric Ludlam <address@hidden>
Commit: Edward John Steere <address@hidden>
New unit test for EDE project detection.
---
test/manual/cedet/cedet/ede/detect-utest.el | 102 +++++++++++++++++++++++++++
1 file changed, 102 insertions(+)
diff --git a/test/manual/cedet/cedet/ede/detect-utest.el
b/test/manual/cedet/cedet/ede/detect-utest.el
new file mode 100644
index 0000000..41ecb5e
--- /dev/null
+++ b/test/manual/cedet/cedet/ede/detect-utest.el
@@ -0,0 +1,102 @@
+;;; ede/detect.el --- Tests for detecting different kinds of projects.
+;;
+;; Copyright (C) 2014 Eric M. Ludlam
+;;
+;; Author: Eric M. Ludlam <address@hidden>
+;;
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation, either version 3 of the
+;; License, or (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see http://www.gnu.org/licenses/.
+
+;;; Code:
+
+(require 'ede/linux)
+
+(defvar ede-detect-utest-project-list
+ '(
+ ( "src/proj/Project.ede" . ede-proj-project-p )
+ ( "src/automake/Makefile.am" . project-am-makefile-p )
+ ( "src/android/AndroidManifest.xml" . ede-android-project-p )
+ ( "src/android/src/test.java" . ede-android-project-p )
+ ( "src/emacs/Makefile" . ede-emacs-project-p )
+ ( "src/emacs/src/emacs.c" . ede-emacs-project-p )
+ ;( "src/ant/build.xml" . ede-ant-project-p )
+ ( "src/linux/Makefile" . ede-linux-project-p )
+ ( "src/linux/scripts/ver_linux" . ede-linux-project-p )
+ )
+ "List of sources to load in ndetectable projects.
+Each entry is a cons cell:
+ ( SRCFILE . PROJECT-TYPE )")
+
+;;;###autoload
+(defun ede-detect-utest ()
+ "Test out the detection scheme for EDE."
+ (interactive)
+ (save-excursion
+
+ (let ((errlog nil)
+ (project-linux-build-directory-default 'same)
+ (project-linux-architecture-default "glnx")
+ (ede-project-directories t) ; safe to load Project.ede
+ )
+ (cedet-utest-log-setup "EDE DETECT")
+
+ (set-buffer (semantic-find-file-noselect
+ (expand-file-name "cedet/ede/detect.el"
+ cedet-utest-root)))
+
+ (dolist (fl ede-detect-utest-project-list)
+
+ ;; Make sure we have the files we think we have.
+ (when (not (file-exists-p (car fl)))
+ (error "Cannot find unit test file: %s" (car fl)))
+
+ ;; Do the detection
+ (let ((fb (find-buffer-visiting (car fl)))
+ (b (semantic-find-file-noselect (car fl))))
+
+ (save-excursion
+ (set-buffer b)
+
+ ;; Run the EDE detection code. Firing up the mode isn't really
needed.
+ (ede-initialize-state-current-buffer)
+
+ ;; Test the result.
+ (unless (funcall (cdr fl) ede-object-root-project)
+
+ (message "Found %S, wanted %S"
+ ede-object-root-project
+ (cdr fl))
+
+ (push fl errlog))
+ )
+
+ ;; If it wasn't already in memory, whack it.
+ (when (and b (not fb))
+ (kill-buffer b))
+ ))
+
+ (cedet-utest-log-shutdown
+ "EDE DETECT"
+ (when errlog
+ (format "%s Failures found." (length errlog))))
+
+ (when errlog
+ (error "Failures found looking for project in %s" (car (car errlog))))
+ ))
+
+ )
+
+
+(provide 'cedet/ede/detect-utest)
+
+;;; detect.el ends here
- [Emacs-diffs] scratch/merge-cedet-tests 377e041 142/316: Move tests in cedet/semantic, (continued)
- [Emacs-diffs] scratch/merge-cedet-tests 377e041 142/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 702d44d 139/316: Fix how the target file name is created, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 7b417f2 131/316: Tests contributed by Barry OReilly, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests a3da4e8 121/316: Added new file to test completion on STL classes and namespace., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 309ef34 124/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests ae78cf0 140/316: Tests: Add ERT test for the C Bovinator, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 39048f9 153/316: (ede-detect-utest): Re-run tests with inode optimization disabled., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests af4eb43 149/316: Additions to generic project testing, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 614a6bb 044/316: Synchronize base 'cedet/ede' with Emacs, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests a375d40 093/316: ("cit"): Give it a new name. (Misc): New target., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests b0da906 144/316: New unit test for EDE project detection.,
Edward John Steere <=
- [Emacs-diffs] scratch/merge-cedet-tests 9c2d002 145/316: Added cpproot and java root to detection tests, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 47c4081 165/316: sample lib srces for dirmatch tests., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests ef840da 159/316: compdb: add project detection tests, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 8c4e7fd 111/316: Added arduino and better suggestions, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 6945c33 126/316: Expand preprocessor to handle macros which open or close scope., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 89526ab 134/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 0e41dab 116/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 8ba639f 150/316: (ede-detect-utest-project-list): Add jvm-base projects for ant, lein, maven, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 284144e 154/316: Fixes for test execution, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests fa54ec1 162/316: (isFooLike, A, B, main2): New test tweaked from example by Liang Wang, Edward John Steere, 2017/01/28