-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
120 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,4 @@ | |
# TODO: | ||
# 1. Add "explicit" property for constructors | ||
|
||
__version__ = '1.7.5' | ||
__version__ = '1.7.6' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,14 +7,14 @@ | |
from setuptools import setup | ||
|
||
setup(name="pygccxml", | ||
version="1.7.5", | ||
version="1.7.6", | ||
author="Roman Yakovenko", | ||
author_email="roman yakovenko at gmail com", | ||
maintainer="Michka Popoff and the Insight Software Consortium", | ||
maintainer_email="[email protected]", | ||
description="Python package for easy C++ declarations navigation.", | ||
url="https://github.com/gccxml/pygccxml", | ||
download_url="https://github.com/gccxml/pygccxml/archive/v1.7.5.tar.gz", | ||
download_url="https://github.com/gccxml/pygccxml/archive/v1.7.6.tar.gz", | ||
license="Boost", | ||
keywords="C++, declaration parser, CastXML, gccxml", | ||
packages=["pygccxml", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright 2014-2016 Insight Software Consortium. | ||
// Copyright 2004-2009 Roman Yakovenko. | ||
// Distributed under the Boost Software License, Version 1.0. | ||
// See http://www.boost.org/LICENSE_1_0.txt | ||
|
||
// Demonstrate some code where a struct without name is passed to a | ||
// templated function. See bug #55 | ||
|
||
template <typename type> | ||
void | ||
function(type &var) {}; | ||
|
||
int main() | ||
{ | ||
// Create foo, a struct with no name | ||
struct { } foo; | ||
function(foo); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Copyright 2014-2016 Insight Software Consortium. | ||
# Copyright 2004-2009 Roman Yakovenko. | ||
# Distributed under the Boost Software License, Version 1.0. | ||
# See http://www.boost.org/LICENSE_1_0.txt | ||
|
||
import unittest | ||
import parser_test_case | ||
|
||
from pygccxml import parser | ||
from pygccxml import declarations | ||
|
||
|
||
class tester_t(parser_test_case.parser_test_case_t): | ||
|
||
def __init__(self, *args): | ||
parser_test_case.parser_test_case_t.__init__(self, *args) | ||
self.header = "test_argument_without_name.hpp" | ||
self.config.cflags = "-std=c++11" | ||
|
||
def test_argument_without_name(self): | ||
|
||
""" | ||
Test passing an object without name to a templated function. | ||
The test was failing when building the declaration string. | ||
The declaration string will be 'void (*)( & )'. If the passed | ||
object had a name the result would then be 'void (*)(Name & )'. | ||
See bug #55 | ||
""" | ||
|
||
if self.config.xml_generator == "gccxml": | ||
return | ||
|
||
decls = parser.parse([self.header], self.config) | ||
global_ns = declarations.get_global_namespace(decls) | ||
|
||
criteria = declarations.calldef_matcher(name="function") | ||
free_funcs = declarations.matcher.find(criteria, global_ns) | ||
for free_func in free_funcs: | ||
decl_string = free_func.create_decl_string(with_defaults=False) | ||
self.assertEqual(decl_string, "void (*)( & )") | ||
|
||
|
||
def create_suite(): | ||
suite = unittest.TestSuite() | ||
suite.addTest(unittest.makeSuite(tester_t)) | ||
return suite | ||
|
||
|
||
def run_suite(): | ||
unittest.TextTestRunner(verbosity=2).run(create_suite()) | ||
|
||
if __name__ == "__main__": | ||
run_suite() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters