Ejemplo n.º 1
0
	bool TestLexer::doTest( )
	{

		StringVector files = _getFileNames();
		
		report( "Scanning the following files:\n " 
			<< hydrazine::toString( files.begin(), files.end(), "\n " )  );
		
		for( StringVector::iterator fi = files.begin(); 
			fi != files.end(); ++fi )
		{
		
			ptxFile = *fi;
		
			if(  !_testScan( ) )
			{
		
				status << "For file " << ptxFile 
					<< ", Test Point 1 (Scan): Failed\n";
				return false;
		
			}
		
			status << "For file " << ptxFile 
				<< ", Test Point 1 (Scan): Passed\n";
			
		}
			
		return true;
	
	}
Ejemplo n.º 2
0
	bool TestPTXToLLVMTranslator::doTest()
	{
		StringVector files = _getFileNames();
		
		hydrazine::Timer timer;
		timer.start();
	
		unsigned int count = 0;
	
		report( "Translating the following files:\n " 
			<< hydrazine::toString( files.begin(), files.end(), "\n " )  );
		
		for( unsigned int i = 0, e = files.size(); i != e; ++i )
		{	
			if( timer.seconds() > timeLimit ) break;

			unsigned int index = random() % files.size();
	
			ptxFile = files[ index ];
		
			if(  !_testTranslate( ) )
			{
				status << "For file " << ptxFile 
					<< ", Test Point 1 (Translate): Failed\n";
				return false;
			}
		
			status << "For file " << ptxFile 
				<< ", Test Point 1 (Translate): Passed\n";
				
			++count;
		}
	
		status << "Finished running " << count << " tests...\n";
			
		return true;	
	}
	bool TestDataflowGraph::doTest()
	{
		_getFileNames();
		//return _testGeneric() && _testSsa() && _testReverseSsa();
		return _testIdentities();
	}