From: Jannik Zander Date: Fri, 10 Feb 2017 16:02:57 +0000 (+0000) Subject: README.md edited online with Bitbucket X-Git-Url: https://git.zndr.dk/?a=commitdiff_plain;h=e663f47ea46695599149482ba7426fc35db6c450;p=unittest.git README.md edited online with Bitbucket --- diff --git a/README.md b/README.md index f38fe4a..d27ae1b 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,8 @@ This is a framework for doing unit testing with CMake. -Content -* [Setup steps for Windows](#setup) -* [Usage](#usage) -* [Demo](#demo) +[TOC] - ## Setup steps for Windows * Install Visual Studio 2008 * Install CMake @@ -23,7 +19,6 @@ Some additional notes * Easy to swap between compilers since it is build automatically * No installation of testing framework is required beforehand - ## Usage To setup testing you need to define a "unit" of code that shall be tested and a corresponding "unittest". @@ -61,143 +56,4 @@ Example of "unittest": $ add_unittest(TARGET folder2_test $ SRCS folder2_test.cpp $ INCS . - $ DEPS folder2) - - -## Demo - $ mkdir build - $ cd build - $ cmake -GNinja .. - $ -- The C compiler identification is GNU 6.2.0 - $ -- The CXX compiler identification is GNU 6.2.0 - $ -- Check for working C compiler: C:/programs/msys64/mingw64/bin/cc.exe - $ -- Check for working C compiler: C:/programs/msys64/mingw64/bin/cc.exe -- works - $ -- Detecting C compiler ABI info - $ -- Detecting C compiler ABI info - done - $ -- Detecting C compile features - $ -- Detecting C compile features - done - $ -- Check for working CXX compiler: C:/programs/msys64/mingw64/bin/c++.exe - $ -- Check for working CXX compiler: C:/programs/msys64/mingw64/bin/c++.exe -- works - $ -- Detecting CXX compiler ABI info - $ -- Detecting CXX compiler ABI info - done - $ -- Detecting CXX compile features - $ -- Detecting CXX compile features - done - $ -- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY) - $ -- Found Git: C:/programs/msys64/usr/bin/git.exe (found version "2.9.0") - $ -- Configuring done - $ -- Generating done - $ -- Build files have been written to: C:/Projects/repos/jannikz/unittest_cmake/build/googletest-download - $ [1/9] Creating directories for 'googletest' - $ [2/9] Performing download step (git clone) for 'googletest' - $ Cloning into 'googletest-src'... - $ Already on 'master' - $ Your branch is up-to-date with 'origin/master'. - $ [3/9] No patch step for 'googletest' - $ [4/9] Performing update step for 'googletest' - $ Current branch master is up to date. - $ [5/9] No configure step for 'googletest' - $ [6/9] No build step for 'googletest' - $ [7/9] No install step for 'googletest' - $ [8/9] No test step for 'googletest' - $ [9/9] Completed 'googletest' - $ -- Found PythonInterp: C:/programs/msys64/mingw64/bin/python.exe (found version "2.7.11") - $ =================================================== - $ Component: - $ folder1: - $ Sources: - $ - folder1.c - $ Includes: - $ - . - $ Dependencies: - $ Definitions: - $ =================================================== - $ Component: - $ folder1_if: - $ Sources: - $ Includes: - $ - . - $ Dependencies: - $ Definitions: - $ =================================================== - $ UnitTest: - $ folder1_test: - $ Sources: - $ - folder1_test.cpp - $ Includes: - $ - . - $ Dependencies: - $ - folder1 - $ Definitions: - $ =================================================== - $ Component: - $ folder2: - $ Sources: - $ - folder2.c - $ Includes: - $ - . - $ Dependencies: - $ - folder1 - $ Definitions: - $ =================================================== - $ UnitTest: - $ folder2_test: - $ Sources: - $ - folder2_test.cpp - $ Includes: - $ - . - $ Dependencies: - $ - folder2 - $ Definitions: - $ =================================================== - $ -- Configuring done - $ -- Generating done - $ -- Build files have been written to: C:/Projects/repos/jannikz/unittest_cmake/build - $ cmake --build . - $ [1/19] Building C object folder1/Source/CMakeFiles/folder1.dir/folder1.c.obj - $ [2/19] Linking C static library folder1\Source\libfolder1.a - $ [3/19] Building C object folder2/Source/CMakeFiles/folder2.dir/folder2.c.obj - $ [4/19] Linking C static library folder2\Source\libfolder2.a - $ [5/19] Building CXX object googletest-build/googlemock/CMakeFiles/gmock_main.dir/src/gmock_main.cc.obj - $ [6/19] Building CXX object googletest-build/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.obj - $ [7/19] Building CXX object googletest-build/googlemock/CMakeFiles/gmock_main.dir/src/gmock-all.cc.obj - $ [8/19] Building CXX object googletest-build/googlemock/CMakeFiles/gmock.dir/__/googletest/src/gtest-all.cc.obj - $ [9/19] Building CXX object googletest-build/googlemock/CMakeFiles/gmock_main.dir/__/googletest/src/gtest-all.cc.obj - $ [10/19] Building CXX object googletest-build/googlemock/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.obj - $ [11/19] Linking CXX static library googletest-build\googlemock\gtest\libgtest.a - $ [12/19] Linking CXX static library googletest-build\googlemock\libgmock.a - $ [13/19] Linking CXX static library googletest-build\googlemock\libgmock_main.a - $ [14/19] Building CXX object googletest-build/googlemock/gtest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.obj - $ [15/19] Linking CXX static library googletest-build\googlemock\gtest\libgtest_main.a - $ [16/19] Building CXX object folder2/Test/CMakeFiles/folder2_test.dir/folder2_test.cpp.obj - $ [17/19] Building CXX object folder1/Test/CMakeFiles/folder1_test.dir/folder1_test.cpp.obj - $ [18/19] Linking CXX executable folder2\Test\folder2_test.exe - $ Running main() from gtest_main.cc - $ [==========] Running 1 test from 1 test case. - $ [----------] Global test environment set-up. - $ [----------] 1 test from function3_test - $ [ RUN ] function3_test.compare3 - $ [ OK ] function3_test.compare3 (0 ms) - $ [----------] 1 test from function3_test (0 ms total) - $ - $ [----------] Global test environment tear-down - $ [==========] 1 test from 1 test case ran. (0 ms total) - $ [ PASSED ] 1 test. - $ [19/19] Linking CXX executable folder1\Test\folder1_test.exe - $ Running main() from gtest_main.cc - $ [==========] Running 2 tests from 2 test cases. - $ [----------] Global test environment set-up. - $ [----------] 1 test from function1_test - $ [ RUN ] function1_test.compare1 - $ [ OK ] function1_test.compare1 (0 ms) - $ [----------] 1 test from function1_test (0 ms total) - $ - $ [----------] 1 test from function2_test - $ [ RUN ] function2_test.compare2 - $ [ OK ] function2_test.compare2 (0 ms) - $ [----------] 1 test from function2_test (0 ms total) - $ - $ [----------] Global test environment tear-down - $ [==========] 2 tests from 2 test cases ran. (0 ms total) - $ [ PASSED ] 2 tests. - - + $ DEPS folder2) \ No newline at end of file