Mod aaa-12 更新CMake配置

RCA:
SOL:
修改人:huangxin
检视人:huangxin
This commit is contained in:
huangxin 2019-11-29 17:09:09 +08:00
parent fa4503ca12
commit d85a60308e
2 changed files with 6 additions and 11 deletions

View File

@ -37,12 +37,6 @@ AUX_SOURCE_DIRECTORY(./test TEST_SRC)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
# Now simply link against gtest or gtest_main as needed. Eg
add_executable(ztp_unit ${TEST_SRC})
#if(ZTP_LIBRARY_FOUND)
target_link_libraries(ztp_unit ${ZTP_LIBRARY} ztp gtest_main)
#else()
#target_link_libraries(ztp_unit gtest_main ztp)
#endif()
add_test(NAME ztp_unit_test COMMAND ztp_unit)
ADD_EXECUTABLE(ztp_unit ${TEST_SRC})
TARGET_LINK_LIBRARIES(ztp_unit ${ZTP_LIBRARY} ztp gtest_main)
ADD_TEST(NAME ztp_unit_test COMMAND ztp_unit)

View File

@ -2,10 +2,11 @@
// Created by xajhu on 2019/11/29 0029.
//
#include "gtest/gtest.h"
#include <iostream>
using namespace std;
#include "gtest/gtest.h"
extern "C" {
#include "json_interface.h"
}
@ -28,7 +29,7 @@ TEST(json_encode_test, retOK)
ASSERT_EQ(0,ret);
}
int main(int argc, char** argv)
auto main(int argc, char* argv[]) -> int
{
int ret;