2 '--- start of vbslib include ------------------------------------------------------
\r
3 Dim g_debug, g_vbslib_path, g_IncludeType, g_CommandPrompt, g_fs, g_sh
\r
4 If IsEmpty( g_fs ) Then
\r
5 '--- start of parameters for vbslib include -------------------------------
\r
7 g_vbslib_path = "vbslib\vbs_inc.vbs"
\r
10 '--- end of parameters for vbslib include ---------------------------------
\r
11 Dim g_f, g_include_path, i : Set g_fs = CreateObject( "Scripting.FileSystemObject" )
\r
12 If g_fs.FileExists("setting.vbs") Then Set g_f = g_fs.OpenTextFile( "setting.vbs" ): Execute g_f.ReadAll()
\r
13 If not IsEmpty( WScript.Arguments.Named.Item("IncludeType") ) Then g_IncludeType = WScript.Arguments.Named.Item("IncludeType")
\r
14 Set g_sh = WScript.CreateObject("WScript.Shell") : g_f = g_sh.CurrentDirectory
\r
15 g_sh.CurrentDirectory = g_fs.GetParentFolderName( WScript.ScriptFullName )
\r
16 For i = 10 To 1 Step -1 : If g_fs.FileExists(g_vbslib_path) Then Exit For
\r
17 g_vbslib_path = "..\" + g_vbslib_path : Next
\r
18 If g_fs.FileExists(g_vbslib_path) Then g_vbslib_path = g_fs.GetAbsolutePathName( g_vbslib_path )
\r
19 g_sh.CurrentDirectory = g_f
\r
20 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
\r
21 Set g_f = g_fs.OpenTextFile( g_vbslib_path ): Execute g_f.ReadAll() : g_f = Empty
\r
22 If ResumePush Then On Error Resume Next
\r
24 ResumePop : On Error GoTo 0
\r
26 '--- end of vbslib include --------------------------------------------------------
\r
29 Sub main() : RunTestPrompt Empty : End Sub
\r
32 Sub test_current( tests )
\r
37 Sub test_build( tests )
\r
42 Sub test_setup( tests )
\r
47 Sub test_start( tests )
\r
48 Dim exe_path, tname, r
\r
51 exe_path = "sample_exe.bat"
\r
54 '//=== [Type0] Manual Test.
\r
55 ManualTest tests.Symbol
\r
58 '//=== [Type1] Command parameter has a test symbol.
\r
59 tname = "T_Sample1" : EchoTestStart tname
\r
60 r = RunProg( """" + exe_path + """ /Test:"+tname, "" )
\r
61 '// CheckTestErrLevel r
\r
64 '//=== [Type2] Command parameter has a test parameter file path.
\r
67 tname = "T_Sample2" : EchoTestStart tname
\r
68 param_path = tname+"_param.txt"
\r
69 Set f = g_fs.CreateTextFile( param_path, True, False )
\r
70 f.WriteLine param_path
\r
72 'del "" ' for redirect
\r
74 RunProg """" + exe_path + """ /Test:"+tname+" /TestParam:"+param_path, ""
\r
76 Set f = g_fs.OpenTextFile( param_path )
\r
77 If Trim(f.ReadLine) <> "Pass." Then Fail
\r
85 Sub test_check( tests )
\r
90 Sub test_clean( tests )
\r