stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r499822 - in /incubator/stdcxx/trunk/etc/config/windows: projectdef.js projects.js runall.wsf
Date Thu, 25 Jan 2007 15:52:39 GMT
Author: faridz
Date: Thu Jan 25 07:52:35 2007
New Revision: 499822

URL: http://svn.apache.org/viewvc?view=rev&rev=499822
Log:
2007-01-25 Farid Zaripov <faridz@kyiv.vdiweb.com>

	* projectdef.js (projectCreateTestLocalesDef): PreBuildCmd modified
	to avoid using of very long lines.
	* projects.js (CreateProjectsDefs): Use runall.wsf script to run locale tests.
	* runall.wsf: Added new parameter EXT.

Modified:
    incubator/stdcxx/trunk/etc/config/windows/projectdef.js
    incubator/stdcxx/trunk/etc/config/windows/projects.js
    incubator/stdcxx/trunk/etc/config/windows/runall.wsf

Modified: incubator/stdcxx/trunk/etc/config/windows/projectdef.js
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/windows/projectdef.js?view=diff&rev=499822&r1=499821&r2=499822
==============================================================================
--- incubator/stdcxx/trunk/etc/config/windows/projectdef.js (original)
+++ incubator/stdcxx/trunk/etc/config/windows/projectdef.js Thu Jan 25 07:52:35 2007
@@ -854,10 +854,8 @@
 
     projectDef.PreBuildCmd +=
         "echo cscript /nologo %util% /s /b:\"%bindir%\" > \"%bindir%\\" + test + ".bat\"";
-    projectDef.CustomBuildCmd = "cd \"" + bindir + "\"\r\n" +
-        "exec.exe -t " + execTimeout + " " + test + ".bat";
-    projectDef.CustomBuildOut = bindir + "\\" + test + ".out";
 
+    var arrLocs = new Array();
     var locales = "";
         
     for (var i = 0; i < this.arrLocales.length; ++i)
@@ -891,14 +889,25 @@
             WScript.Quit(3);
         }
 
-        locales += locale.Name + " ";
-        projectDef.CustomBuildCmd += " " + locale.Name + ".bat";
-        projectDef.CustomBuildOut += ";" + bindir + "\\" + locale.Name + ".out";
+        if (locales.length + locale.Name.length > 1012)
+        {
+            arrLocs.push(locales);
+            locales = "";
+        }
+        else
+        {
+            if (0 < locales.length)
+                locales += " ";
+            locales += locale.Name;
+        }
     }
 
     if (0 < locales.length)
+        arrLocs.push(locales);
+
+    for (var i = 0; i < arrLocs.length; ++i)
     {
-        projectDef.PreBuildCmd += "\r\nset locales=" + locales + "\r\n" +
+        projectDef.PreBuildCmd += "\r\nset locales=" + arrLocs[i] + "\r\n" +
             "for %%l in (%locales%) do " +
             "echo cscript /nologo %util% /f /b:\"%bindir%\" " +
             "/i:\"%etcdir%\\nls\" /l:%%l > \"%bindir%\\%%l.bat\"";

Modified: incubator/stdcxx/trunk/etc/config/windows/projects.js
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/windows/projects.js?view=diff&rev=499822&r1=499821&r2=499822
==============================================================================
--- incubator/stdcxx/trunk/etc/config/windows/projects.js (original)
+++ incubator/stdcxx/trunk/etc/config/windows/projects.js Thu Jan 25 07:52:35 2007
@@ -405,6 +405,21 @@
         testlocaleArray = testlocaleArray.concat(testlocaleDefs);
     }
     
