[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: |
Sat, 28 Jan 2017 09:09:55 +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 cd9aeb4 258/316: Move tests in cedet/semantic, (continued)
- [Emacs-diffs] scratch/merge-cedet-tests cd9aeb4 258/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 39f1464 235/316: (cit-srecode-fill-cpp): Fixed misspelling of target name., Edward John Steere, 2017/01/28
- [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/28
- [Emacs-diffs] scratch/merge-cedet-tests 658ff90 205/316: (cedet-utest): Add EDE sanity check to the end., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 02f847a 288/316: New tests., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests ad45c79 263/316: Remove obsolete cvs-auto-updated 'X-RCS' line., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 9e6abad 241/316: Run the code for the compiled binary, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 5a2a1da 293/316: (priority): Set to a low number. (cit-project-template): New template., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 7f7d6bf 229/316: Synchronize cedet/srecode with Emacs., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 66c8eb7 256/316: Remove useless generated skeleton and old NEWS, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 86ed340 147/316: Additions to detection testing,
Edward John Steere <=
- [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/28
- [Emacs-diffs] scratch/merge-cedet-tests 446edba 291/316: Base template for cit testing., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 760fef4 309/316: Fix typo, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 07892f6 287/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests da23314 286/316: Don't fail the test for errors which don't mean a failure, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 764db86 236/316: (cit-remove-add-to-project-cpp): Wait for make to finish., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests b804ecf 166/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 11d45fa 170/316: Restructure and improve output, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests a93bc4a 292/316: Remove obsolete cvs-auto-updated 'X-RCS' line., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests ce2952b 312/316: Revert rev. 6995, Edward John Steere, 2017/01/28