Skip to content

Commit

Permalink
Test windows hosted agent (Azure#2017)
Browse files Browse the repository at this point in the history
* Update longhaul.vsts-ci.yml

* Update longhaul.vsts-ci.yml

* Update longhaul.vsts-ci.yml

* Update longhaul.vsts-ci.yml

* Update longhaul.vsts-ci.yml

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update longhaul.vsts-ci.yml

* Update longhaul.vsts-ci.yml

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update build.cmd

* Update .vsts-ci.yml

* Update .vsts-ci.yml

* Update .vsts-ci.yml

* Update .vsts-ci.yml

* Update .vsts-ci.yml

* Update .vsts-ci.yml

* Update .vsts-ci.yml

* Update .vsts-ci.yml

* Update .vsts-ci.yml

* Update .vsts-ci.yml

* Update build.cmd

* Update .vsts-ci.yml

* Update build.cmd

* Update .vsts-ci.yml

* Update longhaul.vsts-ci.yml

* Update iothubtest.c

* Update .vsts-ci.yml

* Update build.cmd

* Update .vsts-ci.yml

* Update .vsts-ci.yml

* Update .vsts-ci.yml

* added amqp debug

* amqp

* update amqp

* add amqp logging

* update amqp branch

* Added CPP wrapper to unit tests

* update cmake min version to 3.5

* fix iothubtransport_mqtt_common_ut  cmake

* fix unit test

* fix cmake script

* fix cmake if statement

* restore iothubmessage_ut static

* run cppunit test only on win32 builds

* move to latest uamqp

* remove debug build cmd
  • Loading branch information
ericwolz authored and Sienna Lloyd committed Aug 16, 2021
1 parent 01036c9 commit 6c455a1
Show file tree
Hide file tree
Showing 176 changed files with 323 additions and 474 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.

cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required (VERSION 3.5)
project(azure_iot_sdks)

include("${CMAKE_CURRENT_LIST_DIR}/configs/azure_iot_sdksFunctions.cmake")
Expand Down Expand Up @@ -74,6 +74,7 @@ option(use_prov_client "Enable provisioning client" OFF)
option(use_tpm_simulator "tpm simulator type of hsm used with the provisioning client" OFF)
option(use_edge_modules "Enable support for running modules against Azure IoT Edge" OFF)
option(use_custom_heap "use externally defined heap functions instead of the malloc family" OFF)
option(use_cppunittest "set use_cppunittest to ON to build CppUnitTest tests on Windows (default is OFF)" OFF)

set(compileOption_C "" CACHE STRING "passes a string to the command line of the C compiler")
set(compileOption_CXX "" CACHE STRING "passes a string to the command line of the C++ compiler")
Expand Down Expand Up @@ -235,7 +236,6 @@ set(original_skip_samples ${skip_samples})
set(run_e2e_tests OFF)
set(run_unittests OFF)
set(skip_samples ON)
set(use_cppunittest OFF)

if (NOT ${use_installed_dependencies})
if (NOT TARGET azure_macro_utils_c AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/deps/azure-macro-utils-c/CMakeLists.txt")
Expand Down
40 changes: 25 additions & 15 deletions build/.vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
displayName: 'build'
- job: windowsx86
pool:
name: 'aziotbld-win03'
name: 'sdk-c--win-vs2017'
steps:
- script: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"
Expand Down Expand Up @@ -62,7 +62,8 @@ jobs:
- job: raspberrypi
variables:
_PREVIEW_VSTS_DOCKER_IMAGE: "aziotbld/raspberrypi-c-buster:brown"
pool: Hosted Ubuntu 1604
pool:
name: 'sdk-c--ubuntu-18'
displayName: raspberrypi
steps:
- script: |
Expand All @@ -78,7 +79,8 @@ jobs:
- job: linuxoptions
variables:
_PREVIEW_VSTS_DOCKER_IMAGE: "aziotbld/vsts-linux-c-ubuntu"
pool: Hosted Ubuntu 1604
pool:
name: 'sdk-c--ubuntu-18'
displayName: 'linux-options'
steps:
- script: 'sudo ./jenkins/linux_c_option_test.sh'
Expand All @@ -89,10 +91,10 @@ jobs:
condition: always()
- job: windowsdynamic
pool:
name: 'aziotbld-win03'
name: 'sdk-c--win-vs2017'
steps:
- script: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat"
call jenkins\windows_c_build_as_dynamic.cmd
displayName: 'build'
env:
Expand Down Expand Up @@ -144,7 +146,8 @@ jobs:
- job: clang
variables:
_PREVIEW_VSTS_DOCKER_IMAGE: "aziotbld/ubuntu-clang"
pool: aziotbld-lin01
pool:
name: 'sdk-c--ubuntu-18'
displayName: 'clang'
steps:
- script: |
Expand Down Expand Up @@ -172,10 +175,11 @@ jobs:
- script: sudo rm -rf $(Agent.BuildDirectory)/*
displayName: 'cleanup'
condition: always()
- job: ubuntu1604
- job: ubuntu2004
variables:
_PREVIEW_VSTS_DOCKER_IMAGE: "aziotbld/linux-c-ubuntu"
pool: aziotbld-lin02
pool:
name: 'sdk-c--ubuntu-18'
displayName: 'ubuntu1604'
steps:
- script: |
Expand Down Expand Up @@ -206,7 +210,8 @@ jobs:
- job: debian
variables:
_PREVIEW_VSTS_DOCKER_IMAGE: "aziotbld/c-debian"
pool: aziotbld-lin02
pool:
name: 'sdk-c--ubuntu-18'
displayName: 'debian'
steps:
- script: |
Expand Down Expand Up @@ -235,7 +240,8 @@ jobs:
- job: linux_installed_deps
variables:
_PREVIEW_VSTS_DOCKER_IMAGE: "aziotbld/linux-c-ubuntu"
pool: aziotbld-lin02
pool:
name: 'sdk-c--ubuntu-18'
displayName: 'linux_installed_deps'
steps:
- script: |
Expand Down Expand Up @@ -266,7 +272,8 @@ jobs:
- job: wolfssl
variables:
_PREVIEW_VSTS_DOCKER_IMAGE: "aziotbld/wolfssl-1804"
pool: Hosted Ubuntu 1604
pool:
name: 'sdk-c--ubuntu-18'
displayName: 'wolfssl'
steps:
- script: |
Expand Down Expand Up @@ -297,7 +304,8 @@ jobs:
- job: bearssl
variables:
_PREVIEW_VSTS_DOCKER_IMAGE: "aziotbld/devops-c-bearssl"
pool: Hosted Ubuntu 1604
pool:
name: 'sdk-c--ubuntu-18'
displayName: 'bearssl'
steps:
- script: |
Expand Down Expand Up @@ -327,7 +335,7 @@ jobs:
condition: always()
- job: windowsx64
pool:
name: 'aziotbld-win03'
name: 'sdk-c--win-vs2017'
displayName: 'windowsx64'
steps:
- script: |
Expand Down Expand Up @@ -396,7 +404,8 @@ jobs:
- job: cares
variables:
_PREVIEW_VSTS_DOCKER_IMAGE: "aziotbld/c-ares"
pool: Hosted Ubuntu 1604
pool:
name: 'sdk-c--ubuntu-18'
displayName: 'cares'
steps:
- script: |
Expand Down Expand Up @@ -425,7 +434,8 @@ jobs:
- job: openssl_engine
variables:
_PREVIEW_VSTS_DOCKER_IMAGE: "aziotbld/openssl-pkcs11"
pool: Hosted Ubuntu 1604
pool:
name: 'sdk-c--ubuntu-18'
displayName: 'OpenSSL with pkcs11 engine and SoftHSM'
steps:
- script: |
Expand Down
4 changes: 2 additions & 2 deletions build/longhaul.vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
variables:
_PREVIEW_VSTS_DOCKER_IMAGE: "aziotbld/linux-c-ubuntu"
pool:
name: 'aziotbld-lin01'
name: 'sdk-c--ubuntu-18'
displayName: 'longhaul_linux'
steps:
- script: |
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
- job: longhaul_windows
timeoutInMinutes: 800
pool:
name: 'aziotbld-win10'
name: 'sdk-c--win-vs2017'
steps:
- script: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"
Expand Down
17 changes: 10 additions & 7 deletions build_all/windows/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ if "%1" equ "--run-e2e-tests" goto arg-run-e2e-tests
if "%1" equ "--run-sfc-tests" goto arg-run-sfc-tests
if "%1" equ "--run-longhaul-tests" goto arg-longhaul-tests
if "%1" equ "--run-unittests" goto arg-run-unittests
if "%1" equ "--use-cppunittests" goto arg-use-cpp-unittests
if "%1" equ "--make_nuget" goto arg-build-nuget
if "%1" equ "--cmake-root" goto arg-cmake-root
if "%1" equ "--no-make" goto arg-no-make
Expand Down Expand Up @@ -99,10 +98,6 @@ goto args-continue
set CMAKE_run_unittests=ON
goto args-continue

:arg-use-cpp-unittests
set CMAKE_use_cppunittests=ON
goto args-continue

:arg-build-nuget
shift
if "%1" equ "" call :usage && exit /b 1
Expand Down Expand Up @@ -160,7 +155,7 @@ pushd %cmake-root%\cmake\%CMAKE_DIR%

if %MAKE_NUGET_PKG% == yes (
echo ***Running CMAKE for Win32***
cmake %build-root% -Drun_longhaul_tests:BOOL=%CMAKE_run_longhaul_tests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Drun_sfc_tests:BOOL=%CMAKE_run_sfc_tests% -Duse_cppunittest:BOOL=%CMAKE_use_cppunittests% -Drun_unittests:BOOL=%CMAKE_run_unittests% -Duse_prov_client:BOOL=%prov_auth% -G "Visual Studio 15 2017" -A Win32 -Duse_edge_modules=%use_edge_modules%
cmake %build-root% -Drun_longhaul_tests:BOOL=%CMAKE_run_longhaul_tests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Drun_sfc_tests:BOOL=%CMAKE_run_sfc_tests% -Duse_cppunittest:BOOL=ON -Drun_unittests:BOOL=%CMAKE_run_unittests% -Duse_prov_client:BOOL=%prov_auth% -G "Visual Studio 15 2017" -A Win32 -Duse_edge_modules=%use_edge_modules%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
popd

Expand Down Expand Up @@ -189,7 +184,7 @@ if %MAKE_NUGET_PKG% == yes (

) else if %build-platform% == x64 (
echo ***Running CMAKE for Win64***
cmake -Drun_longhaul_tests:BOOL=%CMAKE_run_longhaul_tests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Drun_sfc_tests:BOOL=%CMAKE_run_sfc_tests% -Duse_cppunittest:BOOL=%CMAKE_use_cppunittests% -Drun_unittests:BOOL=%CMAKE_run_unittests% %build-root% -Duse_prov_client:BOOL=%prov_auth% -G "Visual Studio 15 2017" -A x64 -Duse_edge_modules=%use_edge_modules%
cmake -Drun_longhaul_tests:BOOL=%CMAKE_run_longhaul_tests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Drun_sfc_tests:BOOL=%CMAKE_run_sfc_tests% -Duse_cppunittest:BOOL=OFF -Drun_unittests:BOOL=%CMAKE_run_unittests% %build-root% -Duse_prov_client:BOOL=%prov_auth% -G "Visual Studio 15 2017" -A x64 -Duse_edge_modules=%use_edge_modules%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
) else if %build-platform% == arm (
echo ***Running CMAKE for ARM***
Expand All @@ -201,6 +196,14 @@ if %MAKE_NUGET_PKG% == yes (
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
)

echo ***checking msbuild***
where /q msbuild
IF ERRORLEVEL 1 (
echo ***setting VC paths***
IF EXIST "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsMSBuildCmd.bat" call "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsMSBuildCmd.bat"
)
where msbuild

if %MAKE_NUGET_PKG% == yes (
if %make%==yes (
echo ***Building all configurations***
Expand Down
13 changes: 13 additions & 0 deletions configs/azure_iot_sdksFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,16 @@ function(setSdkTargetBuildProperties stbp_target)
set_target_properties(${stbp_target} PROPERTIES XCODE_ATTRIBUTE_GCC_WARN_UNUSED_VARIABLE "YES")
endif()
endfunction()

macro(generate_cppunittest_wrapper whatIsBuilding)
if (${use_cppunittest} AND WIN32)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${whatIsBuilding}.cxx "#include \"${CMAKE_CURRENT_SOURCE_DIR}/${whatIsBuilding}.c\"")
set(${whatIsBuilding}_test_files ${CMAKE_CURRENT_BINARY_DIR}/${whatIsBuilding}.cxx)
#CPP compiler on windows likes to complain about unused local function removed (C4505)
#C compiler doesn't like to complain about the same thing
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4505")
else()
set(${whatIsBuilding}_test_files ${whatIsBuilding}.c)
endif()
endmacro(generate_cppunittest_wrapper)

2 changes: 1 addition & 1 deletion iothub_client/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Copyright (c) Microsoft. All rights reserved.
#Licensed under the MIT license. See LICENSE file in the project root for full license information.

cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required (VERSION 3.5)
#this is CMakeLists for iothub_client

if(POLICY CMP0042)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Copyright (c) Microsoft. All rights reserved.
#Licensed under the MIT license. See LICENSE file in the project root for full license information.

cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required (VERSION 3.5)

set(shared_util_base_path ../../../../c-utility)
set(mbed_project_base "iothub_amqp_transport" CACHE STRING "The item being built")
Expand Down
2 changes: 1 addition & 1 deletion iothub_client/build/iothub_client/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Copyright (c) Microsoft. All rights reserved.
#Licensed under the MIT license. See LICENSE file in the project root for full license information.

cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required (VERSION 3.5)

set(shared_util_base_path ../../../../c-utility)
set(mbed_project_base "iothub_client" CACHE STRING "The item being built")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Copyright (c) Microsoft. All rights reserved.
#Licensed under the MIT license. See LICENSE file in the project root for full license information.

cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required (VERSION 3.5)

set(shared_util_base_path ../../../../c-utility)
set(mbed_project_base "iothub_http_transport" CACHE STRING "The item being built")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Copyright (c) Microsoft. All rights reserved.
#Licensed under the MIT license. See LICENSE file in the project root for full license information.

cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required (VERSION 3.5)

set(shared_util_base_path ../../../../c-utility)
set(mbed_project_base "iothub_mqtt_transport" CACHE STRING "The item being built")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Option(edison "set edison to ON to build the DM edison sample" OFF)

cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required (VERSION 3.5)

project(iothub_client_sample_firmware_update)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#Licensed under the MIT license. See LICENSE file in the project root for full license information.

#this is CMakeLists.txt for iothub_client_sample_mqtt_dm
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required (VERSION 3.5)

compileAsC99()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#Licensed under the MIT license. See LICENSE file in the project root for full license information.

#this is CMakeLists.txt for iothub_client_sample_upload_to_blob
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required (VERSION 3.5)

if(WIN32)
message(FATAL_ERROR "This CMake file is only support Linux builds!")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Copyright (c) Microsoft. All rights reserved.
#Licensed under the MIT license. See LICENSE file in the project root for full license information.

cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required (VERSION 3.5)

set(shared_util_base_path ../../../../c-utility)
set(mbed_project_base "iothub_client_sample_upload_to_blob" CACHE STRING "The item being built")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#Licensed under the MIT license. See LICENSE file in the project root for full license information.

#this is CMakeLists.txt for iothub_client_sample_upload_to_blob_mb
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required (VERSION 3.5)

if(WIN32)
message(FATAL_ERROR "This CMake file is only support Linux builds!")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Copyright (c) Microsoft. All rights reserved.
#Licensed under the MIT license. See LICENSE file in the project root for full license information.

cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required (VERSION 3.5)

set(shared_util_base_path ../../../../c-utility)
set(mbed_project_base "iothub_client_sample_upload_to_blob_mb" CACHE STRING "The item being built")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#Licensed under the MIT license. See LICENSE file in the project root for full license information.

#this is CMakeLists.txt for iothub_ll_c2d_sample
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required (VERSION 3.5)

if(WIN32)
message(FATAL_ERROR "This CMake file is only support Linux builds!")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Copyright (c) Microsoft. All rights reserved.
#Licensed under the MIT license. See LICENSE file in the project root for full license information.

cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required (VERSION 3.5)

set(shared_util_base_path ../../../../c-utility)
set(mbed_project_base "iothub_ll_c2d_sample" CACHE STRING "The item being built")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#Licensed under the MIT license. See LICENSE file in the project root for full license information.

#this is CMakeLists.txt for iothub_ll_client_sample_amqp_shared
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required (VERSION 3.5)

if(WIN32)
message(FATAL_ERROR "This CMake file is only support Linux builds!")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Copyright (c) Microsoft. All rights reserved.
#Licensed under the MIT license. See LICENSE file in the project root for full license information.

cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required (VERSION 3.5)

set(shared_util_base_path ../../../../azure-c-shared-utility)
set(mbed_project_base "iothub_client_sample_amqp" CACHE STRING "The item being built")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#Licensed under the MIT license. See LICENSE file in the project root for full license information.

#this is CMakeLists.txt for iothub_client_x509_sample
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required (VERSION 3.5)

if(WIN32)
message(FATAL_ERROR "This CMake file is only support Linux builds!")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Copyright (c) Microsoft. All rights reserved.
#Licensed under the MIT license. See LICENSE file in the project root for full license information.

cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required (VERSION 3.5)

set(shared_util_base_path ../../../../c-utility)
set(mbed_project_base "iothub_ll_client_x509_sample" CACHE STRING "The item being built")
Expand Down
Loading

0 comments on commit 6c455a1

Please sign in to comment.