Commit 32c7430b authored by Sergio Costas's avatar Sergio Costas

Adding first test

parent d7294d6c
...@@ -457,7 +457,6 @@ class crusty(object): ...@@ -457,7 +457,6 @@ class crusty(object):
def process_functions(self, tree, var_container, function_container): def process_functions(self, tree, var_container, function_container):
self._add_error(self.MSG_WARNING,"Prueba warning")
for node in tree: for node in tree:
if node.type == "FUNCTION_DEFINITION": if node.type == "FUNCTION_DEFINITION":
tmpvars = self._copy_container(var_container) tmpvars = self._copy_container(var_container)
......
#define NULL ((void *)0)
typedef __crust_t__ unsigned char *crust_test;
__crust_t__ int * llamada(__crust_t__ int *param2, __crust_recycle__ int *param1, crust_test param3);
void main() {
}
#!/usr/bin/env python3
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.getcwd(), os.pardir)))
import unittest
from crusty import crusty
class Test1(unittest.TestCase):
def test1(self):
lib = crusty.crusty("../lexyacclib/crusty.h","../lexyacclib/crusty.so")
tree = lib.read_file("test1.c",False)
self.assertIsNot(tree,None)
variables,functions = lib.process_tree(tree)
lib.process_functions(tree,variables,functions)
self.assertEqual(len(lib.errors),0)
if __name__ == '__main__':
unittest.main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment