[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: |
Sat, 28 Jan 2017 09:10:07 +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 9480090 261/316: Test updating the project version, (continued)
- [Emacs-diffs] scratch/merge-cedet-tests 9480090 261/316: Test updating the project version, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests e78d9b8 201/316: Fix merge error in unit tests., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 8989dc6 313/316: New Tests for ede-java-root-project type., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests c89acc2 305/316: Add test code for use with sources in globalref, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 9b72617 282/316: Don't set :filename if it's already set, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 2448a55 268/316: Fix unit testing for several tests and do better error checking., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 6adc6be 266/316: Move tests in cedet/semantic, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 3cb2319 243/316: Added code for test tags, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 101da66 306/316: Don't scan other files because Util.cc is already in a buffer, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 3cc63e2 316/316: Remove tests and redundant resources not destined for merge, Edward John Steere, 2017/01/28
- [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 82586cd 209/316: eieio: Move to obsolete and use the one that ships with Emacs, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests e54714f 227/316: Add header comments and provide., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 4730d02 197/316: Refactor tests, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 82a840d 244/316: Use ldflags and libs for in project libraries, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests cb8b935 245/316: (cit-remove-and-do-shared-lib): Add ldlibs-local test., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests ecb61db 211/316: New test files combining macros and EDE, Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 853dd10 259/316: New test C file for linux., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 558de0d 220/316: Fake emacs.c for project detection purposes., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests 31d40a7 257/316: Fix EIEIO methodinvoke-utest and semantic-fmt-utest., Edward John Steere, 2017/01/28
- [Emacs-diffs] scratch/merge-cedet-tests cdfb2f7 252/316: Tests for completiong symbols in wisent grammars., Edward John Steere, 2017/01/28