# Path: run_tests.py
# def run_tests_list(tests_list,tokenizer):
# 	for idx,test in enumerate(tests_list) :
# 		s,validate = test
# 		print("test={0}".format(test))
# 
# 		file_lines = s.split("\n")
# 		lines = [ line+"\n" for line in file_lines ]
# 		# if empty line at end, kill it (supposed to be cleaned out of vline
# 		# before sent to parser)
# 		if lines[-1]=='\n':
# 			lines = lines[:-1]
# 		print( "split={0}".format(s.split("\n")))
# 		print( "lines={0} len={1}".format(lines,len(lines)),end="")
# 
# 		vline = VirtualLine(lines,idx)
# 		my_iter = iter(vline) 
# 
# 		print("vline={0}".format(str(vline)))
# 		tokens = tokenizer(my_iter)
# 		print( "  tokens={0}".format(str(tokens)) )
# 		print( "validate={0}".format(str(validate)) )
# 
# 		assert tokens==validate, (idx,)
# 
# 		print( tokens.makefile() )
# 		print("\n")


import sys
from pymake import *
from run_tests import run_tests_list
#!/usr/bin/env python3

# Regression tests for pymake.py
#
# Test Makefile assignment
#
# davep 22-Sep-2014


# require Python 3.x 
if sys.version_info.major < 3:
	raise Exception("Requires Python 3.x")


def run():

	assignment_tests = ( 
		("foo=baz",AssignmentExpression( [Expression( [Literal("foo")]),AssignOp("="),Expression( [Literal("baz")])]) ),

# Path: run_tests.py
# def run_tests_list(tests_list,tokenizer):
# 	for idx,test in enumerate(tests_list) :
# 		s,validate = test
# 		print("test={0}".format(test))
# 
# 		file_lines = s.split("\n")
# 		lines = [ line+"\n" for line in file_lines ]
# 		# if empty line at end, kill it (supposed to be cleaned out of vline
# 		# before sent to parser)
# 		if lines[-1]=='\n':
# 			lines = lines[:-1]
# 		print( "split={0}".format(s.split("\n")))
# 		print( "lines={0} len={1}".format(lines,len(lines)),end="")
# 
# 		vline = VirtualLine(lines,idx)
# 		my_iter = iter(vline) 
# 
# 		print("vline={0}".format(str(vline)))
# 		tokens = tokenizer(my_iter)
# 		print( "  tokens={0}".format(str(tokens)) )
# 		print( "validate={0}".format(str(validate)) )
# 
# 		assert tokens==validate, (idx,)
# 
# 		print( tokens.makefile() )
# 		print("\n")


# Path: test_assign.py
import sys
from pymake import *
from run_tests import run_tests_list

#!/usr/bin/env python3

# Regression tests for pymake.py
#
# Test Makefile assignment
#
# davep 22-Sep-2014


# require Python 3.x 
if sys.version_info.major < 3:
	raise Exception("Requires Python 3.x")


def run():

	assignment_tests = ( 
		("foo=baz",AssignmentExpression( [Expression( [Literal("foo")]),AssignOp("="),Expression( [Literal("baz")])]) ),

		("foo=$(baz)",AssignmentExpression( [Expression( [Literal("foo")]),AssignOp("="),Expression( [Literal(""),VarRef( [Literal("baz")]),Literal("")])]) ),