<commit_before>import unittest, subprocess


class iozoneDiagnosticTest(unittest.TestCase):
	def runTest( self ):
		args = "iozone -a -+d"
		p = subprocess.Popen( args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT )
		retcode = p.wait()
		if retcode != 0:
			print "Unexpected return code from iozone:", retcode
			print "Output:"
			print p.stdout.read()
			self.fail()


class iozoneThroughputTest(unittest.TestCase):
	def runTest( self ):
		args = "iozone -t 1 -r 128k -s 20m"
		p = subprocess.Popen( args, shell=True )#, stdout=subprocess.PIPE, stderr=subprocess.STDOUT )
		retcode = p.wait()
		if retcode == 0:
			pass # TODO: parse output 
		else:
			print "Unexpected return code from iozone:", retcode
			print "Output:"
			print p.stdout.read()
			self.fail()
			
			
suite = unittest.TestSuite()
#suite.addTest( iozoneDiagnosticTest() )
suite.addTest( iozoneThroughputTest() )
        

if __name__ == "__main__":
    unittest.TextTestRunner( verbosity=2 ).run( suite )
    <commit_msg>test/11_iozone: output stdout, stderr if __name__ == "__main__"<commit_after>import unittest, subprocess, sys


class iozoneDiagnosticTest(unittest.TestCase):
	def runTest( self ):
		args = "iozone -a -+d"
                if __name__ == "__main__":
                    stdout = sys.stdout
                    stderr = sys.stderr
                else:
                    stdout = subprocess.PIPE
                    stderr = subprocess.STDOUT
		p = subprocess.Popen( args, shell=True, stdout=stdout, stderr=stderr )
		retcode = p.wait()
		if retcode != 0:
			print "Unexpected return code from iozone:", retcode
			print "Output:"
			print p.stdout.read()
			self.fail()


class iozoneThroughputTest(unittest.TestCase):
	def runTest( self ):
		args = "iozone -t 1 -r 128k -s 20m"
                if __name__ == "__main__":
                    stdout = sys.stdout
                    stderr = sys.stderr
                else:
                    stdout = subprocess.PIPE
                    stderr = subprocess.STDOUT
		p = subprocess.Popen( args, shell=True )#, stdout=stdout, stderr=stderr )
		retcode = p.wait()
		if retcode == 0:
			pass # TODO: parse output 
		else:
			print "Unexpected return code from iozone:", retcode
			print "Output:"
			print p.stdout.read()
			self.fail()
			
			
suite = unittest.TestSuite()
suite.addTest( iozoneDiagnosticTest() )
suite.addTest( iozoneThroughputTest() )
        

if __name__ == "__main__":
    unittest.TextTestRunner( verbosity=2 ).run( suite )
    
{'fraction_non_alphanumeric': 0.1142515923566879, 'fraction_numerical': 0.007961783439490446, 'mean_word_length': 2.610632183908046, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2121413', 'n_tokens_mistral': 920, 'n_tokens_neox': 805, 'n_words': 209}