Option Explicit '--- start of vbslib include ------------------------------------------------------ Dim g_debug, g_vbslib_path, g_IncludeType, g_CommandPrompt, g_fs, g_sh If IsEmpty( g_fs ) Then '--- start of parameters for vbslib include ------------------------------- g_debug = 0 g_vbslib_path = "vbslib\vbs_inc.vbs" g_IncludeType = "" g_CommandPrompt = 1 '--- end of parameters for vbslib include --------------------------------- Dim g_f, g_include_path, i : Set g_fs = CreateObject( "Scripting.FileSystemObject" ) If g_fs.FileExists("setting.vbs") Then Set g_f = g_fs.OpenTextFile( "setting.vbs" ): Execute g_f.ReadAll() If not IsEmpty( WScript.Arguments.Named.Item("IncludeType") ) Then g_IncludeType = WScript.Arguments.Named.Item("IncludeType") Set g_sh = WScript.CreateObject("WScript.Shell") : g_f = g_sh.CurrentDirectory g_sh.CurrentDirectory = g_fs.GetParentFolderName( WScript.ScriptFullName ) For i = 10 To 1 Step -1 : If g_fs.FileExists(g_vbslib_path) Then Exit For g_vbslib_path = "..\" + g_vbslib_path : Next If g_fs.FileExists(g_vbslib_path) Then g_vbslib_path = g_fs.GetAbsolutePathName( g_vbslib_path ) g_sh.CurrentDirectory = g_f If i=0 Then WScript.Echo "Not found " + g_fs.GetFileName( g_vbslib_path ) +vbCR+vbLF+ "Check g_vbslib_path in " + WScript.ScriptName + " or setting.vbs" : WScript.Quit 1 Set g_f = g_fs.OpenTextFile( g_vbslib_path ): Execute g_f.ReadAll() : g_f = Empty If ResumePush Then On Error Resume Next main ResumePop : On Error GoTo 0 End If '--- end of vbslib include -------------------------------------------------------- Sub main() : RunTestPrompt Empty : End Sub Sub test_current( tests ) tests.SetCur "" End Sub Sub test_build( tests ) Pass End Sub Sub test_setup( tests ) Pass End Sub Sub test_start( tests ) Dim exe_path, tname, r exe_path = "sample_exe.bat" '//=== [Type0] Manual Test. ManualTest tests.Symbol '//=== [Type1] Command parameter has a test symbol. tname = "T_Sample1" : EchoTestStart tname r = RunProg( """" + exe_path + """ /Test:"+tname, "" ) '// CheckTestErrLevel r '//=== [Type2] Command parameter has a test parameter file path. Dim f, param_path tname = "T_Sample2" : EchoTestStart tname param_path = tname+"_param.txt" Set f = g_fs.CreateTextFile( param_path, True, False ) f.WriteLine param_path f = Empty 'del "" ' for redirect RunProg """" + exe_path + """ /Test:"+tname+" /TestParam:"+param_path, "" Set f = g_fs.OpenTextFile( param_path ) If Trim(f.ReadLine) <> "Pass." Then Fail f = Empty del param_path Pass End Sub Sub test_check( tests ) Pass End Sub Sub test_clean( tests ) Pass End Sub