Browse Source

* Fixed bug: cmake variables are not initialized correctly (because they depend on the options, and the options are included after the variables)

* Changed filenames of the tests
master
bergmann 4 years ago
parent
commit
4fcf5a1971
7 changed files with 15 additions and 15 deletions
  1. +1
    -1
      projects/helloworld/CMakeLists.txt
  2. +1
    -0
      projects/helloworld/test/CMakeLists.txt
  3. +0
    -11
      projects/helloworld/test/helloworld/helloworld-tests.cpp
  4. +10
    -0
      projects/helloworld/test/helloworld/helloworld_tests.cpp
  5. +1
    -1
      projects/libhelloworld/CMakeLists.txt
  6. +1
    -0
      projects/libhelloworld/test/CMakeLists.txt
  7. +1
    -2
      projects/libhelloworld/test/libhelloworld/libhelloworld_tests.cpp

+ 1
- 1
projects/helloworld/CMakeLists.txt View File

@@ -20,8 +20,8 @@ EndIf ( )

# Project #########################################################################################

Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/helloworld-var.cmake )
Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/helloworld-options.cmake )
Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/helloworld-var.cmake )
Project ( helloworld
DESCRIPTION "A simple library"
VERSION "${HELLOWORLD_VERSION}" )


+ 1
- 0
projects/helloworld/test/CMakeLists.txt View File

@@ -26,6 +26,7 @@ ForEach ( FILE IN LISTS ISEF_TEST_SOURCE_FILES )
Set ( TEST_NAME "${TEST_DIR}/${TEST_NAME}" )
String ( REPLACE "\\" "-" TEST_NAME "${TEST_NAME}" )
String ( REPLACE "/" "-" TEST_NAME "${TEST_NAME}" )
String ( REPLACE "_" "-" TEST_NAME "${TEST_NAME}" )
Set ( TEST_NAME "test-${TEST_NAME}" )
Add_Executable ( ${TEST_NAME}
EXCLUDE_FROM_ALL


+ 0
- 11
projects/helloworld/test/helloworld/helloworld-tests.cpp View File

@@ -1,11 +0,0 @@
#include <gtest/gtest.h>

#include <helloworld.h>

using namespace ::testing;
using namespace ::helloworld;

TEST(helloworld, getHelloWorldEx)
{
EXPECT_EQ(DummyEx::getHelloWorldEx(), "Hello World!\nThis is a simple executable :)");
}

+ 10
- 0
projects/helloworld/test/helloworld/helloworld_tests.cpp View File

@@ -0,0 +1,10 @@
#include <gtest/gtest.h>

#include <helloworld.h>

using namespace ::testing;
using namespace ::helloworld;

TEST(helloworld_tests, dummy)
{
}

+ 1
- 1
projects/libhelloworld/CMakeLists.txt View File

@@ -20,8 +20,8 @@ EndIf ( )

# Project #########################################################################################

Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/libhelloworld-var.cmake )
Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/libhelloworld-options.cmake )
Include ( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/libhelloworld-var.cmake )
Project ( libhelloworld
DESCRIPTION "A simple library"
VERSION "${LIBHELLOWORLD_VERSION}" )


+ 1
- 0
projects/libhelloworld/test/CMakeLists.txt View File

@@ -26,6 +26,7 @@ ForEach ( FILE IN LISTS ISEF_TEST_SOURCE_FILES )
Set ( TEST_NAME "${TEST_DIR}/${TEST_NAME}" )
String ( REPLACE "\\" "-" TEST_NAME "${TEST_NAME}" )
String ( REPLACE "/" "-" TEST_NAME "${TEST_NAME}" )
String ( REPLACE "_" "-" TEST_NAME "${TEST_NAME}" )
Set ( TEST_NAME "test-${TEST_NAME}" )
Add_Executable ( ${TEST_NAME}
EXCLUDE_FROM_ALL


projects/libhelloworld/test/libhelloworld/libhelloworld-tests.cpp → projects/libhelloworld/test/libhelloworld/libhelloworld_tests.cpp View File

@@ -5,7 +5,6 @@
using namespace ::testing;
using namespace ::libhelloworld;

TEST(libhelloworld, getHelloWorld)
TEST(libhelloworld_tests, dummy)
{
EXPECT_EQ(Dummy::getHelloWorld(), "Hello World!");
}

Loading…
Cancel
Save