diff --git a/sample.cc b/sample.cc deleted file mode 100644 index 1273d87..0000000 --- a/sample.cc +++ /dev/null @@ -1,19 +0,0 @@ -int z = 0; - -struct __attribute__((annotate("A"))) A { - int a; - double b; - char c[8]; - - __attribute__((annotate("foo"))) int foo(int); -}; - -template -class B { - T t; - T wibble(T); -}; - -double bar(double); - -int main() {} diff --git a/test_py_cppmodel.py b/test_py_cppmodel.py index 2f3066e..92ee415 100644 --- a/test_py_cppmodel.py +++ b/test_py_cppmodel.py @@ -12,12 +12,35 @@ "-I/Library/Developer/CommandLineTools/usr/include", ] +SOURCE = """\ +int z = 0; + +struct __attribute__((annotate("A"))) A { + int a; + double b; + char c[8]; + + __attribute__((annotate("foo"))) int foo(int); +}; + +template +class B { + T t; + T wibble(T); +}; + +double bar(double); + +int main() {} +""" + class TestCppModel(unittest.TestCase): def setUp(self): tu = TranslationUnit.from_source( "sample.cc", COMPILER_ARGS, + unsaved_files=[("sample.cc", SOURCE)], ) self.model = py_cppmodel.Model(tu)