Skip to content

Commit

Permalink
[nasa/nos3#176] Created utnos3.h to allow for building of OSAL tests;
Browse files Browse the repository at this point in the history
  • Loading branch information
jlucas9 committed Jun 26, 2024
1 parent 570ad09 commit 5f6ac72
Show file tree
Hide file tree
Showing 27 changed files with 65 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/tests/bin-sem-flush-test/bin-sem-flush-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

void BinSemFlushSetup(void);
void BinSemFlushCheck(void);
void BinSemFlushTeardown(void);
Expand Down
2 changes: 2 additions & 0 deletions src/tests/bin-sem-test/bin-sem-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

/* Define setup and check functions for UT assert */
void BinSemSetup(void);
void BinSemCheck(void);
Expand Down
2 changes: 2 additions & 0 deletions src/tests/bin-sem-timeout-test/bin-sem-timeout-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

/* Define setup and check functions for UT assert */
void BinSemTimeoutSetup(void);
void BinSemTimeoutCheck(void);
Expand Down
2 changes: 2 additions & 0 deletions src/tests/condvar-test/condvar-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

/* Define setup and check functions for UT assert */
void CondVarSetup(void);
void CondVarCheck(void);
Expand Down
2 changes: 2 additions & 0 deletions src/tests/count-sem-test/count-sem-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

/* Define setup and check functions for UT assert */
void CountSemSetup(void);
void CountSemCheck(void);
Expand Down
2 changes: 2 additions & 0 deletions src/tests/count-sem-timeout-test/count-sem-timeout-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

/* Define setup and check functions for UT assert */
void CountSemTimeoutSetup(void);
void CountSemTimeoutCheck(void);
Expand Down
2 changes: 2 additions & 0 deletions src/tests/file-api-test/file-api-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

/* OS Constructs */
void TestMkfsMount(void);
void TestCreatRemove(void);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

/* *************************************** MAIN ************************************** */

void TestFileSysAddFixedMapApi(void)
Expand Down
2 changes: 2 additions & 0 deletions src/tests/idmap-api-test/idmap-api-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

osal_id_t task_id;
osal_id_t queue_id;
osal_id_t count_sem_id;
Expand Down
2 changes: 2 additions & 0 deletions src/tests/mutex-test/mutex-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

/* Define setup and check functions for UT assert */
void MutexSetup(void);
void MutexCheck(void);
Expand Down
2 changes: 2 additions & 0 deletions src/tests/network-api-test/network-api-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

#define UT_EXIT_LOOP_MAX 100

/*
Expand Down
2 changes: 2 additions & 0 deletions src/tests/osal-core-test/osal-core-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

/* Defines */
#define UT_EXIT_LOOP_MAX 100 /* Used to limit wait for self-exiting task to exit */

Expand Down
2 changes: 2 additions & 0 deletions src/tests/queue-test/queue-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

/* Define setup and check functions for UT assert */
void QueueTimeoutSetup(void);
void QueueTimeoutCheck(void);
Expand Down
2 changes: 2 additions & 0 deletions src/tests/select-test/select-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

#define MAX_BUFFER_LOOP 1000000

/*
Expand Down
2 changes: 2 additions & 0 deletions src/tests/sem-speed-test/sem-speed-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

/*
* Note the worker priority must be lower than that of
* the executive (init) task. Otherwise, the SemRun()
Expand Down
2 changes: 2 additions & 0 deletions src/tests/shell-test/shell-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

#define OS_TEST_SHELL_FILENAME "/drive0/shell_test.txt"

const char OS_TEST_SHELL_COMMAND[] = "echo";
Expand Down
2 changes: 2 additions & 0 deletions src/tests/symbol-api-test/symbol-api-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

/* *************************************** MAIN ************************************** */

void TestSymbolApi(void)
Expand Down
2 changes: 2 additions & 0 deletions src/tests/time-base-api-test/time-base-api-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

OS_timebase_prop_t SyncTimeBaseProp;

uint32 NumSyncs = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/tests/timer-add-api-test/timer-add-api-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

#define NUMBER_OF_TIMERS 4
#define TASK_1_STACK_SIZE 4096
#define TASK_1_PRIORITY 101
Expand Down
2 changes: 2 additions & 0 deletions src/tests/timer-test/timer-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include "uttest.h"
#include "utbsp.h"

#include "utnos3.h"

#define NUMBER_OF_TIMERS 5

#define TASK_1_ID 1
Expand Down
1 change: 1 addition & 0 deletions src/unit-tests/oscore-test/ut_oscore_misc_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
**--------------------------------------------------------------------------------*/

#include "ut_oscore_misc_test.h"
#include "utnos3.h"

/*--------------------------------------------------------------------------------*
** Macros
Expand Down
1 change: 1 addition & 0 deletions src/unit-tests/osfile-test/ut_osfile_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
**--------------------------------------------------------------------------------*/

#include "ut_osfile_test.h"
#include "utnos3.h"

/*--------------------------------------------------------------------------------*
** Macros
Expand Down
1 change: 1 addition & 0 deletions src/unit-tests/osfilesys-test/ut_osfilesys_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
**--------------------------------------------------------------------------------*/

#include "ut_osfilesys_test.h"
#include "utnos3.h"

/*--------------------------------------------------------------------------------*
** Macros
Expand Down
1 change: 1 addition & 0 deletions src/unit-tests/osloader-test/ut_osloader_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
**--------------------------------------------------------------------------------*/

#include "ut_osloader_test.h"
#include "utnos3.h"

/*--------------------------------------------------------------------------------*
** Macros
Expand Down
1 change: 1 addition & 0 deletions src/unit-tests/osnetwork-test/ut_osnetwork_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
**--------------------------------------------------------------------------------*/

#include "ut_osnetwork_test.h"
#include "utnos3.h"

/*--------------------------------------------------------------------------------*
** Macros
Expand Down
1 change: 1 addition & 0 deletions src/unit-tests/ostimer-test/ut_ostimer_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
**--------------------------------------------------------------------------------*/

#include "ut_ostimer_test.h"
#include "utnos3.h"

/*--------------------------------------------------------------------------------*
** Macros
Expand Down
19 changes: 19 additions & 0 deletions ut_assert/inc/utnos3.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Additions for NOS3-Linux OSAL support
*/

#ifndef UTTEST_H_NOS3_LINUX
#define UTTEST_H_NOS3_LINUX

#include <pthread.h>
#define NE_Bus int32_t
#define NE_SimTime int32_t

NE_Bus *CFE_PSP_Bus;
int64_t CFE_PSP_ticks_per_second;
pthread_mutex_t CFE_PSP_sim_time_mutex;
NE_SimTime CFE_PSP_sim_time;

void NE_bus_set_time(NE_Bus *bus, NE_SimTime time){return;}

#endif

0 comments on commit 5f6ac72

Please sign in to comment.