+    testlocaleTplDef.FilterDefs = new Array();
+    testlocaleTplDef.FilterDefs.push(
+        new FilterDef("Script Files", null, ".js;.wsf", eFileTypeScript, false).
+            addFiles("%SRCDIR%\\etc\\config\\windows",
+                new Array("runall.wsf", "config.js", "utilities.js",
+                          "summary.js")));
+    testlocaleTplDef.CustomBuildFile = "runall.wsf";
+    testlocaleTplDef.CustomBuildCmd = "cscript /nologo \"%CUSTOMFILE%\"" +
+        " /EXEDIR:\"$(OutDir)\"" +
+        " /BUILDTYPE:\"%CONFIG%\"" +
+        " /CONFIG:\"%SOLUTION%\"" +
+        " /LOGFILE:\"runloctests.log\"" +
+        " /COPYDLL:false /EXT:bat";
+    testlocaleTplDef.CustomBuildOut = "$(OutDir)\\runloctests.log";
+
     var testlocalesDef = testlocaleTplDef.createTestLocalesDef("%SRCDIR%\\etc\\nls");
     testlocaleArray.push(testlocalesDef);
 

Modified: incubator/stdcxx/trunk/etc/config/windows/runall.wsf
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/windows/runall.wsf?view=diff&rev=499822&r1=499821&r2=499822
==============================================================================
--- incubator/stdcxx/trunk/etc/config/windows/runall.wsf (original)
+++ incubator/stdcxx/trunk/etc/config/windows/runall.wsf Thu Jan 25 07:52:35 2007
@@ -38,14 +38,16 @@
                 required="false" type="string"/>
             <named helpstring="The lib dll folder" name="LIBDIR" 
                 required="false" type="string"/>
+            <named helpstring="The examples extension" name="EXT" 
+                required="false" type="string"/>
             <example>
             cscript runexamples.wsf /EXEDIR:"C:\stdcxx\build" 
             /INOUTDIR:"C:\stdcxx\build" /BUILDTYPE:11d /CONFIG:msvc-7.1
             </example>
             <usage>
 Usage: cscript runexamples.wsf /EXEDIR:@EXEDIR [/INOUTDIR:@INOUTDIR] 
-/BUILDTYPE:@BUILDTYPE /CONFIG:@CONFIG
-[/LOGFILE:@LOGFILE] [/COPYDLL:@COPYDLL] [/LIBDIR:@LIBDIR]
+/BUILDTYPE:@BUILDTYPE /CONFIG:@CONFIG [/LOGFILE:@LOGFILE]
+[/COPYDLL:@COPYDLL] [/LIBDIR:@LIBDIR] [/EXT:@EXT]
 where
 @EXEDIR is the root directory with executables ro be run and checked,
 @TOPDIR is the root directory with .in and .out files 
@@ -55,6 +57,7 @@
 @LOGFILE is the log file name.
 @COPYDLL is the option for copy stdlibxx.dll to executables
 @LIBDIR is the library dll folder (specify when COPYDLL is true)
+@EXT is the extension of the example files, default value: "exe"
             </usage>
         </runtime>
         <object id="fso" progid="Scripting.FileSystemObject"/>
@@ -77,6 +80,7 @@
 var logFileDefault = "runexamples.log"; // the default log file name
 var copyDll = false;
 var libdllFolder = "";
+var ext = "exe";
 
 var varOut = "out";
 
@@ -114,7 +118,7 @@
     var fLog = fso.CreateTextFile(examplesDir + "\\" + logFileName);
     var fSummary = fso.CreateTextFile(buildOutDir + "\\" + summaryFileName);
     
