| OLD | NEW |
| 1 @ECHO OFF | 1 @ECHO OFF |
| 2 REM Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 REM Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 3 REM Use of this source code is governed by a BSD-style license that can be | 3 REM Use of this source code is governed by a BSD-style license that can be |
| 4 REM found in the LICENSE file. | 4 REM found in the LICENSE file. |
| 5 REM | 5 REM |
| 6 REM Purpose of this file: If you have IE9 on your machine, not all of | 6 REM Purpose of this file: If you have IE9 on your machine, not all of |
| 7 REM the Chrome Frame tests will currently pass. To run the tests on | 7 REM the Chrome Frame tests will currently pass. To run the tests on |
| 8 REM a VM or separate machine, you need to copy a bunch of things over | 8 REM a VM or separate machine, you need to copy a bunch of things over |
| 9 REM (the tests run slowly or flakily over a network drive). | 9 REM (the tests run slowly or flakily over a network drive). |
| 10 REM | 10 REM |
| 11 REM To facilitate running the tests on a separate machine, Run this | 11 REM To facilitate running the tests on a separate machine, Run this |
| 12 REM batch file on a VM or a separate machine, that has a drive mapped | 12 REM batch file on a VM or a separate machine, that has a drive mapped |
| 13 REM to your dev machine (so that it can access your dev workspace). | 13 REM to your dev machine (so that it can access your dev workspace). |
| 14 REM | 14 REM |
| 15 REM Before running this file, you need to build all the chrome_frame | 15 REM Before running this file, you need to build all the chrome_frame |
| 16 REM targets plus chrome.dll and chrome.exe on your dev machine. Run | 16 REM targets plus chrome.dll and chrome.exe on your dev machine. Run |
| 17 REM the copy of this file that exists in the same workspace that you | 17 REM the copy of this file that exists in the same workspace that you |
| 18 REM want to test. | 18 REM want to test. |
| 19 REM | 19 REM |
| 20 REM NOTE: I've seen cases where a Vista VM under Virtual PC will fail | 20 REM NOTE: I've seen cases where a Vista VM under Virtual PC will fail |
| 21 REM to copy all of the files from the dev machine, and doing e.g. | 21 REM to copy all of the files from the dev machine, and doing e.g. |
| 22 REM [ dir j:\src\chrome\src\chrome\debug ] (assuming j:\src\chrome\src | 22 REM [ dir j:\src\chrome\src\chrome\debug ] (assuming j:\src\chrome\src |
| 23 REM is your workspace on the dev machine) shows an empty filing listing | 23 REM is your workspace on the dev machine) shows an empty filing listing |
| 24 REM when run from the VM, whereas your workspace actually just built | 24 REM when run from the VM, whereas your workspace actually just built |
| 25 REM a ton of stuff in that directory. Just be aware of it, and check | 25 REM a ton of stuff in that directory. Just be aware of it, and check |
| 26 REM what files you actually have in the local copy on the VM after | 26 REM what files you actually have in the local copy on the VM after |
| 27 REM running this script. If you encounter this issue, a reboot of the | 27 REM running this script. If you encounter this issue, a reboot of the |
| 28 REM VM seems to help. | 28 REM VM seems to help. |
| 29 REM | |
| 30 REM ALSO NOTE: At least one test | |
| 31 REM (ChromeFrameTestWithWebServer.FullTabModeIE_TestPostReissue) fails | |
| 32 REM until you choose "never show again" in the "did you notice the | |
| 33 REM infobar" dialog that IE shows, at least if you're running IE7. | |
| 34 | |
| 35 if (%1)==() goto usage | |
| 36 | 29 |
| 37 setlocal | 30 setlocal |
| 38 set CLIENT_ROOT=%~dp0%..\.. | |
| 39 set CONFIG=%1 | |
| 40 | 31 |
| 41 if (%2)==() goto setdefault | 32 REM Get the path to the build tree's src directory. |
| 42 if (%3)==() goto usage | 33 CALL :_canonicalize "%~dp0..\.." |
| 43 set DRIVE=%2 | 34 SET FROM=%RET% |
| 44 set INSTALL_ROOT=%3 | 35 |
| 45 goto pastbase | 36 REM Read OUTPUT and/or BUILDTYPE from command line. |
| 46 :setdefault | 37 FOR %%a IN (%1 %2) do ( |
| 47 set DRIVE=c: | 38 IF "%%a"=="out" SET OUTPUT=out |
| 48 set INSTALL_ROOT=\trybot | 39 IF "%%a"=="build" SET OUTPUT=build |
| 49 :pastbase | 40 IF "%%a"=="Debug" SET BUILDTYPE=Debug |
| 41 IF "%%a"=="Release" SET BUILDTYPE=Release |
| 42 ) |
| 43 |
| 44 CALL :_find_build |
| 45 IF "%OUTPUT%%BUILDTYPE%"=="" ( |
| 46 ECHO No build found to copy. |
| 47 EXIT 1 |
| 48 ) |
| 49 |
| 50 set CLIENT_ROOT=%FROM% |
| 51 SET INSTALL_ROOT=\trybot |
| 50 | 52 |
| 51 @ECHO ON | 53 @ECHO ON |
| 52 %DRIVE% | 54 IF NOT EXIST "%INSTALL_ROOT%" mkdir "%INSTALL_ROOT%" |
| 53 mkdir %INSTALL_ROOT% | |
| 54 cd %INSTALL_ROOT% | 55 cd %INSTALL_ROOT% |
| 55 rmdir /s /q base | 56 rmdir /s /q base |
| 56 rmdir /s /q build\%CONFIG% | 57 rmdir /s /q %OUTPUT%\%BUILDTYPE% |
| 57 rmdir /s /q chrome_frame | 58 rmdir /s /q chrome_frame |
| 58 mkdir base | 59 mkdir base |
| 59 mkdir build\%CONFIG% | 60 mkdir %OUTPUT%\%BUILDTYPE% |
| 60 mkdir chrome_frame\test\data | 61 mkdir chrome_frame\test\data |
| 61 mkdir chrome_frame\test\html_util_test_data | 62 mkdir chrome_frame\test\html_util_test_data |
| 62 mkdir net\data | 63 mkdir net\data |
| 63 mkdir net\tools\testserver | 64 mkdir net\tools\testserver |
| 64 mkdir third_party\pyftpdlib | 65 mkdir third_party\pyftpdlib |
| 65 mkdir third_party\pylib | 66 mkdir third_party\pylib |
| 66 mkdir third_party\python_26 | 67 mkdir third_party\python_26 |
| 68 mkdir third_party\pywebsocket |
| 67 mkdir third_party\tlslite | 69 mkdir third_party\tlslite |
| 68 copy %CLIENT_ROOT%\base\base_paths_win.cc base\base_paths_win.cc | 70 copy %CLIENT_ROOT%\base\base_paths_win.cc base\base_paths_win.cc |
| 69 xcopy %CLIENT_ROOT%\build\%CONFIG% build\%CONFIG% /E /EXCLUDE:%CLIENT_ROOT%\chro
me_frame\test\poor_mans_trybot_xcopy_filter.txt | 71 xcopy %CLIENT_ROOT%\%OUTPUT%\%BUILDTYPE% %OUTPUT%\%BUILDTYPE% /E /EXCLUDE:%CLIEN
T_ROOT%\chrome_frame\test\poor_mans_trybot_xcopy_filter.txt |
| 70 xcopy %CLIENT_ROOT%\chrome_frame\test\data chrome_frame\test\data /E | 72 xcopy %CLIENT_ROOT%\chrome_frame\test\data chrome_frame\test\data /E |
| 71 xcopy %CLIENT_ROOT%\net\data net\data /E | 73 xcopy %CLIENT_ROOT%\net\data net\data /E |
| 72 xcopy %CLIENT_ROOT%\net\tools\testserver net\tools\testserver /E | 74 xcopy %CLIENT_ROOT%\net\tools\testserver net\tools\testserver /E |
| 73 xcopy %CLIENT_ROOT%\third_party\pyftpdlib third_party\pyftpdlib /E | 75 xcopy %CLIENT_ROOT%\third_party\pyftpdlib third_party\pyftpdlib /E |
| 74 xcopy %CLIENT_ROOT%\third_party\pylib third_party\pylib /E | 76 xcopy %CLIENT_ROOT%\third_party\pylib third_party\pylib /E |
| 75 xcopy %CLIENT_ROOT%\third_party\python_26 third_party\python_26 /E | 77 xcopy %CLIENT_ROOT%\third_party\python_26 third_party\python_26 /E |
| 78 xcopy %CLIENT_ROOT%\third_party\pywebsocket third_party\pywebsocket /E |
| 76 xcopy %CLIENT_ROOT%\third_party\tlslite third_party\tlslite /E | 79 xcopy %CLIENT_ROOT%\third_party\tlslite third_party\tlslite /E |
| 77 xcopy %CLIENT_ROOT%\chrome_frame\test\html_util_test_data chrome_frame\test\html
_util_test_data /E | 80 xcopy %CLIENT_ROOT%\chrome_frame\test\html_util_test_data chrome_frame\test\html
_util_test_data /E |
| 78 copy %CLIENT_ROOT%\chrome_frame\CFInstance.js chrome_frame\CFInstance.js | 81 copy %CLIENT_ROOT%\chrome_frame\CFInstance.js chrome_frame\CFInstance.js |
| 79 copy %CLIENT_ROOT%\chrome_frame\CFInstall.js chrome_frame\CFInstall.js | 82 copy %CLIENT_ROOT%\chrome_frame\CFInstall.js chrome_frame\CFInstall.js |
| 80 @ECHO OFF | 83 @ECHO OFF |
| 81 echo ************************************ | 84 echo ************************************ |
| 82 echo DO THE FOLLOWING IN AN ADMIN PROMPT: | 85 echo DO THE FOLLOWING IN AN ADMIN PROMPT: |
| 83 echo ********************************* | 86 echo ********************************* |
| 84 echo %DRIVE%%INSTALL_ROOT%\build\%CONFIG%\chrome_frame_unittests.exe | 87 echo %INSTALL_ROOT%\%OUTPUT%\%BUILDTYPE%\chrome_frame_unittests.exe |
| 85 echo %DRIVE%%INSTALL_ROOT%\build\%CONFIG%\chrome_frame_tests.exe | 88 echo %INSTALL_ROOT%\%OUTPUT%\%BUILDTYPE%\chrome_frame_tests.exe |
| 86 echo %DRIVE%%INSTALL_ROOT%\build\%CONFIG%\chrome_frame_net_tests.exe | 89 echo %INSTALL_ROOT%\%OUTPUT%\%BUILDTYPE%\chrome_frame_net_tests.exe |
| 87 goto end | 90 goto end |
| 88 | 91 |
| 89 :usage | 92 :usage |
| 90 echo "Usage: poor_mans_trybot.bat CONFIG [DRIVE INSTALL_ROOT]" | 93 echo "Usage: poor_mans_trybot.bat [out|build] [Debug|Release]" |
| 91 | 94 |
| 92 :end | 95 :end |
| 96 GOTO :EOF |
| 97 |
| 98 REM All labels henceforth are subroutines intended to be invoked by CALL. |
| 99 |
| 100 REM Canonicalize the first argument, returning it in RET. |
| 101 :_canonicalize |
| 102 SET RET=%~f1 |
| 103 GOTO :EOF |
| 104 |
| 105 REM Search for a npchrome_frame.dll in the candidate build outputs. |
| 106 :_find_build |
| 107 IF "%OUTPUT%"=="" ( |
| 108 SET OUTPUTS=out build |
| 109 ) ELSE ( |
| 110 SET OUTPUTS=%OUTPUT% |
| 111 SET OUTPUT= |
| 112 ) |
| 113 |
| 114 IF "%BUILDTYPE%"=="" ( |
| 115 SET BUILDTYPES=Debug Release |
| 116 ) ELSE ( |
| 117 SET BUILDTYPES=%BUILDTYPE% |
| 118 SET BUILDTYPE= |
| 119 ) |
| 120 |
| 121 FOR %%o IN (%OUTPUTS%) DO ( |
| 122 FOR %%f IN (%BUILDTYPES%) DO ( |
| 123 IF EXIST "%FROM%\%%o\%%f\npchrome_frame.dll" ( |
| 124 SET OUTPUT=%%o |
| 125 SET BUILDTYPE=%%f |
| 126 GOTO :EOF |
| 127 ) |
| 128 ) |
| 129 ) |
| 130 GOTO :EOF |
| OLD | NEW |