Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor OSAL C library stubs #319

Merged
merged 2 commits into from
Dec 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions src/unit-test-coverage/portable/coveragetest-posixfile.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* Copyright (c) 2019, United States government as represented by the
* administrator of the National Aeronautics Space Administration.
* All rights reserved. This software was created at NASA Goddard
* Space Flight Center pursuant to government contracts.
*
* This is governed by the NASA Open Source Agreement and may be used,
* distributed and modified only according to the terms of that agreement.
*/

/*
* Filename: osapi_testcase_common.c
*
Expand All @@ -21,11 +31,11 @@

#include "ut-osfileapi.h"

#include <overrides/stdio.h>
#include <overrides/stdlib.h>
#include <overrides/unistd.h>
#include <overrides/fcntl.h>
#include <overrides/sys/stat.h>
#include <OCS_stdio.h>
#include <OCS_stdlib.h>
#include <OCS_unistd.h>
#include <OCS_fcntl.h>
#include <OCS_stat.h>

#define OSAPI_TEST_FUNCTION_RC(func,exp) \
{ \
Expand Down
12 changes: 11 additions & 1 deletion src/unit-test-coverage/portable/coveragetest-posixgettime.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* Copyright (c) 2019, United States government as represented by the
* administrator of the National Aeronautics Space Administration.
* All rights reserved. This software was created at NASA Goddard
* Space Flight Center pursuant to government contracts.
*
* This is governed by the NASA Open Source Agreement and may be used,
* distributed and modified only according to the terms of that agreement.
*/

/*
* Filename: osapi_testcase_common.c
*
Expand All @@ -19,7 +29,7 @@
#include <osapi.h>
#include <os-impl.h>

#include <overrides/time.h>
#include <OCS_time.h>

#define OSAPI_TEST_FUNCTION_RC(func,exp) \
{ \
Expand Down
18 changes: 14 additions & 4 deletions src/unit-test-coverage/portable/coveragetest-posixio.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* Copyright (c) 2019, United States government as represented by the
* administrator of the National Aeronautics Space Administration.
* All rights reserved. This software was created at NASA Goddard
* Space Flight Center pursuant to government contracts.
*
* This is governed by the NASA Open Source Agreement and may be used,
* distributed and modified only according to the terms of that agreement.
*/

/*
* Filename: osapi_testcase_common.c
*
Expand All @@ -19,10 +29,10 @@
#include <osapi.h>
#include <os-impl.h>

#include <overrides/stdlib.h>
#include <overrides/unistd.h>
#include <overrides/fcntl.h>
#include <overrides/errno.h>
#include <OCS_stdlib.h>
#include <OCS_unistd.h>
#include <OCS_fcntl.h>
#include <OCS_errno.h>

#include "ut-osfileapi.h"

Expand Down
15 changes: 13 additions & 2 deletions src/unit-test-coverage/posix/modules/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
#
# Copyright (c) 2019, United States government as represented by the
# administrator of the National Aeronautics Space Administration.
# All rights reserved. This software was created at NASA Goddard
# Space Flight Center pursuant to government contracts.
#
# This is governed by the NASA Open Source Agreement and may be used,
# distributed and modified only according to the terms of that agreement.
#

# --------------------------------------
# OSAL SHARED LAYER FOR COVERAGE TESTING
# --------------------------------------
Expand All @@ -12,7 +22,8 @@
# - UT_C_FLAGS are enabled to include any code coverage instrumentation

# the "overrides" dir contains empty versions of the C-library include files.
include_directories(BEFORE ${OSALCOVERAGE_SOURCE_DIR}/ut-stubs/inc/overrides)
include_directories(${OSALCOVERAGE_SOURCE_DIR}/ut-stubs/inc)
include_directories(${OSALCOVERAGE_SOURCE_DIR}/ut-stubs/override_inc)

foreach(MODULE ${MODULE_LIST})
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/ut-${MODULE}.c)
Expand All @@ -21,4 +32,4 @@ foreach(MODULE ${MODULE_LIST})
endif ()
endforeach()



251 changes: 0 additions & 251 deletions src/unit-test-coverage/posix/modules/src/stub-map-to-real.h

This file was deleted.

11 changes: 10 additions & 1 deletion src/unit-test-coverage/posix/modules/src/ut-osapi.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
/*
* Copyright (c) 2019, United States government as represented by the
* administrator of the National Aeronautics Space Administration.
* All rights reserved. This software was created at NASA Goddard
* Space Flight Center pursuant to government contracts.
*
* This is governed by the NASA Open Source Agreement and may be used,
* distributed and modified only according to the terms of that agreement.
*/

/* pull in the OSAL configuration */
#include "stub-map-to-real.h"
#include "osconfig.h"

/*
Expand Down
Loading