Change the Test submodules to be more efficient (#46)

This commit is contained in:
Jelani Brandon 2019-04-05 15:05:26 -07:00 коммит произвёл GitHub
Родитель 7c23f61a6d
Коммит 92e208fa8c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
11 изменённых файлов: 36 добавлений и 63 удалений

2
.gitignore поставляемый
Просмотреть файл

@ -8,4 +8,4 @@
/devdoc/~$o_requirements.docm
*.jar
/.vscode/*
/.vscode/*

10
.gitmodules поставляемый
Просмотреть файл

@ -4,12 +4,12 @@
[submodule "deps/azure-macro-utils-c"]
path = deps/azure-macro-utils-c
url = https://github.com/Azure/azure-macro-utils-c.git
[submodule "deps/azure-ctest"]
path = deps/azure-ctest
url = https://github.com/Azure/azure-ctest.git
[submodule "deps/azure-c-testrunnerswitcher"]
path = deps/azure-c-testrunnerswitcher
[submodule "deps/testrunnerswitcher"]
path = deps/testrunnerswitcher
url = https://github.com/Azure/azure-c-testrunnerswitcher.git
[submodule "deps/ctest"]
path = deps/ctest
url = https://github.com/Azure/azure-ctest.git
[submodule "deps/umock-c"]
path = deps/umock-c
url = https://github.com/Azure/umock-c.git

Просмотреть файл

@ -20,8 +20,8 @@ option(run_e2e_tests "set run_e2e_tests to ON to run e2e tests (default is OFF)"
option(skip_samples "set skip_samples to ON to skip building samples (default is OFF)[if possible, they are always built]" OFF)
option(use_installed_dependencies "set use_installed_dependencies to ON to use installed packages instead of building dependencies from submodules" OFF)
option(use_custom_heap "use externally defined heap functions instead of the malloc family" OFF)
option(no_logging "disable logging" OFF)
option(enable_raw_logging "Enables the ability to add raw logging" OFF)
option(no_logging "disable logging" OFF)
option(enable_raw_logging "Enables the ability to add raw logging" OFF)
if(${use_custom_heap})
add_definitions(-DGB_USE_CUSTOM_HEAP)
@ -33,11 +33,9 @@ endif ()
#do not add or build any tests of the dependencies
set(original_run_e2e_tests ${run_e2e_tests})
set(original_run_int_tests ${run_int_tests})
set(original_run_unittests ${run_unittests})
set(run_e2e_tests OFF)
set(run_int_tests OFF)
set(run_unittests OFF)
if(NOT ${use_installed_dependencies})
@ -47,33 +45,30 @@ if(NOT ${use_installed_dependencies})
if(${original_run_e2e_tests} OR ${original_run_unittests})
if (NOT TARGET testrunnerswitcher)
add_subdirectory(deps/azure-c-testrunnerswitcher)
add_subdirectory(deps/testrunnerswitcher)
endif()
if (NOT TARGET ctest)
add_subdirectory(deps/azure-ctest)
add_subdirectory(deps/ctest)
endif()
if (NOT TARGET umock_c)
add_subdirectory(deps/umock-c)
endif()
enable_testing()
endif()
if (NOT TARGET aziotsharedutil)
add_subdirectory(deps/c-utility)
# Include the common build rules for C shared utility
if(${use_installed_dependencies})
include(deps/c-utility/configs/azure_iot_build_rules.cmake)
else()
include(${SHARED_UTIL_FOLDER}/configs/azure_iot_build_rules.cmake)
endif()
endif()
endif()
include("dependencies.cmake")
# Include the common build rules for C shared utility
if(${use_installed_dependencies})
include(deps/c-utility/configs/azure_iot_build_rules.cmake)
else()
include(${SHARED_UTIL_FOLDER}/configs/azure_iot_build_rules.cmake)
endif()
set_platform_files(${SHARED_UTIL_FOLDER})
set(run_e2e_tests ${original_run_e2e_tests})
set(run_int_tests ${original_run_int_tests})
set(run_unittests ${original_run_unittests})
#these are the C source files
@ -133,7 +128,6 @@ if (NOT ${ARCHITECTURE} STREQUAL "ARM")
endif ()
if (${run_unittests})
include("dependencies-test.cmake")
add_subdirectory(tests)
endif ()

Просмотреть файл

@ -1,14 +0,0 @@
#Copyright (c) Microsoft. All rights reserved.
#Licensed under the MIT license. See LICENSE file in the project root for full license information.
if(${use_installed_dependencies})
#These need to be set for the functions included by c-utility
if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/c-utility/src")
message(FATAL_ERROR "c-utility directory is empty. Please pull in all submodules if building unit tests.")
endif()
set(SHARED_UTIL_SRC_FOLDER "${CMAKE_CURRENT_LIST_DIR}/c-utility/src")
set(SHARED_UTIL_FOLDER "${CMAKE_CURRENT_LIST_DIR}/c-utility")
set(SHARED_UTIL_ADAPTER_FOLDER "${CMAKE_CURRENT_LIST_DIR}/c-utility/adapters")
set_platform_files("${CMAKE_CURRENT_LIST_DIR}/c-utility")
find_package(umock_c REQUIRED CONFIG)
endif()

Просмотреть файл

@ -1,6 +0,0 @@
#Copyright (c) Microsoft. All rights reserved.
#Licensed under the MIT license. See LICENSE file in the project root for full license information.
if (${use_installed_dependencies})
find_package(azure_c_shared_utility REQUIRED CONFIG)
endif ()

2
deps/azure-macro-utils-c поставляемый

@ -1 +1 @@
Subproject commit d0f4a05610537570380fc901adadfe6971c30376
Subproject commit afdb11395921711664af48174d072be048608183

2
deps/c-utility поставляемый

@ -1 +1 @@
Subproject commit 8ff753b61fb614df5f682e9d98edaee09ca749d0
Subproject commit 16ac17847814df15894aa4e6e8604989ef5cd360

0
deps/azure-ctest → deps/ctest поставляемый
Просмотреть файл

Просмотреть файл

2
deps/umock-c поставляемый

@ -1 +1 @@
Subproject commit 8822033b36b75e1285d0611813e7e3eba17086f2
Subproject commit ba229c48eecb537ba37dea8d67cf6617f9f4edc7

Просмотреть файл

@ -7,7 +7,7 @@ azure-umqtt-c is a general purpose library build for MQTT protocol
## Dependencies
azure-mqtt client use the azure-c-shared-utility, which is a C library provisioning common functionality for basic tasks (like string, list manipulation, IO, etc.).
azure-c-shared-utility is available here: https://github.com/Azure/azure-c-shared-utility.
azure-c-shared-utility is available here: <https://github.com/Azure/azure-c-shared-utility.>
azure-c-shared-utility needs to be built before building azure-mqtt-c.
## Setup
@ -16,49 +16,48 @@ azure-c-shared-utility needs to be built before building azure-mqtt-c.
- Clone azure-umqtt-c by:
```
git clone --recursive https://github.com/Azure/azure-umqtt-c.git
```Shell
git clone https://github.com/Azure/azure-umqtt-c.git
cd azure-umqtt-c
git submodule update --init
```
- Create a folder cmake under azure-umqtt-c
- Switch to the cmake folder and run
```
```Shell
cmake ..
```
- Build
- Build
```
```Shell
cmake --build .
```
### Installation and Use
Optionally, you may choose to install azure-umqtt-c on your machine:
1. Switch to the *cmake* folder and run
```
```Shell
cmake -Duse_installed=ON ../
```
```
cmake --build . --target install
```
or install using the follow commands for each platform:
On Linux:
```
```Shell
sudo make install
```
On Windows:
```
msbuild /m INSTALL.vcxproj
```
2. Use it in your project (if installed)
```
```Shell
find_package(umqtt REQUIRED CONFIG)
target_link_library(yourlib umqtt)
```
@ -71,6 +70,6 @@ _If running tests, this requires that umock-c, azure-ctest, and azure-c-testrunn
In order to build the tests use:
```
```Shell
cmake .. -Drun_unittests:bool=ON
```