summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Kutsan <akutsan@luxoft.com>2017-03-03 12:02:50 +0200
committerAlex Kutsan <akutsan@luxoft.com>2017-03-03 12:02:50 +0200
commitf36b3b0a9ad26ae6cd98b380fe956b34f5faebf3 (patch)
treef88691c7efd4bf12519897c18aefe2cdd99fa606
parenta64d17bdf8988b1c88a9d5b32a625a9812c3135a (diff)
downloadsdl_core-f36b3b0a9ad26ae6cd98b380fe956b34f5faebf3.tar.gz
Improve a bit code of test scripts build
moved redundant namespace in local scope Added test main to list of sources
-rw-r--r--src/components/test_main.cc2
-rw-r--r--tools/cmake/helpers/sources.cmake3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/components/test_main.cc b/src/components/test_main.cc
index 66013d78c4..72c90acb5c 100644
--- a/src/components/test_main.cc
+++ b/src/components/test_main.cc
@@ -1,8 +1,8 @@
#include "gmock/gmock.h"
#include "utils/logger.h"
#include "utils/custom_string.h"
-namespace custom_str = utils::custom_string;
int main(int argc, char** argv) {
+ namespace custom_str = utils::custom_string;
testing::InitGoogleMock(&argc, argv);
::testing::DefaultValue<custom_str::CustomString>::Set(
custom_str::CustomString(""));
diff --git a/tools/cmake/helpers/sources.cmake b/tools/cmake/helpers/sources.cmake
index 0315b905d9..657197eaac 100644
--- a/tools/cmake/helpers/sources.cmake
+++ b/tools/cmake/helpers/sources.cmake
@@ -143,10 +143,11 @@ function(create_test NAME SOURCES LIBS)
endfunction()
function(create_cotired_test NAME SOURCES LIBS)
+ list(APPEND SOURCES
+ ${CMAKE_SOURCE_DIR}/src/components/test_main.cc)
add_executable(
${NAME}
EXCLUDE_FROM_ALL
- ${CMAKE_SOURCE_DIR}/src/components/test_main.cc
${SOURCES}
)
# TODO: Fix problems with Cotire on Windows and Qt APPLINK-28060