###########################################################################
# TEST: Startup
###########################################################################
# $Revision: 1.15 $
# $Author: cbueche $
# $Date: 2001/07/25 13:47:42 $
# $Source: 
# $NoKeywords: $
###########################################################################

#**#
#*	Dieses Script sollte in den Settings eingestellt werden und beim 
#*	Starten von Winrunner automatisch geladen werden.
#*/

#**
#*	Trims given characters from the end of the given <code>str</code>ing.
#*	Use this function to ensure that getvar("curr_dir") allways returns the
#*	same value. Sometimes it returns the path ended with backslash. In other
#*	occasions (e.g. re-run the same test) it returns the same path without the
#*	backslash.
#*	@param str (in)	string to be right-trimmed
#*	@param zap (in)	(optional) string to be trimmed [default: \]
#*	@return the trimmed string
#*/

static function strip_trail ( in str, in zap )
{
	static const DEFZAP = "\\";
	auto slen, zlen;
	if ( zap == "" ) 
		zap = DEFZAP;
	slen = length( str );
	zlen = length( zap );
	if ( slen && substr( str, (slen-zlen+1) ) == zap )
		str = strip_trail( substr( str, 1, slen-zlen ) );
	return str;
}

#------------------
# Public-Konstanten
#------------------

public const MROOT = getenv ("M_ROOT");
public const TEST_HOME = strip_trail( getvar( "curr_dir" ), "\\" );
public const DATA_HOME = TEST_HOME & "\\..\\Data";
public const GUI_HOME  = TEST_HOME & "\\GUI";

#------------------
# Suchpfad
#------------------

setvar("searchpath", sprintf( ". .. <%s> <%s>" 
      , TEST_HOME
      , MROOT & "\\lib" ) );

# Timeout festlegen
setvar("timeout", 10 );

#------------------
# Bibliotheken
#------------------

call emosinit();
reload ("LIB/AUT_Lib", 0, 1);
reload (MROOT & "/LIB/win32api", 0, 1);

#------------------
# Logging konfigurieren
#------------------

# Debug-Meldungen ein- bzw. ausschalten
set_debug( TRUE );
#wrlog_start();
#invoke_application( "wrlog.exe", "-c", MROOT & "\\lib\\emos_gpl\\std\\emos_std_wrlog_lib", SW_SHOW );
#wrlog_init_file_interface(getvar("testname"), getenv("USERNAME"), "txt");
#------------------
# GUI-Map(s)
#------------------

GUI_close_all();
load_GUI( GUI_HOME & "\\" & "EMOS_HOME_NS.GUI" );
#------------------
# Browser starten
#------------------
call "Browser_start"();
#------------------
# GUI Konfiguration
#------------------

#------------------
# Exceptions
#------------------

#------------------
# Bitmap-Tool for customized bitmap-checking delivered by Mercury
#------------------

