OSDN Git Service

Update TranslationsStatus
[winmerge-jp/winmerge-jp.git] / Testing / GoogleTest / README.md
1 Quick help to get started with Google Test for WinMerge
2 =======================================================
3
4 As name suggest, this test set uses Google's unit testing framework. So first
5 you need to get Google Test sources from:
6
7 <http://code.google.com/p/googletest/>
8 [download the .zip file for Windows]
9
10 Unzip and compile Google Test library
11 -------------------------------------
12
13 Unzip the Google Test sources to some folder. Pick a folder you can keep around
14 (not some temp folder) because you'll need the header files every time you
15 compile unit tests.
16
17 Open solution file to Visual Studio. The file is in subfolder `msvc\gtest.sln`
18
19 Build the 'Release' target of 'gtest' project. You don't need to build other
20 projects or targets. Indeed, 'rebuild all' for the solution does not work.
21
22 Copy the gtest.lib file from `msvc\Release` subfolder to `Testing\GoogleTest`-
23 folder in WinMerge source tree.
24
25 Setup Visual Studio for Google Test
26 -----------------------------------
27
28 As mentioned earlier Google Test header files are needed to compile the tests.
29 As the Google Test was unzipped to separate folder we must first tell VS where
30 to find those headers.
31
32 Add the `gtest-[version]\include` -folder to Visual Studio's include file
33 folders:
34
35 * Open Options -dialog in Visual Studio
36 * Select Projects and solutions
37 * Select VC++ Directories
38 * Select Include files
39 * Add `gtest-[version]\include` -folder as *LAST* folder in that list
40
41 Open the test project into Visual Studio and compile
42 ----------------------------------------------------
43
44 Open the testing project to Visual Studio (VS 2003 and later work) and compile
45 Release -target of the project.
46
47 Run the tests
48 -------------
49
50 Open the Command Prompt and CD to folder where executable were build, usually
51 `[projectname]/Release`
52
53 Run the executable.
54
55 While the testing runs it prints progress information and info about passed/
56 failed tests.