[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/merge-cedet-tests d8c1209 234/316: CPP integration
From: |
Edward John Steere |
Subject: |
[Emacs-diffs] scratch/merge-cedet-tests d8c1209 234/316: CPP integration support. Core bits copied originally from cedet-integ-test.el |
Date: |
Fri, 27 Jan 2017 20:03:43 +0000 (UTC) |
branch: scratch/merge-cedet-tests
commit d8c12096f982f0a9e76aa846e91ea51d4815edd9
Author: zappo <address@hidden>
Commit: Edward John Steere <address@hidden>
CPP integration support. Core bits copied originally from
cedet-integ-test.el
---
test/manual/cedet/cit-cpp.el | 161 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 161 insertions(+)
diff --git a/test/manual/cedet/cit-cpp.el b/test/manual/cedet/cit-cpp.el
new file mode 100644
index 0000000..4420b73
--- /dev/null
+++ b/test/manual/cedet/cit-cpp.el
@@ -0,0 +1,161 @@
+;;; cit-cpp.el --- C++ specific things for our integ test.
+
+;; Copyright (C) 2008 Eric M. Ludlam
+
+;; Author: Eric M. Ludlam <address@hidden>
+;; X-RCS: $Id: cit-cpp.el,v 1.1 2008-02-24 02:57:20 zappo Exp $
+
+;; 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:
+;;
+;; C++ specific code for the cedet integration tests.
+
+;;; Code:
+
+(defvar cit-header-cpp-tags
+ (list
+ (semantic-tag-new-type
+ "foo" "class"
+ (list
+ (semantic-tag "public" 'label)
+ (semantic-tag-new-function
+ "foo" '("foo" type (:type "class"))
+ (list (semantic-tag-new-variable "f" "int"))
+ :constructor-flag t)
+ (semantic-tag-new-function
+ "foo" "void" nil :destructor-flag t )
+ (semantic-tag-new-function
+ "doSomethingPublic" "void"
+ (list (semantic-tag-new-variable "ctxt" "int")
+ (semantic-tag-new-variable "thing" "char"
+ nil
+ :pointer 1))
+ :prototype-flag t)
+ (semantic-tag-new-function
+ "setField1" "void"
+ (list (semantic-tag-new-variable "f" "int"))
+ :prototype-flag t)
+ (semantic-tag-new-function
+ "getField1" "int" nil
+ :prototype-flag t)
+ (semantic-tag "protected" 'label)
+ (semantic-tag-new-function
+ "doSomethingProtected" "void"
+ (list (semantic-tag-new-variable "ctxt" "int")
+ (semantic-tag-new-variable "thing" "char"
+ nil
+ :pointer 1))
+ :prototype-flag t)
+ (semantic-tag "private" 'label)
+ (semantic-tag-new-variable
+ "Field1" "int")
+ )
+ nil)
+ )
+ "Tags to be inserted into a header file.")
+
+(defvar cit-src-cpp-tags
+ (list
+ (semantic-tag-new-include "foo.hh" nil)
+ (semantic-tag-new-function
+ "doSomethingPublic" "void"
+ (list (semantic-tag-new-variable "ctxt" "int")
+ (semantic-tag-new-variable "thing" "char"
+ nil
+ :pointer 1))
+ :parent "foo")
+ (semantic-tag-new-function
+ "setField1" "void"
+ (list (semantic-tag-new-variable "f" "int"))
+ :parent "foo")
+ (semantic-tag-new-function
+ "getField1" "int" nil
+ :parent "foo")
+ (semantic-tag-new-function
+ "doSomethingProtected" "void"
+ (list (semantic-tag-new-variable "ctxt" "int")
+ (semantic-tag-new-variable "thing" "char"
+ nil
+ :pointer 1))
+ :parent "foo")
+ )
+ "Tags to be inserted into a source file.")
+
+(defvar cit-main-cpp-tags
+ (list
+ (semantic-tag-new-include "foo.hh" nil)
+ (semantic-tag-new-function
+ "main" "int"
+ (list (semantic-tag-new-variable "argc" "int")
+ (semantic-tag-new-variable "argv" "char"
+ nil
+ :pointer 2 )))
+ )
+ "Tags to be inserted into main.")
+
+
+(defun cit-srecode-fill-cpp ()
+ "Fill up a base set of files with some base tags."
+
+ ;; 2 b) Test various templates.
+
+ (cit-srecode-fill-with-stuff "include/foo.hh" cit-header-cpp-tags)
+ (ede-new "Make" "Includes")
+ ;; 1 e) Tell EDE where the srcs are
+ (ede-new-target "Includes" "miscelaneous" "n")
+ (ede-add-file "Includes")
+
+ (cit-srecode-fill-with-stuff "src/foo.cpp" cit-src-cpp-tags)
+ (ede-new "Make" "Src")
+ ;; 1 e) Tell EDE where the srcs are
+ (ede-new-target "Prog" "program" "n")
+ (ede-add-file "Prog")
+
+ (cit-srecode-fill-with-stuff "src/main.cpp" cit-main-cpp-tags)
+ ;; 1 e) Tell EDE where the srcs are
+ (ede-add-file "Prog")
+
+ (let ((p (ede-current-project)))
+ (oset p :variables '( ( "CPPFLAGS" . "-I../include") ))
+ (ede-commit-project p)
+ )
+
+ (cit-compile-and-wait)
+ )
+
+(defun cit-remove-add-to-project-cpp ()
+ "Remve foo.cpp from the current project. Add in a new generated file."
+
+ (find-file (cit-file "src/foo.cpp"))
+ ;; Whack the file
+ (ede-remove-file t)
+ (kill-buffer (current-buffer))
+ (delete-file (cit-file "src/foo.cpp"))
+
+ ;; Make a new one
+ (cit-srecode-fill-with-stuff "src/bar.cpp" cit-src-cpp-tags)
+ (ede-add-file "Prog")
+
+ ;; 1 g) build the sources.
+ (compile "make")
+
+ (cit-compile-and-wait)
+ )
+
+
+(provide 'cit-cpp)
+;;; cit-cpp.el ends here
- [Emacs-diffs] scratch/merge-cedet-tests a40bc3f 191/316: (Cit-Android): New Require. (Cedet-Integ-Test-Gnustep): Fix Typo. (Cedet-Integ-Test-Android): New Build Type Support For Android. (Cit-Make-Dir): Allow Making Trees Of Directories. (Cit-Compile-And-Wait): Only Regenerate The Project If That Project Type Can Be Regenerated. (Cit-Compile-And-Wait-Using-Ede-Command): New Way To Build That Uses Ede Commands Instead Of Hard-Coded Make Commands., (continued)
- [Emacs-diffs] scratch/merge-cedet-tests a40bc3f 191/316: (Cit-Android): New Require. (Cedet-Integ-Test-Gnustep): Fix Typo. (Cedet-Integ-Test-Android): New Build Type Support For Android. (Cit-Make-Dir): Allow Making Trees Of Directories. (Cit-Compile-And-Wait): Only Regenerate The Project If That Project Type Can Be Regenerated. (Cit-Compile-And-Wait-Using-Ede-Command): New Way To Build That Uses Ede Commands Instead Of Hard-Coded Make Commands., Edward John Steere, 2017/01/27
- [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 <=
- [Emacs-diffs] scratch/merge-cedet-tests 42516a8 254/316: Added cpproot tests, Edward John Steere, 2017/01/27
- [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