# Path: mozz/test.py
# def run_test_module(name, file):
# 	outputfile = mozz.util.python_path_basename(file) + '.out'
# 
# 	m = sys.modules[name]
# 	ldr = unittest.loader.defaultTestLoader
# 	tests = ldr.loadTestsFromModule(m)
# 
# 	with open(outputfile, 'w') as f:
# 		duper = mozz.util.IOWriteDuplicator(
# 			sys.stderr, f
# 		)
# 		unittest.runner.TextTestRunner(
# 			verbosity = 2,
# 			stream = duper
# 		).run(tests)
# 
# def abs_path(base_file, rel_path):
# 	return os.path.join(
# 		os.path.dirname(os.path.abspath(base_file)),
# 		rel_path
# 	)


import unittest
import mozz
from mozz.test import run_test_module, abs_path
			'goal_fn_execd': 0,
			'won':           0
		}

		@s.on_signal_default()
		def sig_default(host, sig):
			d['got_sig'] = True

		@s.at_addr("try_to_get_here")
		def goal_fn(host):
			d['goal_fn_execd'] += 1

		@s.at_addr(0x40069c)
		def victory(host):
			d['won'] += 1

		fp = 0xc0ffee
		@s.mockup(0x4006f4, 0x4006f9)
		def fake_fp(host):
			d['got_fake_fp'] += 1
			@host.with_inferior()
			def seteax(host):
				host.inferior().reg_set("rax", fp)

		@s.mockup(0x400730, 0x400735, locs=('rdi',) )
		def fake_read(host, rdi):
			host.log("rdi=0x%x" % rdi)
			d['got_fake_read'] += 1
			@host.with_inferior()
			def blah(host):

# Path: mozz/test.py
# def run_test_module(name, file):
# 	outputfile = mozz.util.python_path_basename(file) + '.out'
# 
# 	m = sys.modules[name]
# 	ldr = unittest.loader.defaultTestLoader
# 	tests = ldr.loadTestsFromModule(m)
# 
# 	with open(outputfile, 'w') as f:
# 		duper = mozz.util.IOWriteDuplicator(
# 			sys.stderr, f
# 		)
# 		unittest.runner.TextTestRunner(
# 			verbosity = 2,
# 			stream = duper
# 		).run(tests)
# 
# def abs_path(base_file, rel_path):
# 	return os.path.join(
# 		os.path.dirname(os.path.abspath(base_file)),
# 		rel_path
# 	)


# Path: test/mockup_fakefile_test.py
import unittest
import mozz
from mozz.test import run_test_module, abs_path

			'goal_fn_execd': 0,
			'won':           0
		}

		@s.on_signal_default()
		def sig_default(host, sig):
			d['got_sig'] = True

		@s.at_addr("try_to_get_here")
		def goal_fn(host):
			d['goal_fn_execd'] += 1

		@s.at_addr(0x40069c)
		def victory(host):
			d['won'] += 1

		fp = 0xc0ffee
		@s.mockup(0x4006f4, 0x4006f9)
		def fake_fp(host):
			d['got_fake_fp'] += 1
			@host.with_inferior()
			def seteax(host):
				host.inferior().reg_set("rax", fp)

		@s.mockup(0x400730, 0x400735, locs=('rdi',) )
		def fake_read(host, rdi):
			host.log("rdi=0x%x" % rdi)
			d['got_fake_read'] += 1
			@host.with_inferior()
			def blah(host):

				inf = host.inferior()