Skip to content

Commit

Permalink
Agrego salidas por pantalla de cmd y de sensibilidad
Browse files Browse the repository at this point in the history
  • Loading branch information
maurob committed Nov 9, 2013
1 parent 77fd85e commit 8235871
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
24 changes: 8 additions & 16 deletions compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ def link_cmd(path_name, objs=[], extra=''):
"""
return sjoin(CXX, link_extra, extra, '-o', path_name, *objs)

#class Include(object):
# """ Container for the included file name and in which line it was """
# def __init__(self, file=None, line_number=0):
# self.file = file
# self.line_number = line_number
#
# def __repr__(self):
# return '<"{file.full}" included in line {line_number}>'.format(
# **self.__dict__)


def comment_remover(text):
def replacer(match):
Expand Down Expand Up @@ -165,20 +155,22 @@ def compile(source_name):
actual = File(source_name)
includes, sources = dependencies(actual)

print

if len(sources) > 0: # Compile and link
sources.append(actual)
#sources.append(actual)
objs = []
for source in sources:
for source in sources + [actual]:
obj = source.path_name + '.o'
objs.append(obj)
print compile_cmd(obj)
if source != source_name:
pass#compile_obj(source)
print 'Sensibility:', [source] + source.includes + source.sources
print
print link_cmd(source.path_name, objs)

else: # Compile into the executable
print link_cmd(actual.path_name, [actual.full])

print includes
print 'Sensibility:', [actual] + actual.includes + actual.sources
print


5 changes: 0 additions & 5 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ def test_find_file_path(self):
self.assertEqual(find_file(File('a.txt'), 'test').full, 'test/a.txt')
self.assertRaises(IOError, find_file, File('notfound.txt'))

#def test_Include(self):
# from compile import Include, File
# i = Include(File('a.txt'), 4)
# self.assertEqual(str(i), '<"a.txt" included in line 4>')

def test_find_includes(self):
from compile import find_includes, File
actual = File('test/main.cpp')
Expand Down

0 comments on commit 8235871

Please sign in to comment.