David Engster [Mon, 18 Nov 2013 22:11:17 +0000 (23:11 +0100)]
C++: Deal with 'using' statements when calculating scope
* semantic/bovine/c.el (semantic-ctxt-scoped-types): Go through all
tags around point and search them for using statements. Before, we
skipped the last one thinking that it would have to be function, but
it could also be a type.
* semantic/scope.el (semantic-completable-tags-from-type): When
creating the list of completable types, pull in types which are
referenced through 'using' statements.
* tests/cedet/semantic/test/manual/cedet/testusing.cpp:
* tests/cedet/semantic/test/manual/cedet/testusing.hh: Add tests for
the above.
David Engster [Wed, 18 Sep 2013 19:44:03 +0000 (21:44 +0200)]
C/C++: Parse 'using' statements in the correct order.
(c++-mode:semantic-ctxt-scoped-types): In the case for using
statements outside of function scope, append them in the correct order
instead of using 'cons'. This is important since using statements may
depend on previous ones.
* tests/cedet/semantic/test/manual/cedet/testusing.cpp: Add test for
the above.
David Engster [Sun, 15 Sep 2013 09:19:30 +0000 (11:19 +0200)]
Another 'using namespace' fix
(semantic-analyze-scoped-types-default): If we cannot find a type in
the typecache, also look into the the types we already found. This is
necessary since in C++, a 'using namespace' can be dependend on a
previous one.
David Engster [Thu, 25 Oct 2012 18:38:27 +0000 (20:38 +0200)]
Simplify alias referencing and add tests.
* lisp/cedet/semantic/analyze.el (semantic-analyze-dereference-alias):
Only dereference first tag, since at least for C++ this is enough.
(semantic-analyze-current-context-default): Adapt comment.
* tests/cedet/semantic/test/manual/cedet/testusing.cpp: Add tests for
the above.
* Makefile (top-level): Remove eieio compilation and add compilation of
fallback eieio for Emacs 24.1 and 24.2. Throw error for Emacs 23.x.
* cedet-devel-load.el: Always require eieio at the top. Load
cedet-compat earlier. Remove advices for eieio helpers.
* cedet-remove-builtin.el: eieio must not be removed anymore.
* semantic/ede-grammar.el (semantic-ede-proj-target-grammar): Remove
cedet-compat from aux-packages initform, as it will be loaded by
cedet-devel-load anyway.
(ede-proj-makefile-insert-variables): Remove eieio from load-path.
* lisp/cedet/cedet-compat.el: Load fallback eieio for Emacs 24.1 and
24.2. Add new aliases for Emacs 24.3.
* Project.ede, Makefiles: Remove eieio and regenerate.
David Engster [Thu, 1 Dec 2011 19:13:55 +0000 (20:13 +0100)]
Fix unit testing for several tests and do better error checking.
* semantic/lex-spp-utests.el (semantic-lex-spp-write-utest):
* tests/cedet-utests.el (cedet-utest-eieio-classloader): Throw
error if we cannot locate test files.
* semantic/utest-c.el (semantic-utest-c-compare)
(semantic-utest-c-conditionals):
* semantic/lex-spp-utest.el (semantic-lex-spp-write-utest): Adapt
to new directory structure and do better error checking to avoid
silent failures in the future.
Eric Ludlam [Sat, 20 Aug 2011 17:03:04 +0000 (13:03 -0400)]
Refactor tests
* test/manual/cedet/cedet-utests.el: (cedet-uutil): New require, plus
all other unit test files. (cedet-utest-test-alist): eieio now has
loader test fcn (below) Re-order srecode
tests. (cedet-running-master-tests): Move to cedet-uutil.
(cedet-utest): Fix symbol names for initializing the test suite.
(cedet-utest-noninteractive): Move to
cedet-uutil. (cedet-utest-batch): Init semantic the new
way. (cedet-utest-frame, cedet-utest-last-log-item,
cedet-utest-log-timer) (cedet-utest-log-setup,
cedet-utest-elapsed-time) (cedet-utest-log-shutdown,
cedet=utest-log-shutdown-msg) (cedet-utest-show-log-end,
cedet-utest-post-command-hook) (cedet-utest-add-log-item-start,
cedet-utest-add-log-item-done) (cedet-utest-log-start,
cedet-utest-log): Moved to cedet-util.el
(cedet-utest-eieio-classloader): New loader for the EIEIO tests.
David Engster [Mon, 4 Nov 2013 22:15:03 +0000 (23:15 +0100)]
Make unit tests use randomized file names
* tests/cedet/semantic/stltest.el:
* tests/cedet/semantic/utest-parse.el:
* tests/cedet/srecode/fields-utest.el:
* tests/cedet/srecode/test-getset.el:
* tests/cedet/srecode/test.el:
* tests/eieio/eieio-test-persist.el: Make all those tests use
`make-temp-name' for their test files, so that tests can run in
parallel.
Eric Ludlam [Wed, 3 Aug 2011 01:41:26 +0000 (21:41 -0400)]
(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.
David Engster [Tue, 19 Oct 2010 15:01:44 +0000 (17:01 +0200)]
Ignore Members On Extra Tags
* Test/Manual/Cedet/Cedet-Integ-Test.El (Cit-Srecode-Verify-Tags):
Ignore Members Attribute For Extra Tags. Necessary Because Of The
Latest Changes To Semantic-Tag-Similar-P.
* test/manual/cedet/cedet-integ-test.el (cit-symref): New require.
(cedet-integ-test-proj): Disable auto add. Only do shared library
test with automake. (cit-run-target): Don't kill the buffer, wait
and show program output instead.
zappo [Tue, 16 Mar 2010 03:04:42 +0000 (03:04 +0000)]
Improve compilation error checking
* test/manual/cedet/cedet-integ-test.el (cit-compile-and-wait): Pull
out error checking. Add support for stripping erroneous
events. (cit-check-compilation-for-error): New, from above.
zappo [Sat, 26 Dec 2009 22:42:40 +0000 (22:42 +0000)]
Move compilation error handling to new function
* test/manual/cedet/cedet-integ-test.el (cit-dist): New require.
(cedet-integ-test-proj): Call new cit-dist tests.
(cit-compile-and-wait): Split part out to...
(cit-wait-for-compilation): New.
zappo [Thu, 15 Oct 2009 02:54:27 +0000 (02:54 +0000)]
Added lib dir and make-type argument
* test/manual/cedet/cedet-integ-test.el (cedet-integ-test-proj): Add a
lib dir. Add make-type arg to cit-remove-and-do-shared-lib call.
(cit-compile-and-wait): Accept an optional argument.
zappo [Sat, 8 Aug 2009 21:50:34 +0000 (21:50 +0000)]
(cedet-integ-test-Make,cedet-integ-test-Automake,cedet-integ-test-GNUStep): New (cedet-integ-test-proj): Take a make-type argumemt. Misc tests needed on new argument. Change how ede creates projects based on make-type. Remove spaces from the project name. (cit-finish-message): Ending message now includes the make type.
zappo [Sat, 30 May 2009 14:18:35 +0000 (14:18 +0000)]
Added cit uml
* test/manual/cedet/cedet-integ-test.el (cit-uml): New require
(cogre): New require (cedet-integ-test): Make a UML test dir. Call
`cit-fill-uml'. (cit-compile-and-wait): Kill Project.ede buffer
after compilation.
zappo [Thu, 12 Mar 2009 02:26:52 +0000 (02:26 +0000)]
Added new subdir and ensure that the base dir
is made first
* test/manual/cedet/cedet-integ-test.el (cedet-integ-base): New, using
old target value. (cedet-integ-target): Subdir under base
(cedet-integ-test): Make the base dir first.
(cit-srecode-verify-tags): Fix paren typos on error condition.
zappo [Thu, 12 Mar 2009 02:03:45 +0000 (02:03 +0000)]
(ede, ede-make): New require (cit-srecode-verify-tags): Fix debugging output on failure. Patch from David Engster (cit-compile-and-wait): Use ede-make-command
safanaj [Thu, 28 Aug 2008 23:17:26 +0000 (23:17 +0000)]
Added gnustep tests
* test/manual/cedet/cedet-integ-test.el Added stuff to test
ede-gnustep via `cit-ede-step-test' defined in cit-gnustep.el.
Something is not clear (ede-auto-add-method ???)
zappo [Sun, 24 Feb 2008 03:03:33 +0000 (03:03 +0000)]
Restructure and improve output
* test/manual/cedet/cedet-integ-test.el (cit-cpp,-el,-texi): Added
requires. (cedet-integ-test): Add in new calls to test support
files. (cit-header-tags, cit-src-tags, cit-main-tags,
cit-srecode-fill): Moved to cit-cpp.el (cit-srecode-fill-with-stuff):
Add empty-dict-entries argument. Add pauses for visual
effect. (cit-srecode-verify-tags): Fix to work, and actually throw an
error if things don't match up. (cit-tag-verify-error-debug): New
support class. (cit-compile-and-wait): New fcn. Error if compilation
fails.
Eric Ludlam [Mon, 24 Nov 2014 17:38:04 +0000 (12:38 -0500)]
Test typedef which has the keyword "class" included
* test/manual/cedet/cedet/semantic/tests/testtypedefs.cpp:
(NS2::Myclass, MyClassHandle, dixon): New test w/ a typedef that has
keyword "class" included, instead of omitted as with other tests.
David Engster [Fri, 20 Sep 2013 19:54:31 +0000 (21:54 +0200)]
Fix parsing of default values and display them in default formatter
* semantic/bovine/c.by (variablearg, varnamelist): Add default values
so that it can be later expanded into the tag.
(opt-stuff-after-symbol): Rename to 'brackets-after-symbol' and
remove empty match.
(multi-stage-dereference): Adapt to above rename.
(unaryexpression): Use 'symbol' instead of 'namespace-symbol', since
the latter also leads to an empty match at the end which would make
this too greedy.
* semantic/format.el (semantic-format-tag-prototype-default):
Display default values if available.
Parsing of default values for variables and function arguments was
broken with the refactoring done in rev. 7622. While fixing this, it
turned out that our parser for expressions like
char *foo = NULL;
was too greedy and also covered the semicolon because of empty matches
in rules 'opt-stuff-after-symbol' and 'opt-template-specifier',
leading to a variable with a default-value of "NULL;". This was fixed
by removing the empty match in 'opt-stuff-after-symbol' and using
'symbol' instead of 'namespace-symbol'.
Eric Ludlam [Sun, 24 Aug 2014 14:02:42 +0000 (10:02 -0400)]
detect-utest.el: (ede-detect-utest-configdir): New fcn (ede-detect-utest-arduino-install): New faux install dir (ede-detect-utest-init-dirmatch): Point at fake intalldir to get fake board.
Eric Ludlam [Sun, 22 Jun 2014 00:36:58 +0000 (20:36 -0400)]
Fixes for test execution
* test/manual/cedet/cedet/ede/detect-utest.el: (ede-detect-entry):
Remove `found-state' slot as it was unused. (ede-detect-show-state):
When an error in init, show it. (ede-detect-utest-project-entries):
Add a linux driver test added where this dir would detect as generic
makefile, but it is in Linux. (ede-detect-utest-loop): Add better
failed load message.
Eric Ludlam [Wed, 4 Jun 2014 01:59:30 +0000 (21:59 -0400)]
Major test restructure
* test/manual/cedet/cedet/ede/detect-utest.el:
(ede-ditect-utest-project-list): Deleted. Replaced
with... (ede-detect-utest-project-entries): New list of entries to
test. (ede-detect-utest-project-dirmatch-list): Deleted. Replaced
with ... (ede-detect-utest-project-dirmatch-entries): New list of
entries to test dirmatch with. (ede-detect-entry): New class for
storing test points. (ede-detect-entry::ede-detect-do-test)
(ede-detect-show-state, ede-detect-entry::ede-detect-state)
(ede-detect-entry::ede-detect-show-progress): New. ("UTESTCPP",
"UTESTJAVA"): Add :name to these projects. (ede-detect-utest):
Replace feature unloaded/loaded with calls to
`ede-detect-utest-validate-loadstate'. Change variables passed to
utest-loop. (ede-detect-utest-loop): Replace old refs into cons cells
with refs into the class. Replace all bit warnings by pushing text
into the test entry objects. Add double-initialze test. Add call to
project rescan. At end, dump out the state captured during testing.
(ede-detect-utest-rescan):
New. (ede-detect-utest-validate-loadstate): New, content copied from
`ede-detect-utest'. (dirmatchtest autoload): Add root-only as nil.
Eric Ludlam [Sun, 1 Jun 2014 02:02:48 +0000 (22:02 -0400)]
(ede-detect-utest-project-list): Add test for generic VC type project. (ede-detect-utest): Add fake autoloader for VC. (ede-detect-utest-generic-vc-p): New.
Eric Ludlam [Sat, 24 May 2014 01:58:31 +0000 (21:58 -0400)]
Added arduino project detection
* test/manual/cedet/cedet/ede/detect-utest.el:
(ede-detect-utest-project-dirmatch-list): Add arduino. Add subdir
tests for dirmatch and arudino. (ede-detect-utest): Also test for
arduino lib not loading/loading. (ede-detect-utest-arduino-fname):
New. (ede-detect-utest-init-dirmatch): Reconfigure for reading
arduino data out of temp created config files.
Eric Ludlam [Fri, 23 May 2014 10:24:02 +0000 (06:24 -0400)]
Additions to detection testing
* test/manual/cedet/cedet/ede/detect-utest.el:
(ede-detect-utest-project-list): Doc fix
(ede-detect-utest-project-dirmatch-list): New (ede-detect-utest):
Split out body. Pull up start/end logging. Add testing for dirmatch
not loaded/loaded. Add testing for the dirmatch project.
(ede-detect-utest-loop): Previous content of above.
Eric Ludlam [Sun, 18 May 2014 22:58:05 +0000 (18:58 -0400)]
Added cpproot and java root to detection tests
* test/manual/cedet/cedet/ede/detect-utest.el:
(ede-detect-utest-project-list): Add cpproot and javaroot. Add sub
dirs under project and automake types. (ede-detect-utest-basedir):
New function (UTESTCPP, UTESTJAVA): New. (ede-detect-utest): Improve
debug output for failed tests. (ede-detect-utest-subproj-p,
ede-detect-utest-subautomake-p): New.
Eric Ludlam [Thu, 2 Jan 2014 01:44:55 +0000 (20:44 -0500)]
Test files contributed by Barry OReilly
* test/manual/cedet/integ_src/globalref/inc/Util.hh: These test files
contributed by Barry OReilly, modified for use in the automated tests
for CEDET, and with additional comments. inc/Util.hh, src/Util.cc:
Search symbol both in and outside of namespaces.
Eric Ludlam [Thu, 2 Jan 2014 01:44:55 +0000 (20:44 -0500)]
Tests contributed by Barry OReilly
* test/manual/cedet/integ_src/globalref/src/Util.cc: These test files
contributed by Barry OReilly, modified for use in the automated tests
for CEDET, and with additional comments. inc/Util.hh, src/Util.cc:
Search symbol both in and outside of namespaces.
David Engster [Sun, 27 Oct 2013 21:13:46 +0000 (22:13 +0100)]
Expand preprocessor to handle macros which open or close scope.
* semantic/lex-spp.el (semantic-c-end-of-macro): Declare.
(semantic-lex-spp-token-macro-to-macro-stream): Deal with macros which
open/close a scope. For this, leave an overlay if we encounter a
single open paren and return a semantic-list in the lexer. When this
list gets expanded, retrieve the old position from the overlay. See
the comments in the function for further details.
(semantic-lex-spp-find-closing-macro): New function to find the next
macro which closes scope (i.e., has a closing paren).
(semantic-lex-spp-replace-or-symbol-or-keyword): Go to end of closing
macro if necessary.
(semantic-lex-spp-paren-or-list): New lexer to specially deal with
parens in macro definitions.
* bovine/c.el (semantic-cpp-lexer): Use new
`semantic-lex-spp-paren-or-list'.
* tests/cedet/semantic/test/manual/cedet/testsppreplace.c:
* tests/cedet/semantic/test/manual/cedet/testsppreplaced.c: Add tests for the
above.
David Engster [Sat, 19 Oct 2013 11:35:06 +0000 (13:35 +0200)]
C/C++: Fix function pointer parsing
* semantic/bovine/c.by (variablearg-opt-name): Support parsing of
function pointers inside an argument list.
* semantic/bovine/c.el (semantic-c-reconstitute-token): Change
handling of function pointers; instead of seeing them as variables,
handle them as functions with a 'function-pointer' attribute. Also,
correctly deal with function pointers as function arguments.
(semantic-c-reconstitute-function-arglist): New function to parse
function pointers inside an argument list.
(semantic-format-tag-name): Use 'function-pointer' attribute instead
of the old 'functionpointer-flag'.
* tests/cedet/semantic/test/manual/cedet/testsppreplace.c:
* tests/cedet/semantic/test/manual/cedet/testsppreplaced.c: Disable
test which now breaks due to improved function pointer parsing.
This test is broken anyway, since it just succeeded because the
argument list was not parsed at all before this commit. The
underlying bug was always present in the semantic preprocessor.
David Engster [Mon, 4 Nov 2013 22:24:55 +0000 (23:24 +0100)]
Improve test utilities re complation and deletion
* tests/cedet-integ-test.el (cit-check-compilation-for-error): Use
correct format-string.
* cedet/semantic/stltest.el: Only delete test file if it exists (which
it shouldn't do, but still...).
David Engster [Mon, 4 Nov 2013 22:15:03 +0000 (23:15 +0100)]
Make unit tests use randomized file names
* tests/cedet/semantic/stltest.el:
* tests/cedet/semantic/utest-parse.el:
* tests/cedet/srecode/fields-utest.el:
* tests/cedet/srecode/test-getset.el:
* tests/cedet/srecode/test.el:
* tests/eieio/eieio-test-persist.el: Make all those tests use
`make-temp-name' for their test files, so that tests can run in
parallel.