Skip to content

Instantly share code, notes, and snippets.

View ibizaman's full-sized avatar

Pierre Penninckx ibizaman

View GitHub Profile
g++ -c test/DBTableTest.cpp -o build/test/objects/test/DBTableTest.o -I. -std=c++11 -DTEST -O0 -g -Wall -Werror -Wmissing-include-dirs -Wextra -Wcast-qual -Wwrite-strings -Wconversion -pedantic -Winit-self -Wunused -Wfloat-equal -Wcast-align
In file included from ./database/DBTable.h:35:0,
from test/DBTableTest.cpp:3:
./database/DBTable.cpp:20:9: error: template instantiation depth exceeds maximum of 900 (use -ftemplate-depth= to increase the maximum) substituting 'template<int I> void DBTable::populateFromDB(std::shared_ptr<sql::ResultSet>) [with int I = I; Columns = {int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool}] [with int I = 899]'
./database/DBTable.cpp:20:9: recursively required from 'void DBTable<Columns>::populateFromDB(std::shared_ptr<sql::ResultSet>) [with int I = 1; Columns = {int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool}]'
./database/DBTable.cpp:20:9: required from 'void DBTable<Columns>::populateFromDB(
Undefined symbols:
"bool& ResultSetHelper::get<bool&>(std::shared_ptr<sql::ResultSet>, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
std::enable_if<(2)!=(3ul), void>::type DBTable<int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool>::populateFromDB<2>(std::shared_ptr<sql::ResultSet>) in DBTableTest.o
"int& ResultSetHelper::get<int&>(std::shared_ptr<sql::ResultSet>, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
std::enable_if<(0)!=(3ul), void>::type DBTable<int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool>::populateFromDB<0>(std::shared_ptr<sql::ResultSet>) in DBTableTest.o
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >& ResultSetHelper::get<std::basic_string<char, std::char_traits<char>, std::allocator<char> >&>(std::shared_ptr<sql::ResultSet>, std::basic_string<char, std::char_traits<char>, std::alloca
>>> import baron
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/users/ppx/python/baron-master/baron3/baron.py", line 10, in <module>
from grammator import generate_parse
File "/users/ppx/python/baron-master/baron3/grammator.py", line 2, in <module>
from parser import BaronParserGenerator
File "/users/ppx/python/baron-master/baron3/parser.py", line 4, in <module>
import tempfile
File "/celestite/projects/cso-cpcc/Python/lib/python3.3/tempfile.py", line 30, in <module>
import baron
def test_file(path):
with open(path, 'r') as f:
content = f.read()
valid = content == baron.dumps(baron.parse(content))
print(path,' is valid? ',valid)
def main():
test_file('baron-master/baron2/parser.py')
======================================== test session starts =========================================
platform linux -- Python 3.3.0 -- py-1.4.20 -- pytest-2.5.2
collected 792 items
tests/test_base.py .
tests/test_dumper.py .............................................................................................................................
tests/test_formatting_grouper.py ...............................................................................................................................................................................
tests/test_grammator.py ..................................
tests/test_grammator_control_structures.py ....................
tests/test_grammator_data_structures.py ...................................
$ python3 test-readprofile.py
Tue Apr 8 17:35:52 2014 test-profile
140495070 function calls (140454591 primitive calls) in 1561.324 seconds
Ordered by: internal time
List reduced from 442 to 10 due to restriction <10>
ncalls tottime percall cumtime percall filename:lineno(function)
2679 1312.656 0.490 1547.644 0.578 /users/ppx/python/baron-master/baron/utils.py:61(grab_string)
>>> r = RedBaron("c = 2 = 1")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/users/ppx/python/redbaron-master/redbaron.py", line 491, in __init__
self.data = [to_node(x, parent=self, on_attribute="root") for x in baron.parse(source_code)]
File "/users/ppx/python/baron-master/baron/baron.py", line 41, in parse
print_function_finder.visit(python_ast_parse(source_code))
File "/celestite/projects/cso-cpcc/Python/lib/python3.3/ast.py", line 35, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "<unknown>", line 1
diff --git a/tests/test_dumper.py b/tests/test_dumper.py
index f85b9bb..c03462f 100644
--- a/tests/test_dumper.py
+++ b/tests/test_dumper.py
@@ -69,11 +69,11 @@ def test_from_import_special_notation():
def test_print_empty():
- check_dumps("print")
+ check_dumps("print()")
@ibizaman
ibizaman / 0001-make-it-interpretable-by-python3.patch
Created April 9, 2014 14:50
baron and redbaron patches for Python3
From df9fce4f690766dfa60ff072f04b3ea0ad5164fc Mon Sep 17 00:00:00 2001
From: Pierre Penninckx
Date: Mon, 7 Apr 2014 17:57:42 +0200
Subject: [PATCH 1/3] make it interpretable by python3
Nearly untouched output by running 2to3 on all baron's sources.
---
baron/__init__.py | 8 +-
baron/baron.py | 16 +--
baron/dumper.py | 4 +-
tests/test_base.py F
================================================================================================= FAILURES =================================================================================================
_____________________________________________________________________________________________ test_dummy_parse _____________________________________________________________________________________________
def test_dummy_parse():
> parse("pouet")
tests/test_base.py:5:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _