[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/merge-cedet-tests 86ed340 147/316: Additions to de
From: |
Edward John Steere |
Subject: |
[Emacs-diffs] scratch/merge-cedet-tests 86ed340 147/316: Additions to detection testing |
Date: |
Fri, 27 Jan 2017 20:03:35 +0000 (UTC) |
branch: scratch/merge-cedet-tests
commit 86ed34006f12f39a79d8abdf86119068e5ffd76f
Author: Eric Ludlam <address@hidden>
Commit: Edward John Steere <address@hidden>
Additions to detection testing
* test/manual/cedet/cedet/ede/detect-utest.el:
(ede-detect-utest-project-list): Doc fix
(ede-detect-utest-project-dirmatch-list): New (ede-detect-utest):
Split out body. Pull up start/end logging. Add testing for dirmatch
not loaded/loaded. Add testing for the dirmatch project.
(ede-detect-utest-loop): Previous content of above.
---
test/manual/cedet/cedet/ede/detect-utest.el | 107 ++++++++++++++++++++++++---
1 file changed, 95 insertions(+), 12 deletions(-)
diff --git a/test/manual/cedet/cedet/ede/detect-utest.el
b/test/manual/cedet/cedet/ede/detect-utest.el
index 1a257fc..44714f6 100644
--- a/test/manual/cedet/cedet/ede/detect-utest.el
+++ b/test/manual/cedet/cedet/ede/detect-utest.el
@@ -41,7 +41,15 @@
( "src/javaroot/com/test/Foo.Java" . ede-java-root-project-p )
( "src/javaroot/README" . ede-java-root-project-p )
)
- "List of sources to load in ndetectable projects.
+ "List of sources to load in detectable projects.
+Each entry is a cons cell:
+ ( SRCFILE . PROJECT-TYPE )")
+
+(defvar ede-detect-utest-project-dirmatch-list
+ '(
+ ("src/dirmatch/MyDirmatch/MyDirmatch.cpp" .
ede-detect-test-dirmatch-project-p)
+ )
+ "List of sources to load in projects detected via DIRMATCH feature.
Each entry is a cons cell:
( SRCFILE . PROJECT-TYPE )")
@@ -66,23 +74,61 @@ Each entry is a cons cell:
"Test out the detection scheme for EDE."
(interactive)
(save-excursion
+ ;; Make sure the dirtest project is set-up, but without
+ ;; loading in the project type.
+ (ede-detect-utest-init-dirmatch)
+
+ (cedet-utest-log-setup "EDE DETECT")
+
+ (let ((errlog nil))
+
+ ;; Test all the primary project types.
+ (ede-detect-utest-loop ede-detect-utest-project-list)
+
+ ;; Make sure we didn't accidentally pull in the project using
+ ;; the dirtest project type.
+
+ (if (featurep 'cedet/ede/detect-dirtest)
+ (progn
+ (semantic-ia-utest-log "!! Project type using DIRTEST loaded
unexpectedly.")
+ (push "dirtest noload expected" errlog))
+ (semantic-ia-utest-log "** Successfully did not load DIRTEST project."))
+
+ ;; Now make sure that DIRTEST is testing properly.
+ (ede-detect-utest-loop ede-detect-utest-project-dirmatch-list)
+
+ ;; Make sure we did load dirtest - though that should be obvious if prev
+ ;; line worked.
+ (if (not (featurep 'cedet/ede/detect-dirtest))
+ (progn
+ (semantic-ia-utest-log "!! Project type using DIRTEST didn't
load.")
+ (push "dirtest load expected" errlog))
+ (semantic-ia-utest-log "** Successfully loaded DIRTEST project."))
+
+ ;; Close out the test suite.
+ (cedet-utest-log-shutdown
+ "EDE DETECT"
+ (when errlog
+ (format "%s Failures found." (length errlog))))
+ )))
- (let ((errlog nil)
- (project-linux-build-directory-default 'same)
+
+(defun ede-detect-utest-loop (test-entries)
+ "Test the primary EDE project types."
+ (save-excursion
+ (let ((project-linux-build-directory-default 'same)
(project-linux-architecture-default "glnx")
(ede-project-directories t) ; safe to load Project.ede
(basedir nil)
(baselen nil)
)
- (cedet-utest-log-setup "EDE DETECT")
-
(set-buffer (semantic-find-file-noselect
(expand-file-name "cedet/ede/detect.el"
cedet-utest-root)))
(setq basedir default-directory
baselen (length basedir))
- (dolist (fl ede-detect-utest-project-list)
+ (dolist (fl test-entries)
;; Make sure we have the files we think we have.
(when (not (file-exists-p (car fl)))
@@ -97,7 +143,11 @@ Each entry is a cons cell:
;; Run the EDE detection code. Firing up the mode isn't really
needed.
(condition-case err
- (ede-initialize-state-current-buffer)
+ (progn
+ (ede-initialize-state-current-buffer)
+ (when (not (eq b (current-buffer)))
+ (error "Buffer changed during init!"))
+ )
(error
(semantic-ia-utest-log "\n!! In %s: load threw error %S\n"
(substring default-directory baselen)
@@ -148,11 +198,6 @@ Each entry is a cons cell:
(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))))
))
@@ -173,6 +218,44 @@ Each entry is a cons cell:
(not (eq project (ede-current-project)))
))
+;;; TEST PROJECT
+;;
+;; This project exists to test dirmatch.
+
+(defvar ede-detect-utest-dirmatch-fname
+ (expand-file-name (concat (make-temp-name "utest-dirmatch-") ".txt")
+ temporary-file-directory)
+ "A config file to use with DIRTEST.")
+
+(defun ede-detect-utest-init-dirmatch ()
+ "Init the config file for for dirtesting."
+ (let ((mypath (expand-file-name "dirmatch" (ede-detect-utest-basedir))))
+ ;;(message "Dirmatch Location: %s" mypath)
+ (save-excursion
+ (set-buffer (semantic-find-file-noselect
ede-detect-utest-dirmatch-fname))
+ (erase-buffer)
+ (insert "path=" mypath "\n")
+ (save-buffer 0)
+ )))
+
+(ede-add-project-autoload
+ (ede-project-autoload "dirmatchtest"
+ :name "DIRMATCH TEST"
+ :file 'cedet/ede/detect-dirtest
+ :proj-root-dirmatch
+ (ede-project-autoload-dirmatch
+ "dirmatch test"
+ :fromconfig ede-detect-utest-dirmatch-fname
+ :configregex "^path=\\([^\n]+\\)$"
+ :configregexidx 1)
+ :proj-file nil
+ :load-type 'ede-dirmatch-load
+ :class-sym 'ede-test-dirmatch-project
+ :safe-p t)
+ )
+
+;; (message "AUTOLOADS: %S" ede-project-class-files)
+
(provide 'cedet/ede/detect-utest)
;;; detect.el ends here
- [Emacs-diffs] scratch/merge-cedet-tests 6d9366a 135/316: Make 'this' a pointer., (continued)
- [Emacs-diffs] scratch/merge-cedet-tests 6d9366a 135/316: Make 'this' a pointer., Edward John Steere, 2017/01/27
- [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/27
- [Emacs-diffs] scratch/merge-cedet-tests a7926fd 155/316: detect-utest.el: (ede-detect-utest-configdir): New fcn (ede-detect-utest-arduino-install): New faux install dir (ede-detect-utest-init-dirmatch): Point at fake intalldir to get fake board., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 8900419 148/316: Added arduino project detection, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 9c2d002 145/316: Added cpproot and java root to detection tests, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 39048f9 153/316: (ede-detect-utest): Re-run tests with inode optimization disabled., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 14c75f7 175/316: (cit-version): New variable. (semantic): New require, Edward John Steere, 2017/01/27
- [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/27
- [Emacs-diffs] scratch/merge-cedet-tests 4972b30 176/316: (ede, ede-make): New require (cit-srecode-verify-tags): Fix debugging output on failure. Patch from David Engster (cit-compile-and-wait): Use ede-make-command, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 47c4081 165/316: sample lib srces for dirmatch tests., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 86ed340 147/316: Additions to detection testing,
Edward John Steere <=
- [Emacs-diffs] scratch/merge-cedet-tests 0781aac 164/316: Add comments, require cedet-files., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 7661178 186/316: Improve compilation error checking, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 47b5933 185/316: Move compilation error handling to new function, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 0a0dd27 167/316: Test typedef which has the keyword "class" included, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 529fe15 195/316: Make unit tests use randomized file names, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 9c59d78 146/316: (ede-detect-utest): Change message formatting., Edward John Steere, 2017/01/27
- [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/27
- [Emacs-diffs] scratch/merge-cedet-tests e805e93 223/316: semantic/bovine/c: Parse C++11 strongly typed enum, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests a78c71f 255/316: Fix documentation, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests e4db2c3 187/316: Disable auto add, do shared-library-only test, Edward John Steere, 2017/01/27