OSDN Git Service

Version 3.03
[vbslib/main.git] / samples / Test / T_Mixer / Test.vbs
diff --git a/samples/Test/T_Mixer/Test.vbs b/samples/Test/T_Mixer/Test.vbs
new file mode 100644 (file)
index 0000000..c0b6d35
--- /dev/null
@@ -0,0 +1,86 @@
+Option Explicit \r
+'--- start of vbslib include ------------------------------------------------------\r
+'// \82±\82±\82Í\81A\8fC\90³\82µ\82È\82¢\82Å\82­\82¾\82³\82¢\81B\89º\8bL\83\81\83C\83\93\8aÖ\90\94\82©\82ç\83X\83N\83\8a\83v\83g\82ð\8bL\8fq\82µ\82Ä\82­\82¾\82³\82¢\81B\r
+'// \82l\82r\83I\83t\83B\83X\82â\83R\83\93\83p\83C\83\89\82ª\82 \82ê\82Î\81A\89º\8bL\82Ì\82\87\81Q\82\84\82\85\82\82\82\95\82\87 \82ð\82P\82É\82·\82ê\82Î\81A\83f\83o\83b\83K\82ª\8eg\82¦\82Ü\82·\81B\r
+'// \82r\82\94\82\8f\82\90\96½\97ß\82ð\8bL\8fq\82·\82ê\82Î\81A\83f\83o\83b\83K\82Í\83u\83\8c\81[\83N\82µ\82Ü\82·\81B\8fÚ\82µ\82­\82Í vbslib \82Ì\90à\96¾\8f\91\82Ì\8dÅ\8cã\82Ì\81u\8d¢\82Á\82½\82Æ\82«\82Í\81v\81B\r
+Dim  g_debug, g_admin, g_vbslib_path, g_CommandPrompt, g_fs, g_sh, g_AppKey, g_Vers\r
+If IsEmpty( g_fs ) Then\r
+  Dim  g_MainPath, g_SrcPath : g_SrcPath = WScript.ScriptFullName : g_MainPath = g_SrcPath\r
+  Set g_Vers = CreateObject("Scripting.Dictionary") : g_Vers.Add "vbslib", 3.0\r
+  '--- start of parameters for vbslib include -------------------------------\r
+  g_debug = 0\r
+  g_vbslib_path = "vbslib\vbs_inc.vbs"\r
+  g_CommandPrompt = 1\r
+  '--- end of parameters for vbslib include ---------------------------------\r
+  Dim  g_f, g_include_path, i : Set  g_fs = CreateObject( "Scripting.FileSystemObject" )\r
+  Set  g_sh = WScript.CreateObject("WScript.Shell") : g_f = g_sh.CurrentDirectory\r
+  g_sh.CurrentDirectory = g_fs.GetParentFolderName( WScript.ScriptFullName )\r
+  For i = 20 To 1 Step -1 : If g_fs.FileExists(g_vbslib_path) Then  Exit For\r
+  g_vbslib_path = "..\" + g_vbslib_path  : Next\r
+  If g_fs.FileExists(g_vbslib_path) Then  g_vbslib_path = g_fs.GetAbsolutePathName( g_vbslib_path )\r
+  g_sh.CurrentDirectory = g_f\r
+  If i=0 Then WScript.Echo "Not found " + g_fs.GetFileName( g_vbslib_path ) +vbCR+vbLF+ "Let's download vbslib "&g_Vers.Item("vbslib")&" and Copy vbslib folder." : WScript.Quit 1\r
+  Set g_f = g_fs.OpenTextFile( g_vbslib_path ): Execute g_f.ReadAll() : g_f = Empty\r
+  If ResumePush Then  On Error Resume Next\r
+    If IsDefined("main2") Then  Set g_f=CreateObject("Scripting.Dictionary") :_\r
+      Set g_AppKey = new AppKeyClass : main2  g_f, g_AppKey.SetKey( new AppKeyClass )  Else _\r
+      Set g_AppKey = new AppKeyClass : g_AppKey.SetKey( new AppKeyClass ) : main\r
+  g_f = Empty : ResumePop : On Error GoTo 0\r
+End If\r
+'--- end of vbslib include --------------------------------------------------------\r
+\r
+Dim  g_ExeName : g_ExeName = "T_Sample"\r
+\r
+\r
+Sub main2( Opt, AppKey ):set_input "" :RunTestPrompt AppKey.NewWritable( "." ):End Sub\r
+\r
+\r
+Sub  test_current( tests )\r
+End Sub\r
+\r
+\r
+Sub  test_build( tests )\r
+  Dim  r : r = RunProg( "cscript "+g_ExeName+"_setup.vbs /MakeProj", "" )\r
+  CheckTestErrLevel  r\r
+  devenv_rebuild  g_ExeName+".sln", "Debug"\r
+  devenv_rebuild  g_ExeName+".sln", "Release"\r
+  Pass\r
+End Sub\r
+\r
+\r
+Sub  test_setup( tests )\r
+  Pass\r
+End Sub\r
+\r
+\r
+Sub  test_start( tests )\r
+  test_start_sub  tests, "Debug"\r
+  test_start_sub  tests, "Release"\r
+  Pass\r
+End Sub\r
+\r
+\r
+Sub  test_start_sub( tests, ConfigName )\r
+  Dim  r\r
+\r
+  r = RunProg( ConfigName +"\"+g_ExeName+".exe T_Sample_Sample", "" )\r
+  If r <> 0 Then  Fail\r
+\r
+  r = RunProg( ConfigName +"\"+g_ExeName+".exe T_Sample", "" )\r
+  If r <> 0 Then  Fail\r
+End Sub\r
+\r
+\r
+Sub  test_check( tests )\r
+  Pass\r
+End Sub\r
+\r
+\r
+Sub  test_clean( tests )\r
+  Dim  r : r = RunProg( "cscript "+g_ExeName+"_setup.vbs /DeepClean", "" )\r
+  CheckTestErrLevel  r\r
+  Pass\r
+End Sub\r
+\r
+\r
\r