def main(): if not is_in_rootdir(): testlog.error('Error: Please run me from the root dir of pyelftools!') return 1 success = True for example_path in discover_examples(): if success: success = success and run_example_and_compare(example_path) if success: testlog.info('\nConclusion: SUCCESS') return 0 else: testlog.info('\nConclusion: FAIL') return 1
def main(): if not is_in_rootdir(): testlog.error('Error: Please run me from the root dir of pyelftools!') return 1 optparser = OptionParser( usage='usage: %prog [options] [file] [file] ...', prog='run_readelf_tests.py') optparser.add_option('-V', '--verbose', action='store_true', dest='verbose', help='Verbose output') options, args = optparser.parse_args() if options.verbose: testlog.info('Running in verbose mode') testlog.info('Given list of files: %s' % args) # If file names are given as command-line arguments, only these files # are taken as inputs. Otherwise, autodiscovery is performed. # if len(args) > 0: filenames = args else: filenames = list(discover_testfiles('test/testfiles')) success = True for filename in filenames: if success: success = success and run_test_on_file( filename, verbose=options.verbose) if success: testlog.info('\nConclusion: SUCCESS') return 0 else: testlog.info('\nConclusion: FAIL') return 1
def main(): if not is_in_rootdir(): testlog.error('Error: Please run me from the root dir of pyelftools!') return 1 optparser = OptionParser(usage='usage: %prog [options] [file] [file] ...', prog='run_readelf_tests.py') optparser.add_option('-V', '--verbose', action='store_true', dest='verbose', help='Verbose output') options, args = optparser.parse_args() if options.verbose: testlog.info('Running in verbose mode') testlog.info('Given list of files: %s' % args) # If file names are given as command-line arguments, only these files # are taken as inputs. Otherwise, autodiscovery is performed. # if len(args) > 0: filenames = args else: filenames = list(discover_testfiles('test/testfiles')) success = True for filename in filenames: if success: success = success and run_test_on_file(filename, verbose=options.verbose) if success: testlog.info('\nConclusion: SUCCESS') return 0 else: testlog.info('\nConclusion: FAIL') return 1