Skip to content

Commit

Permalink
Merge pull request #347 from #176-unit-tests
Browse files Browse the repository at this point in the history
[#176] Basic unit tests
  • Loading branch information
jlucas9 authored Aug 6, 2024
2 parents 874e016 + 354cbcd commit 1c0de00
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ build
support/nos3_install.log
tmp
core.*
.cdskeyfile
.reservedkeyfile
.resetkeyfile
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ build-sim:
cd $(SIMBUILDDIR) && cmake -DCMAKE_INSTALL_PREFIX=$(SIMBUILDDIR) ..
$(MAKE) --no-print-directory -C $(SIMBUILDDIR) install

build-test:
mkdir -p $(FSWBUILDDIR)
cd $(FSWBUILDDIR) && cmake $(PREP_OPTS) -DENABLE_UNIT_TESTS=true ../cfe
$(MAKE) --no-print-directory -C $(FSWBUILDDIR) mission-install

checkout:
./scripts/docker_checkout.sh

Expand Down Expand Up @@ -118,5 +123,8 @@ stop:
stop-gsw:
./scripts/stop_gsw.sh

test-fsw:
cd $(FSWBUILDDIR)/amd64-posix/default_cpu1 && ctest -O ctest.log

igniter:
./scripts/igniter_launch.sh
6 changes: 5 additions & 1 deletion cfg/nos3_defs/targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ SET(MISSION_CPUNAMES cpu1)
SET(cpu1_PROCESSORID 1)
SET(cpu1_APPLIST) # Note: Using all ${MISSION_GLOBAL_APPLIST} automatically
SET(cpu1_FILELIST cfe_es_startup.scr)
SET(cpu1_SYSTEM amd64-linux-gnu)
if (ENABLE_UNIT_TESTS)
SET(cpu1_SYSTEM amd64-posix)
else()
SET(cpu1_SYSTEM amd64-nos3)
endif()

# USER Supplied
#SET(cpu2_PROCESSORID 2)
Expand Down
File renamed without changes.
34 changes: 34 additions & 0 deletions cfg/nos3_defs/toolchain-amd64-posix.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This example toolchain file describes the cross compiler to use for
# the target architecture indicated in the configuration file.

# Basic cross system configuration
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_SYSTEM_PROCESSOR amd64)

# Specify the cross compiler executables
# Typically these would be installed in a home directory or somewhere
# in /opt. However in this example the system compiler is used.
SET(CMAKE_C_COMPILER "/usr/bin/gcc")
SET(CMAKE_CXX_COMPILER "/usr/bin/g++")

# Configure the find commands
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)

# These variable settings are specific to cFE/OSAL and determines which
# abstraction layers are built when using this toolchain
SET(CFE_SYSTEM_PSPNAME "pc-linux")
SET(OSAL_SYSTEM_OSTYPE "posix")

#SET(CMAKE_C_FLAGS_INIT "" CACHE STRING "C Flags required by platform")
#SET(CMAKE_SHARED_LINKER_FLAGS "-pg")

# Build Specific
add_definitions(-DBYTE_ORDER_LE)
add_definitions(-D_LINUX_OS_)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

set(CI_TRANSPORT udp_tf)
set(TO_TRANSPORT udp) # Note udp_tf used for Transfer Frames required for CryptoLib
2 changes: 1 addition & 1 deletion fsw/apps/sc
Submodule sc updated 1 files
+309 −309 unit-test/sc_cmds_tests.c
2 changes: 1 addition & 1 deletion fsw/psp
Submodule psp updated 0 files
2 changes: 1 addition & 1 deletion scripts/docker_debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $SCRIPT_DIR/env.sh

mkdir -p $BASE_DIR/fsw/build
$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR -v $USER_NOS3_DIR:$USER_NOS3_DIR -w $BASE_DIR --name "nos3_debug" $DBOX bash
$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR -v $USER_NOS3_DIR:$USER_NOS3_DIR -w $BASE_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice --name "nos3_debug" $DBOX bash

0 comments on commit 1c0de00

Please sign in to comment.