1 Sub Main( Opt, AppKey )
\r
2 Dim path : path = SearchParent("TestCommon.vbs")
\r
3 If not IsEmpty( path ) Then include path
\r
4 RunTestPrompt AppKey.NewWritable( GetParentFullPath( SearchParent( "vbslib Prompt.vbs" ) ) )
\r
7 Sub Test_current( tests )
\r
8 If IsEmpty( tests.CurrentTest.Delegate ) Then
\r
9 Dim g : Set g = CreateObject( "Scripting.Dictionary" ) : Set tests.CurrentTest.Delegate = g
\r
10 If IsDefined( "TestCommon_setVariables" ) Then TestCommon_setVariables g
\r
14 '==============================================================================
\r
15 g("ExeName") = "CheckEnglishOnly"
\r
16 g("Config") = "Release"
\r
17 g("ExtraRelease") = Array( _
\r
19 "..\..\..\..\..\..\_replica\scriptlib\vbslib\CheckEnglishOnly",_
\r
20 "..\..\..\..\..\..\..\scriptlib\vbslib\CheckEnglishOnly" )
\r
21 '==============================================================================
\r
23 x = WScript.Arguments.Named( "Config" ) : If not IsEmpty( x ) Then g("Config") = x
\r
28 Sub Test_build( tests )
\r
29 Set g = tests.CurrentTest.Delegate
\r
30 r = RunProg( "cscript "+g("ExeName")+"_setup.vbs /MakeProj", "" )
\r
32 devenv_rebuild g("ExeName")+".sln", g("Config")
\r
37 Sub Test_start( tests )
\r
38 Set g = tests.CurrentTest.Delegate
\r
39 Set ds = new CurDirStack
\r
40 Set section = new SectionTree
\r
41 '//SetStartSectionTree "T_Sample2" '//
\88ê
\95\94\82Ì
\83Z
\83N
\83V
\83\87\83\93\82¾
\82¯
\8eÀ
\8ds
\82·
\82é
\82Æ
\82«
\82Í
\97L
\8cø
\82É
\82·
\82é
\r
44 '//=== Test case : Basic
\r
45 If section.Start( "T_Basic" ) Then
\r
51 r = RunProg( g("Config") +"\"+g("ExeName")+".exe /Folder:TestData "+_
\r
52 "/Setting:TestData\SettingForCheckEnglish.ini", "out.txt" )
\r
56 AssertFC "out.txt", "Answer\T_Basic.txt"
\r
61 End If : section.End_
\r
64 '//=== Test case : Parent folder
\r
65 If section.Start( "T_ParentFolder" ) Then
\r
69 For Each file_name In Array( "KanjiInUnicode.txt", "SettingForCheckEnglish.ini" )
\r
70 copy "TestData\"+ file_name, "work\work\TestData"
\r
72 exe = GetFullPath( g("Config") +"\"+g("ExeName")+".exe", Empty )
\r
75 pushd "work\work\TestData"
\r
76 r = RunProg( """"+ exe +""" /Folder:..\.. "+_
\r
77 "/Setting:SettingForCheckEnglish.ini", "..\..\..\out.txt" )
\r
82 AssertFC "out.txt", "Answer\T_ParentFolder.txt"
\r
87 End If : section.End_
\r
93 Sub Test_check( tests )
\r
94 Set g = tests.CurrentTest.Delegate
\r
95 For Each path In g("ExtraRelease")
\r
96 Assert g_fs.FolderExists( path )
\r
97 copy "Release\CheckEnglishOnly.exe", path
\r
103 Sub Test_clean( tests )
\r
104 Dim g : Set g = tests.CurrentTest.Delegate
\r
105 Dim r : r = RunProg( "cscript "+g("ExeName")+"_setup.vbs /Clean", "" )
\r
106 CheckTestErrLevel r
\r
112 Sub Test_setup( tests ) : Pass : End Sub
\r
123 '--- start of vbslib include ------------------------------------------------------
\r
125 '//
\82±
\82±
\82Ì
\93à
\95\94\82©
\82ç Main
\8aÖ
\90\94\82ð
\8cÄ
\82Ñ
\8fo
\82µ
\82Ä
\82¢
\82Ü
\82·
\81B
\r
126 '//
\82Ü
\82½
\81Ascriptlib
\83t
\83H
\83\8b\83_
\81[
\82ð
\92T
\82µ
\82Ä
\81Avbslib
\82ð
\83C
\83\93\83N
\83\8b\81[
\83h
\82µ
\82Ä
\82¢
\82Ü
\82·
\r
128 '// vbslib include is provided under 3-clause BSD license.
\r
129 '// Copyright (C) Sofrware Design Gallery "Sage Plaisir 21" All Rights Reserved.
\r
131 Dim g_Vers : If IsEmpty( g_Vers ) Then
\r
132 Set g_Vers = CreateObject("Scripting.Dictionary") : g_Vers("vbslib") = 99.99
\r
133 Dim g_debug, g_debug_params, g_admin, g_vbslib_path, g_CommandPrompt, g_fs, g_sh, g_AppKey
\r
134 Dim g_MainPath, g_SrcPath, g_f, g_include_path, g_i, g_debug_tree, g_debug_process, g_is_compile_debug
\r
136 g_SrcPath = WScript.ScriptFullName : g_MainPath = g_SrcPath
\r
137 SetupVbslibParameters
\r
138 Set g_fs = CreateObject( "Scripting.FileSystemObject" )
\r
139 Set g_sh = WScript.CreateObject("WScript.Shell") : g_f = g_sh.CurrentDirectory
\r
140 g_sh.CurrentDirectory = g_fs.GetParentFolderName( WScript.ScriptFullName )
\r
141 For g_i = 20 To 1 Step -1 : If g_fs.FileExists(g_vbslib_path) Then Exit For
\r
142 g_vbslib_path = "..\" + g_vbslib_path : Next
\r
143 If g_fs.FileExists(g_vbslib_path) Then g_vbslib_path = g_fs.GetAbsolutePathName( g_vbslib_path )
\r
144 g_sh.CurrentDirectory = g_f
\r
145 If g_i=0 Then WScript.Echo "Not found " + g_fs.GetFileName( g_vbslib_path ) +vbCR+vbLF+_
\r
146 "Let's download vbslib and Copy scriptlib folder." : Stop : WScript.Quit 1
\r
147 Set g_f = g_fs.OpenTextFile( g_vbslib_path,,,-2 ): Execute g_f.ReadAll() : g_f = Empty
\r
148 If ResumePush Then On Error Resume Next
\r
150 ResumePop : On Error GoTo 0
\r
152 '---------------------------------------------------------------------------------
\r
154 Sub SetupDebugTools()
\r
156 SetBreakByFName Empty
\r
157 SetStartSectionTree ""
\r
160 Sub SetupVbslibParameters()
\r
161 '--- start of parameters for vbslib include -------------------------------
\r
162 g_Vers("vbslib") = 99.99
\r
163 '// g_Vers("OldMain") = 1
\r
164 g_vbslib_path = "scriptlib\vbs_inc.vbs"
\r
165 g_CommandPrompt = 1
\r
167 '--- end of parameters for vbslib include ---------------------------------
\r
169 '--- end of vbslib include --------------------------------------------------------
\r