-    runAllExamples(examplesDir, inoutDir, fLog, fSummary);
+    runAllExamples(examplesDir, inoutDir, fLog, fSummary, ext);
     
     WScript.Echo("Total run " + exRun + "; " + exRunSucceeded 
         + " succeeded, " 
@@ -179,6 +183,9 @@
     if (WScript.Arguments.Named.Exists("LIBDIR"))
         libdllFolder = WScript.Arguments.Named("LIBDIR");
     
+    if (WScript.Arguments.Named.Exists("EXT"))
+        ext = WScript.Arguments.Named("EXT");
+    
     if (! fso.FolderExists(examplesDir))
     {
         WScript.StdErr.WriteLine(
@@ -201,7 +208,7 @@
 // srcDir - starting folder to search .in and .out files for the executable
 // fileLog - filename of the logfile
 // fileSimmary - filename of the summary file
-function runAllExamples(exeDir, srcDir, fileLog, fileSummary)
+function runAllExamples(exeDir, srcDir, fileLog, fileSummary, exeExt)
 {
     var exeFolder = fso.GetFolder(exeDir);
     if (! exeFolder)
@@ -214,7 +221,7 @@
     var exeFiles = new Array();
     var arrInfo = new Array();
     
-    var rx = new RegExp("^.+\\.(?:exe)$", "i");
+    var rx = new RegExp("^.+\\.(?:" + exeExt + ")$", "i");
     var enumExeFiles = new Enumerator(exeFolder.Files);
     for (; !enumExeFiles.atEnd(); enumExeFiles.moveNext())
     {
@@ -223,10 +230,10 @@
             continue;
             
         var itemInfo = 
-            new ItemBuildInfo(getPureFileName(exeFileName, "exe"));
+            new ItemBuildInfo(getPureFileName(exeFileName, exeExt));
         readBuildLog(exeDir, itemInfo, unicodeLog);
 
-        itemInfo.runReqOutput = readOutFile(srcDir, exeFileName);
+        itemInfo.runReqOutput = readOutFile(srcDir, exeFileName, exeExt);
 
         exeFiles.push(exeFileName);
         arrInfo.push(itemInfo);
@@ -305,7 +312,7 @@
             WScript.Echo("Could not delete temporary file " + outFileName);
         }
         
-        itemInfo.exitCode = parseStatus(itemInfo.name + ".exe", execOut);
+        itemInfo.exitCode = parseStatus(itemInfo.name + "." + exeExt, execOut);
         switch (itemInfo.exitCode)
         {
         case 0:  // OK
@@ -346,10 +353,12 @@
 {
     var res = 0;
 
-    var pos = execOut.indexOf(exeName);
+    // maxNameLen is the length of the "NAME" column in the exec utility output
+    var maxNameLen = 25;
+    var pos = execOut.indexOf(exeName.substr(0, maxNameLen));
     if (0 <= pos)
     {
-        pos += 26;
+        pos += maxNameLen + 1;
         var status = execOut.substring(pos, execOut.indexOf(" ", pos + 6));
         res = parseInt(status);
         if (isNaN(res))
@@ -378,12 +387,12 @@
 // srcDir - folder containing subfolders with .in and .out files
 // exeFileName - filename of the executable
 // nameSuffix - one of varIn, varOut
-function readAllFromFile(srcDir, exeFileName, nameSuffix)
+function readAllFromFile(srcDir, exeFileName, nameSuffix, exeExt)
 {   
     if (! fso.FolderExists(srcDir))
         return "";
         
-    var pureName = getPureFileName(exeFileName, "exe");
+    var pureName = getPureFileName(exeFileName, exeExt);
         
     var someDir = srcDir + "\\" + nameSuffix;
     if (! fso.FolderExists(someDir))
@@ -403,18 +412,18 @@
 // returns the content of the .out file for the specified executable
 // srcDir - folder containing .out files
 // exeFileName - filename of the executable
-function readOutFile(srcDir, exeFileName)
+function readOutFile(srcDir, exeFileName, exeExt)
 {
-    var outData = readAllFromFile(srcDir, exeFileName, varOut);
+    var outData = readAllFromFile(srcDir, exeFileName, varOut, exeExt);
     
     if (0 == outData.length)
     {
-        outData = readAllFromFile(srcDir + "\\manual", exeFileName, varOut);
+        outData = readAllFromFile(srcDir + "\\manual", exeFileName, varOut, exeExt);
         if (0 < outData.length)
             srcDir += "\\manual";
         else
         {
-            outData = readAllFromFile(srcDir + "\\tutorial", exeFileName, varOut);
+            outData = readAllFromFile(srcDir + "\\tutorial", exeFileName, varOut, exeExt);
             if (0 < outData.length)
                 srcDir += "\\tutorial";
         }



Mime
View raw message