Files
itgmania212121/stepmania/src/tests/test_misc.cpp
T

66 lines
1.1 KiB
C++
Raw Normal View History

2004-03-04 07:23:06 +00:00
#include "global.h"
#include "test_misc.h"
#include "RageFileManager.h"
#include "RageLog.h"
#include "RageUtil.h"
2005-03-20 04:11:34 +00:00
#include "arch/arch.h"
2004-06-10 23:16:51 +00:00
#include "arch/ArchHooks/ArchHooks.h"
2004-03-04 07:23:06 +00:00
2006-01-22 01:00:06 +00:00
RString g_Driver = "dir", g_Root = ".";
2004-06-10 23:16:51 +00:00
2006-01-22 01:00:06 +00:00
RString argv0;
2004-03-04 07:23:06 +00:00
void test_handle_args( int argc, char *argv[] )
{
SetCommandlineArguments( argc, argv );
2004-03-04 07:23:06 +00:00
argv0 = argv[0];
while( 1 )
{
opterr = 0;
int opt = getopt( argc, argv, "cd:r:h" );
if( opt == -1 )
break;
switch( opt )
{
case 'd':
g_Driver = optarg;
break;
case 'r':
g_Root = optarg;
break;
case 'h':
printf( "options:\n" );
printf( " -c: create test files\n" );
printf( " -d driver: choose file driver to test (default \"Dir\")\n" );
printf( " -r root: set file driver root (default \".\")\n" );
exit(1);
}
}
}
void test_init()
{
2004-06-10 23:16:51 +00:00
HOOKS = MakeArchHooks();
2004-03-04 07:23:06 +00:00
FILEMAN = new RageFileManager( argv0 );
2005-05-22 07:25:27 +00:00
FILEMAN->Mount( g_Driver, g_Root, "/" );
2004-03-04 07:23:06 +00:00
2005-12-31 01:29:59 +00:00
LOG = new RageLog;
2004-03-04 07:23:06 +00:00
LOG->SetLogToDisk( false );
LOG->SetShowLogOutput( true );
LOG->SetFlushing( true );
}
void test_deinit()
{
delete LOG;
delete FILEMAN;
2004-06-10 23:16:51 +00:00
delete HOOKS;
2004-03-04 07:23:06 +00:00
}