[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: |
Fri, 27 Jan 2017 20:03:35 +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 dfddc2d 262/316: (cit-make-dist): Use cit-check-compilation-for-error., (continued)
- [Emacs-diffs] scratch/merge-cedet-tests dfddc2d 262/316: (cit-make-dist): Use cit-check-compilation-for-error., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 6d5a631 277/316: Add header comments and provide., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 9b917c5 152/316: Major test restructure, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests c672504 249/316: etc/srecode/c.srt: New file, contents from cpp.srt, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests ecb61db 211/316: New test files combining macros and EDE, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests e4d6b74 280/316: Use new create functions for db tools, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 0041d52 314/316: Add header comments and provide., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 0141378 247/316: Remove obsolete cvs-auto-updated 'X-RCS' line., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests ede9f83 214/316: Simplify alias referencing and add tests., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests da4dd24 253/316: New test for testing ede/cpp-root projects., Edward John Steere, 2017/01/27
- [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 ef840da 159/316: compdb: add project detection tests, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests fba6409 297/316: Add test for parsing local variables, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 658ff90 205/316: (cedet-utest): Add EDE sanity check to the end., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 99ad7b6 206/316: Added security test, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 8989dc6 313/316: New Tests for ede-java-root-project type., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests e145e4d 088/316: ("Lisp"): Add cit-cpp, cit-el, cit-texi, cit-load, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests aa72e43 200/316: Fix unit testing for several tests and do better error checking., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests b85662e 218/316: New file, derived from logging functions in cedet-utest.el, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 9cac087 281/316: Remove obsolete cvs-auto-updated 'X-RCS' line., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests ad45c79 263/316: Remove obsolete cvs-auto-updated 'X-RCS' line., Edward John Steere, 2017/01/27