#!/usr/bin/python import os import sys import coff_file OUTPUT = '/tmp/test_coff.o' def test_file(fname): print 'TESTING WITH:', fname result = coff_file.read_file(fname) coff_file.write_file(OUTPUT, *result) original = open(fname, 'rb').read() rewrite = open(OUTPUT, 'rb').read() if original != rewrite: print 'ERROR: mismatch!!' else: print '... SUCCESS.' if __name__ == '__main__': for fname in sys.argv[1:]: test_file(fname)