From: cherierm Date: Fri, 13 Apr 2007 09:45:33 +0000 (+0000) Subject: the script of the sg test on Windows X-Git-Tag: v3.3~1948 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ac54f0cb5ffb31d61d28ab6e54788da7aaa0cc98?hp=659b32e7f57a715dfd50b30319e47aba37028273 the script of the sg test on Windows git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3412 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/examples/gras/ping/test_sg.vbs b/examples/gras/ping/test_sg.vbs new file mode 100644 index 0000000000..346fcfd110 --- /dev/null +++ b/examples/gras/ping/test_sg.vbs @@ -0,0 +1,29 @@ +Dim oShell +Dim sInstallDirectory ' The install directory of the simulator Simgrid +Dim sCurrentDirectory ' The current directory of the script +Dim sCommandLine ' The command line of the application to launch +Dim iExitCode ' The exit code of the application to launch + +Set oShell = WScript.CreateObject ("WSCript.shell") +Set oUseEnv = oShell.Environment("USER") + +' Get the install directory of Simgrid from the environment variable SG_INSTALL_DIR +sInstallDirectory = oUseEnv("SG_INSTALL_DIR") +sCurrentDirectory = GetCurrentDirectory() +' Construct the command line of the application to launch +sCommandLine = "cmd /K " & sCurrentDirectory & "bin\ping_simulator " & sInstallDirectory & "\simgrid\examples\msg\small_platform.xml " & sCurrentDirectory & "ping.xml" + +iRetVal = oShell.run(sCommandLine,1,True) + +Set oShell = Nothing +Set oWshShell = Nothing + +' This function returns the directory of the script +Function GetCurrentDirectory() + Dim sScriptFullName + + sScriptFullName = WScript.ScriptFullName + GetCurrentDirectory = mid(sScriptFullName,1,InStrRev(sScriptFullName,"\")) + +End Function + diff --git a/examples/gras/pmm/test_sg.vbs b/examples/gras/pmm/test_sg.vbs new file mode 100644 index 0000000000..346fcfd110 --- /dev/null +++ b/examples/gras/pmm/test_sg.vbs @@ -0,0 +1,29 @@ +Dim oShell +Dim sInstallDirectory ' The install directory of the simulator Simgrid +Dim sCurrentDirectory ' The current directory of the script +Dim sCommandLine ' The command line of the application to launch +Dim iExitCode ' The exit code of the application to launch + +Set oShell = WScript.CreateObject ("WSCript.shell") +Set oUseEnv = oShell.Environment("USER") + +' Get the install directory of Simgrid from the environment variable SG_INSTALL_DIR +sInstallDirectory = oUseEnv("SG_INSTALL_DIR") +sCurrentDirectory = GetCurrentDirectory() +' Construct the command line of the application to launch +sCommandLine = "cmd /K " & sCurrentDirectory & "bin\ping_simulator " & sInstallDirectory & "\simgrid\examples\msg\small_platform.xml " & sCurrentDirectory & "ping.xml" + +iRetVal = oShell.run(sCommandLine,1,True) + +Set oShell = Nothing +Set oWshShell = Nothing + +' This function returns the directory of the script +Function GetCurrentDirectory() + Dim sScriptFullName + + sScriptFullName = WScript.ScriptFullName + GetCurrentDirectory = mid(sScriptFullName,1,InStrRev(sScriptFullName,"\")) + +End Function +