girving/xdress — pull request #2 by scopatz (2014-02-06 23:19:25+00:00)
Title: Fix enum template args2

This fixes the enum template arg problems for gccxml. However, this revealed an issue where the var were being (intentionally) ignored by clang. I am seeing the error below in the integration tests.

I tried to fix this in the right way by extending the type system to handle variables in template arg, including the namespace that the variable live in. There may still be the limitation that the variable live in the same python target as the templated class. I couldn't think of a nice and simple fix for this, though maybe there is one.

In any event, I'll be off grid Friday and Saturday - and back on Sunday. I *really* hope that this helps.

```bash
scopatz@ares ~/xdress/tests fix-enum-template-args2 $ nosetests
/usr/lib/python2.7/dist-packages/nose/plugins/manager.py:395: RuntimeWarning: Unable to load plugin KnownFailure = matplotlib.testing.noseclasses:KnownFailure: (pyparsing 2.0.1 (/usr/lib/python2.7/dist-packages), Requirement.parse('pyparsing>=1.5.6,<2.0.0'))
RuntimeWarning)
............................................................................F............................................................................................................................................................................................................................................................................................................................................
======================================================================
FAIL: test_cppproj.test_all('PYTHONPATH="/home/scopatz/xdress" /usr/bin/python /home/scopatz/xdress/scripts/xdress --debug -p=clang --builddir="/home/scopatz/xdress/tests/cppproj/build-clang"', '/home/scopatz/xdress/tests/cppproj', [1])
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/scopatz/xdress/tests/tools.py", line 53, in check_cmd
assert_equal(rtn, 0)
AssertionError: 1 != 0
-------------------- >> begin captured stdout << ---------------------
TESTING: running command in /home/scopatz/xdress/tests/cppproj:

PYTHONPATH="/home/scopatz/xdress" /usr/bin/python /home/scopatz/xdress/scripts/xdress --debug -p=clang --builddir="/home/scopatz/xdress/tests/cppproj/build-clang"

STDOUT + STDERR:

autoall: discovering API names
autoall: searching src/discovery.h
autoall: found variables: DigitalLove
autoall: found functions: face2face
autoall: found classes: Crescendoll
autoall: searching src/discovery.cpp
autoall: found variables: DigitalLove
autoall: found functions: face2face, face2face
autoall: found classes: Crescendoll
autodescribe: registering VoidFPStruct
autodescribe: registering A
autodescribe: registering B
autodescribe: registering C
autodescribe: registering ('TClass1', 'int32', 0)
autodescribe: registering ('TClass1', 'float64', 0)
autodescribe: registering ('TClass1', 'float32', 0)
autodescribe: registering ('TClass0', 'int32', 0)
autodescribe: registering ('TClass0', 'float64', 0)
autodescribe: registering ('TClass0', 'bool', 0)
autodescribe: registering Untemplated
autodescribe: registering ThreeNums
autodescribe: registering Crescendoll
autodescribe: registering Crescendoll
autodescribe: registering ('TClass0', 'float32', 0)
autodescribe: registering ('TClass2', 'float32', 0)
autodescribe: registering NoDefault
autodescribe: registering NoDefaultChild
autodescribe: registering ('EnumArg', 'JOAN', 0)
dtypes: registering numpy dtypes
stlwrap: registering C++ standard library types
autodescribe: scraping C/C++ APIs from source
autodescribe: describing VoidFPStruct
autodescribe: describing A
autodescribe: describing B
autodescribe: describing C
autodescribe: describing ('TClass1', 'int32', 0)
autodescribe: describing ('TClass1', 'float64', 0)
autodescribe: describing ('TClass1', 'float32', 0)
autodescribe: describing ('TClass0', 'int32', 0)
autodescribe: describing ('TClass0', 'float64', 0)
autodescribe: describing ('TClass0', 'bool', 0)
autodescribe: describing Untemplated
autodescribe: describing ThreeNums
autodescribe: describing Crescendoll
autodescribe: describing Crescendoll
autodescribe: describing ('TClass0', 'float32', 0)
autodescribe: describing ('TClass2', 'float32', 0)
autodescribe: describing NoDefault
autodescribe: describing NoDefaultChild
autodescribe: describing ('EnumArg', 'JOAN', 0)
Traceback (most recent call last):
File "/home/scopatz/xdress/scripts/xdress", line 6, in
main()
File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.4_dev-py2.7-linux-x86_64.egg/xdress/main.py", line 222, in main
plugins.execute()
File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.4_dev-py2.7-linux-x86_64.egg/xdress/plugins.py", line 373, in execute
self.exit(e)
File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.4_dev-py2.7-linux-x86_64.egg/xdress/plugins.py", line 371, in execute
plugin.execute(rc)
File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.4_dev-py2.7-linux-x86_64.egg/xdress/autodescribe.py", line 2260, in execute
self.compute_classes(rc)
File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.4_dev-py2.7-linux-x86_64.egg/xdress/autodescribe.py", line 2427, in compute_classes
desc = self.compute_desc(cls, 'class', rc)
File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.4_dev-py2.7-linux-x86_64.egg/xdress/autodescribe.py", line 2347, in compute_desc
clang_includes=rc.clang_includes)
File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.4_dev-py2.7-linux-x86_64.egg/xdress/autodescribe.py", line 2206, in describe
language=language, clang_includes=clang_includes)
File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.4_dev-py2.7-linux-x86_64.egg/xdress/autodescribe.py", line 1161, in clang_describe
cls = clang_find_class(tu, name, ts=ts, filename=filename, onlyin=onlyin)
File "/home/scopatz/.local/lib/python2.7/site-packages/xdress-0.4_dev-py2.7-linux-x86_64.egg/xdress/autodescribe.py", line 1281, in clang_find_class
raise ValueError("class '{0}' found, but specialization {1} not found{2}".format(basename, name, where))
ValueError: class 'EnumArg' found, but specialization ('EnumArg', 'JOAN', 0) not found in file /home/scopatz/xdress/tests/cppproj/build-clang/src_basics.cpp-src_basics.h-src_basics.hpp.cpp

--------------------- >> end captured stdout << ----------------------

----------------------------------------------------------------------
Ran 409 tests in 48.841s

FAILED (failures=1)
```