[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/merge-cedet-tests 42516a8 254/316: Added cpproot t
From: |
Edward John Steere |
Subject: |
[Emacs-diffs] scratch/merge-cedet-tests 42516a8 254/316: Added cpproot tests |
Date: |
Fri, 27 Jan 2017 20:03:44 +0000 (UTC) |
branch: scratch/merge-cedet-tests
commit 42516a8f66bbfb50b8d59e1d0f49a12cc9d0c0bc
Author: Eric Ludlam <address@hidden>
Commit: Edward John Steere <address@hidden>
Added cpproot tests
* test/manual/cedet/cit-cpproot.el: (cit-integ-cpproot-sys-subdir):
New. (cit-integ-cpproot-sys-srcdir):
New. (cit-src-cpproot-main-tags): Added 3 new
tags. (cit-cpproot-depfiles): New. (cit-ede-cpproot-test): Make copy
work in emacs 23&24. Add new include dirs Add more spp files. Check
all includes that they are found in the expected directories.
---
test/manual/cedet/cit-cpproot.el | 57 ++++++++++++++++++++++++++++++++++++--
1 file changed, 54 insertions(+), 3 deletions(-)
diff --git a/test/manual/cedet/cit-cpproot.el b/test/manual/cedet/cit-cpproot.el
index 074dfbd..9939f12 100644
--- a/test/manual/cedet/cit-cpproot.el
+++ b/test/manual/cedet/cit-cpproot.el
@@ -1,6 +1,6 @@
;;; cit-cpproot.el --- Test ede/cpp-root project features
;;
-;; Copyright (C) 2012 Eric M. Ludlam
+;; Copyright (C) 2012, 2013 Eric M. Ludlam
;;
;; Author: Eric M. Ludlam <address@hidden>
;;
@@ -40,15 +40,29 @@
(defvar cit-integ-cpproot-subdir "integ_src/cpproot/"
"Directory of files to copy into the tmp project dir.")
+(defvar cit-integ-cpproot-sys-subdir "integ_src/fauxsyslib/"
+ "Directory of files to copy into the tmp project dir.")
+
(defvar cit-integ-cpproot-srcdir
(expand-file-name
cit-integ-cpproot-subdir
(file-name-directory (locate-library "cit-cpproot")))
"The source directory dor the CPP root sources.")
+(defvar cit-integ-cpproot-sys-subdir "integ_src/fauxsyslib/"
+ "Directory of files to copy into the tmp project dir.")
+
+(defvar cit-integ-cpproot-sys-srcdir
+ (expand-file-name
+ cit-integ-cpproot-sys-subdir
+ (file-name-directory (locate-library "cit-cpproot")))
+ "The source directory dor the CPP root sources.")
+
(defvar cit-src-cpproot-main-tags
(list
+ (semantic-tag-new-include "cpprootsys.h" t)
(semantic-tag-new-include "sppmacros.h" nil)
+ (semantic-tag-new-include "projincmacros.h" nil)
(semantic-tag-new-include "test.h" nil)
(semantic-tag-new-function
"main" "int"
@@ -60,10 +74,17 @@
(semantic-tag-new-function "feature1" "int" nil)
(semantic-tag-new-function "feature2" "int" nil)
(semantic-tag-new-function "feature3" "int" nil)
+ (semantic-tag-new-function "projmacro_a" "char" nil)
(semantic-tag-new-function "generic_feature" "int" nil)
)
"List of tags we need to be able to to find in main.cpp")
+(defvar cit-cpproot-depfiles
+ (list (expand-file-name "cpprootsys.h" cit-integ-cpproot-sys-srcdir)
+ (expand-file-name "sppmacros.h" cit-integ-target-cpproot)
+ (expand-file-name "projinc/projincmacros.h" cit-integ-target-cpproot)
+ (expand-file-name "test.h" cit-integ-target-cpproot))
+ "List of expected path names to include files found in main.cpp")
(defun cit-ede-cpproot-test ()
"Test EDE cpproot based Project."
@@ -72,23 +93,53 @@
(cit-make-dir cit-integ-target-cpproot)
;; Copy source files into the cpproot directory
- (copy-directory cit-integ-cpproot-srcdir cit-integ-target-cpproot t t)
+ (condition-case nil
+ ;; Emacs 24.2
+ (copy-directory (file-name-as-directory cit-integ-cpproot-srcdir)
cit-integ-target-cpproot t t t)
+
+ ;; Emacs 23
+ (error
+ (copy-directory (file-name-as-directory cit-integ-cpproot-srcdir)
cit-integ-target-cpproot t t)))
;; Create the ede-cpp-root-project class directly.
(ede-cpp-root-project
"TESTCPPROOT"
:file (expand-file-name "main.cpp" cit-integ-target-cpproot)
+ :system-include-path (list cit-integ-cpproot-sys-srcdir)
+ :include-path '( "/projinc" )
:spp-table '( ("FEATURE3" . "1")
("RANDOM" . "random") )
- :spp-files '( "sppmacros.h" ))
+ ;; Note: projincmacros is in the include path and will be found there.
+ :spp-files '( "sppmacros.h" "projincmacros.h"))
;; Load up main
(find-file (cit-file-cpproot "main.cpp"))
+ ;; Did the parse work at all???
+ (when (not (semantic-fetch-tags))
+ (semantic-c-describe-environment)
+ (error "main.cpp failed to parse."))
+
;; Validate found tags based on project provided macros.
(cit-srecode-verify-tags (semantic-fetch-tags)
cit-src-cpproot-main-tags)
+ ;; Test out the include paths by checking the discovered file names for the
includes.
+ (let ((itag (semantic-find-tags-included (current-buffer)))
+ (expected cit-cpproot-depfiles))
+ (while (and itag expected)
+
+ (when (not (string= (car expected)
+ (semantic-dependency-tag-file (car itag))))
+ (error "Tag: %s found at %s, expected %s"
+ (semantic-format-tag-name (car itag))
+ (semantic-dependency-tag-file (car itag))
+ (car expected)))
+
+ (setq itag (cdr itag)
+ expected (cdr expected)))
+ (when (or itag expected)
+ (error "Number of found include tags does not match number of expected
tags.")))
)
- [Emacs-diffs] scratch/merge-cedet-tests e267436 232/316: Move tests in cedet/semantic, (continued)
- [Emacs-diffs] scratch/merge-cedet-tests e267436 232/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 32b1d6c 260/316: First pass of creating a distribution., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests cdfb2f7 252/316: Tests for completiong symbols in wisent grammars., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 82a840d 244/316: Use ldflags and libs for in project libraries, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 28e2c81 239/316: (cit-remove-and-do-shared-lib): New., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 66c8eb7 256/316: Remove useless generated skeleton and old NEWS, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests cb8b935 245/316: (cit-remove-and-do-shared-lib): Add ldlibs-local test., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 34041d4 120/316: Synchronize cedet/semantic with Emacs., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 60a3f4b 299/316: (semantic-ia-utest-file-list): add testwisent.wy, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests d8c1209 234/316: CPP integration support. Core bits copied originally from cedet-integ-test.el, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 42516a8 254/316: Added cpproot tests,
Edward John Steere <=
- [Emacs-diffs] scratch/merge-cedet-tests c2f09c4 182/316: (cedet-integ-test-proj): Add cit-remove-and-do-shared-lib., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 6945c33 126/316: Expand preprocessor to handle macros which open or close scope., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 558de0d 220/316: Fake emacs.c for project detection purposes., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 9e6abad 241/316: Run the code for the compiled binary, Edward John Steere, 2017/01/27
- [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/27
- [Emacs-diffs] scratch/merge-cedet-tests e0d3d7b 303/316: New tests., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 9b72617 282/316: Don't set :filename if it's already set, Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests bff505d 132/316: Synchronize cedet/semantic with Emacs., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests 5b8af47 283/316: * tests/cit-externaldb.el: Fix requires., Edward John Steere, 2017/01/27
- [Emacs-diffs] scratch/merge-cedet-tests af4eb43 149/316: Additions to generic project testing, Edward John Steere, 2017/01/27