[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/merge-cedet-tests 00080fd 043/316: Validate projec
From: |
Edward John Steere |
Subject: |
[Emacs-diffs] scratch/merge-cedet-tests 00080fd 043/316: Validate project overrides |
Date: |
Fri, 27 Jan 2017 20:03:26 +0000 (UTC) |
branch: scratch/merge-cedet-tests
commit 00080fd250f309842f2ece0db6bc8925bcc8b923
Author: Eric Ludlam <address@hidden>
Commit: Edward John Steere <address@hidden>
Validate project overrides
* test/manual/cedet/cit-srec.el: (cit-srecode-map-test): Expand tests
to validate that project settings correctly override system level
templates.
---
test/manual/cedet/cit-srec.el | 50 ++++++++++++++++++++++++++++++++++-------
1 file changed, 42 insertions(+), 8 deletions(-)
diff --git a/test/manual/cedet/cit-srec.el b/test/manual/cedet/cit-srec.el
index 40492d7..71267a8 100644
--- a/test/manual/cedet/cit-srec.el
+++ b/test/manual/cedet/cit-srec.el
@@ -1,6 +1,6 @@
;;; cit-srec.el --- Test SRecode template mapping and such.
-;; Copyright (C) 2008 Eric M. Ludlam
+;; Copyright (C) 2008, 2013 Eric M. Ludlam
;; Author: Eric M. Ludlam <address@hidden>
@@ -30,7 +30,8 @@
(interactive)
(let ((extradir cit-src-dir)
- (oldpath srecode-map-load-path))
+ (oldpath srecode-map-load-path)
+ (tmpbuff (get-buffer-create "proj-test")))
(add-to-list 'srecode-map-load-path extradir)
(srecode-map-update-map t)
@@ -38,12 +39,45 @@
(srecode-load-tables-for-mode 'c++-mode 'cit-test)
(unwind-protect
- (when (not (srecode-template-get-table (srecode-table 'c++-mode)
- "cit-test-template"
- "test"
- 'cit-test
- ))
- (error "Failed to find augmented template"))
+ (let (tmpl1 tmpl2)
+ ;; Test that a new template was detected
+ (when (not (srecode-template-get-table (srecode-table 'c++-mode)
+ "cit-test-template"
+ "test"
+ 'cit-test
+ ))
+ (error "Failed to find augmented template"))
+
+ ;; Test the project distinction template.
+ (save-excursion
+ (set-buffer tmpbuff)
+
+ ;; Ok, this restricts us to testing on unix...
+ (setq default-directory "/usr/local")
+ (setq tmpl1 (srecode-template-get-table (srecode-table 'c++-mode)
+ "cit-project-template"
+ "test"
+ 'cit-test
+ ))
+
+ (setq default-directory "/tmp/test")
+ (setq tmpl2 (srecode-template-get-table (srecode-table 'c++-mode)
+ "cit-project-template"
+ "test"
+ 'cit-test
+ ))
+
+ (when (eq tmpl1 tmpl2)
+ (error "Failed to differentiate between Project and Non-Project
templates"))
+
+ (when (not (string= (nth 1 (oref tmpl1 :code))
+ "THIS IS NOT IN A PROJECT"))
+ (error "Failed to get the correct text for non-project
template."))
+
+ (when (not (string= (nth 1 (oref tmpl2 :code))
+ "THIS FILE IS IN /tmp"))
+ (error "Failed to get the correct text for-project template."))
+ ))
;; Get rid of our adaptation. Double check.
(setq srecode-map-load-path oldpath)
- [Emacs-diffs] scratch/merge-cedet-tests d9b806d 016/316: New template file testing the PROJECT variable setting., (continued)
- [Emacs-diffs] scratch/merge-cedet-tests d9b806d 016/316: New template file testing the PROJECT variable setting., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests a4cba68 020/316: New test for project variables., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 066e017 024/316: New Makefile., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests e4ea343 033/316: Merge from 1.0pre6 branch, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests b13b432 031/316: (LOADPATH): Add contrib. (Misc): New (dist): Add Misc, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 42e1106 034/316: (Lisp_LISP): Add cit-uml.el (Misc_MISC): Add cit-uml.cgr, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 115a9d4 038/316: (Lisp_LISP): Add cit-symref.el, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 467bfc2 036/316: (ELISPPRELOAD): New (Lisp): Use preloads., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 924fef0 039/316: (Lisp_LISP): Add cit-externaldb.el, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 1d79c16 042/316: Remove obsolete cvs-auto-updated 'X-RCS' line., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 00080fd 043/316: Validate project overrides,
Edward John Steere <=
- [Emacs-diffs] scratch/merge-cedet-tests 9a436ca 047/316: (func): Add local8 with a ternary conditional., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 1c4ec31 045/316: Add test for parsing local variables, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 9bda61f 050/316: (cit-symref-quick-find-test): New. (cit-symref-count): Add a small wait of .1., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 75c52c3 055/316: (ms_structs, fun): New test example from Marting Stein., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests f38d3d0 041/316: SRecoder feature testing., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests e915cb9 035/316: (LOADPATH): Add cogre to the load path., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests d8b5630 060/316: Patch from Marcus Harnisch, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests d4d1014 061/316: Add -f toggle-debug-on-quit flag, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests c9de94f 064/316: * cit-test.sh: Add support for running in batch mode., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests d8f7f9c 066/316: * tests/cit-test.sh: Fix filename for integration test., Edward John Steere, 2017/01/27