зеркало из https://github.com/Azure/c-pal.git
added reals_linux, ignored vscode
This commit is contained in:
Родитель
ad0b3b477c
Коммит
7eec538e3c
|
@ -51,4 +51,5 @@ Module.symvers
|
|||
Mkfile.old
|
||||
dkms.conf
|
||||
|
||||
cmake*/
|
||||
cmake*/
|
||||
.vscode/
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
#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)
|
||||
|
||||
set(reals_linux_c_files
|
||||
real_threadapi_linux.c
|
||||
)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_LIST_DIR}/../../src)
|
||||
add_library(reals_linux ${reals_linux_c_files})
|
||||
target_link_libraries(reals_linux reals_interface)
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
#define GBALLOC_H
|
||||
|
||||
#include "real_threadapi_renames.h"
|
||||
|
||||
#include "threadapi_pthreads.c"
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
#Copyright (c) Microsoft. All rights reserved.
|
||||
#Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
set(theseTestsName reals_linux_ut)
|
||||
|
||||
set(${theseTestsName}_test_files
|
||||
${theseTestsName}.c
|
||||
)
|
||||
|
||||
build_c_tests(${theseTestsName} ON "tests/azure_c_pal/linux" ADDITIONAL_LIBS pal_linux reals_linux)
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
#include <stddef.h>
|
||||
#include "testrunnerswitcher.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
size_t failedTestCount = 0;
|
||||
RUN_TEST_SUITE(reals_linux_ut, failedTestCount);
|
||||
return failedTestCount;
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
#include "testrunnerswitcher.h"
|
||||
|
||||
#define REGISTER_GLOBAL_MOCK_HOOK(original, real) \
|
||||
(original == real) ? (void)0 : (void)1;
|
||||
|
||||
#include "threadapi.h"
|
||||
|
||||
#include "real_threadapi.h"
|
||||
|
||||
BEGIN_TEST_SUITE(reals_linux_ut)
|
||||
|
||||
// this test makes sure that the mappings work
|
||||
// (there is a real_ function corresponding to the original)
|
||||
TEST_FUNCTION(check_all_c_pal_reals)
|
||||
{
|
||||
// arrange
|
||||
|
||||
// act
|
||||
REGISTER_THREADAPI_GLOBAL_MOCK_HOOK();
|
||||
|
||||
// assert
|
||||
// no explicit assert, if it builds it works
|
||||
}
|
||||
|
||||
END_TEST_SUITE(reals_linux_ut)
|
Загрузка…
Ссылка в новой задаче