Menu

How to build unit tests

Help
2015-09-19
2015-09-19
  • Giuseppe Barbieri

    Hi,

    I'd like to build the unit tests

    I am on Linux and this is what I tried

    *elect@elect-desktop:~/NetBeansProjects/assimp$ make
    [ 78%] Built target assimp
    [ 81%] Built target assimpcmd
    [ 81%] Performing update step for 'gtest'
    Already on 'master'
    Your branch is up-to-date with 'origin/master'.
    [ 81%] Performing configure step for 'gtest'
    -- gtest configure command succeeded. See also /home/elect/NetBeansProjects/assimp/test/gtest/src/gtest-stamp/gtest-configure-.log

    [ 82%] Performing build step for 'gtest'
    -- gtest build command succeeded. See also /home/elect/NetBeansProjects/assimp/test/gtest/src/gtest-stamp/gtest-build-.log

    [ 83%] No install step for 'gtest'
    [ 83%] Completed 'gtest'
    [ 85%] Built target gtest
    [100%] Built target unit
    elect@elect-desktop:~/NetBeansProjects/assimp$ cd t
    bash: cd: t: No such file or directory
    elect@elect-desktop:~/NetBeansProjects/assimp$ cd t
    test/ tools/
    elect@elect-desktop:~/NetBeansProjects/assimp$ cd test/
    elect@elect-desktop:~/NetBeansProjects/assimp/test$ make
    [ 0%] Performing update step for 'gtest'
    Already on 'master'
    Your branch is up-to-date with 'origin/master'.
    [ 0%] Performing configure step for 'gtest'
    -- gtest configure command succeeded. See also /home/elect/NetBeansProjects/assimp/test/gtest/src/gtest-stamp/gtest-configure-.log

    [ 1%] Performing build step for 'gtest'
    -- gtest build command succeeded. See also /home/elect/NetBeansProjects/assimp/test/gtest/src/gtest-stamp/gtest-build-.log

    [ 2%] No install step for 'gtest'
    [ 2%] Completed 'gtest'
    [ 4%] Built target gtest
    [ 84%] Built target assimp
    [100%] Built target unit*

    What am I missing?

     
  • Kim Kulling

    Kim Kulling - 2015-09-19

    [100%] Built target unit* nothing, you did everything right. They are right there ( check bin ) .

    Kimmi

     
    • Giuseppe Barbieri

      Hi Kimmi,

      ah, you are right, there it is, but I just have a unique "unit" containing all the test together

      Would it be possible to get each test singularly?

      Edit: I solved, I just leave uncommented the test I want to run in the CMakeLists.txt, SET( TEST_SRCS...)

       

      Last edit: Giuseppe Barbieri 2015-09-19
  • Giuseppe Barbieri

    Very nice, I modified it and I can debug looking inside and double checking side by side!

    :)

     
  • Kim Kulling

    Kim Kulling - 2015-09-19

    You can also use the gtest_filter=<name_with_wildcards> option to specify which test shall be started.

    Kimmi

     

Log in to post a comment.