[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/merge-cedet-tests a4cba68 020/316: New test for pr
From: |
Edward John Steere |
Subject: |
[Emacs-diffs] scratch/merge-cedet-tests a4cba68 020/316: New test for project variables. |
Date: |
Sat, 28 Jan 2017 09:09:42 +0000 (UTC) |
branch: scratch/merge-cedet-tests
commit a4cba6891b7d8a0528071b0eadda59292ee4c9d1
Author: Eric Ludlam <address@hidden>
Commit: Edward John Steere <address@hidden>
New test for project variables.
---
test/manual/cedet/cit-projvar.el | 97 ++++++++++++++++++++++++++++++++++++++
1 file changed, 97 insertions(+)
diff --git a/test/manual/cedet/cit-projvar.el b/test/manual/cedet/cit-projvar.el
new file mode 100644
index 0000000..519289c
--- /dev/null
+++ b/test/manual/cedet/cit-projvar.el
@@ -0,0 +1,97 @@
+;;; cit-projvar.el --- Test project local variables
+;;
+;; Copyright (C) 2012 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 2, 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; see the file COPYING. If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+;;
+;; Test `ede-set' and that it will correctly set variables in project buffers,
but not other
+;; buffers.
+
+(defvar cit-test-moose nil)
+(defvar cit-test-list nil)
+
+;;; Code:
+(defun cit-proj-variables ()
+ "Test project local variables."
+ ;; Pre-load a file from the project
+ (find-file (cit-file "include/foo.hpp"))
+
+ ;; Make some misc file we created and added to a project local.
+ (find-file (cit-file "src/main.cpp"))
+
+ ;; Add some "unique" variables to the EDE project
+ (ede-set 'cit-test-moose "MOOSE")
+ (ede-set 'cit-test-list '(1 2 3))
+
+ ;; Make sure the variables get immediately set to this buffer.
+ (cit-projvar-desired-vars-test)
+
+ ;; Make sure they are set in an open, but not current buffer.
+ (set-buffer "foo.hpp")
+ (cit-projvar-desired-vars-test)
+
+ ;; Make sure they are set when we open a file.
+ (kill-buffer (current-buffer))
+ (find-file (cit-file "include/foo.hpp"))
+ (cit-projvar-desired-vars-test)
+
+ ;; Make sure they are NOT set is some file not belonging to our project
+ (find-file (cit-file "../NOT_A_FILE"))
+ (cit-projvar-desired-vars-test t)
+
+ ;; Lets flip back to main.cpp - lets set a variable even MORE local
+ (find-file (cit-file "src/main.cpp"))
+ (ede-set 'cit-test-moose "moose" (ede-current-project))
+
+ (when (not (and (stringp cit-test-moose)
+ (string= cit-test-moose "moose")))
+ (error "ede-set failed to create a subproject string variable."))
+
+ ;; I hope it didn't set things over here in foo.hpp
+ (find-file (cit-file "include/foo.hpp"))
+ (when (not (and (stringp cit-test-moose)
+ (string= cit-test-moose "MOOSE")))
+ (error "ede-set failed to restrict a subproject string variable to the
subproject."))
+
+ )
+
+(defun cit-projvar-desired-vars-test (&optional notset)
+ "Test that the created variables are all property set.
+If optional NOTSET, then make sure that they DONT have the desired values."
+
+ (if notset
+
+ (when (or cit-test-moose cit-test-list)
+ (error "ede-set set variables where they don't belong."))
+
+ ;; Test positively
+ (when (not (and (stringp cit-test-moose)
+ (string= cit-test-moose "MOOSE")))
+ (error "ede-set failed to create a string variable."))
+
+ (when (not (and (listp cit-test-list)
+ (equal cit-test-list '(1 2 3))))
+ (error "ede-set failed to create a list variable."))
+
+ ))
+
+(provide 'cit-projvar)
+
+;;; cit-projvar.el ends here
- [Emacs-diffs] scratch/merge-cedet-tests 439ca10 007/316: Remove obsolete cvs-auto-updated 'X-RCS' line., (continued)
- [Emacs-diffs] scratch/merge-cedet-tests 439ca10 007/316: Remove obsolete cvs-auto-updated 'X-RCS' line., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 1a9f3c4 009/316: Disable `ede-project-directories' checking during tests., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 39b4ea6 019/316: Test Makefile.am for subdir in project-am detector., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 812f259 012/316: Add header comments and provide., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests d9b806d 016/316: New template file testing the PROJECT variable setting., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests a2c77d6 022/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests d15788e 025/316: (Lisp_LISP): Add cit-cpp, cit-el, cit-texi, cit-load, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 23862f3 023/316: Test friends, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 066e017 024/316: New Makefile., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests ecfcde6 028/316: (all, dist): Add scripts (scripts): New, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests a4cba68 020/316: New test for project variables.,
Edward John Steere <=
- [Emacs-diffs] scratch/merge-cedet-tests 8899bf4 017/316: Add header comments and provide., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests b13b432 031/316: (LOADPATH): Add contrib. (Misc): New (dist): Add Misc, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests cdcc2c4 037/316: (Lisp_LISP): Add cit-dist.el, Edward John Steere, 2017/01/28
- [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/28
- [Emacs-diffs] scratch/merge-cedet-tests 1d79c16 042/316: Remove obsolete cvs-auto-updated 'X-RCS' line., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 467bfc2 036/316: (ELISPPRELOAD): New (Lisp): Use preloads., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests ada5514 040/316: Fix paths to current code location., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 4131d23 046/316: Fix typo in last commit., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 534648f 051/316: Remove obsolete cvs-auto-updated 'X-RCS' line., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 6813c44 014/316: New test files combining macros and EDE, Edward John Steere, 2017/01/28