Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
* Initial baseline for ECI code

Changes from repo start:
* Add Travis CI pipeline to run unit tests and verify example apps build
* Added checksum to event msgs
* Updated macro names to remove last traces of SIL naming convention
* Renamed macros to standardize naming (see issue #3)
* Updated documentation to add into on getting started using examples
  • Loading branch information
SpaceSteve121 authored Jul 24, 2019
1 parent 5e23227 commit 259f1a4
Show file tree
Hide file tree
Showing 95 changed files with 15,337 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*.mex*
*.slxc
.DS_Store

*.gcda
*.gcno
*.o
*.out
*.exe

cFE/
*.gcov

.*keyfile
36 changes: 35 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,38 @@ compiler: gcc
# build all branches
branches:
only:
- /.*/
- /.*/

stages:
- build
- test

before_install:
# needed for compiling 32bit software on 64bit machine
- sudo apt-get install gcc-multilib

jobs:
include:
- stage: build
name: "BuildSimpleExample"
script: . ./ci/buildSimpleExample.sh
- stage: build
name: "BuildSGP4Example"
script: . ./ci/buildSGP4Example.sh
- stage: test
name: "RunECIUnitTest"
script: . ./ci/runECIUnitTest.sh
- stage: test
name: "runSGP4UnitTest"
script: . ./ci/runSGP4UnitTest.sh

before_script:
# Fetch CFE
- . ./ci/fetchCFE.sh

notifications:
email:
recipients:
- steven.lentine@nasa.gov
on_success: change
on_failure: always
42 changes: 42 additions & 0 deletions ci/buildSGP4Example.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash

# intended to be run from root of repo

# enable exit on error when in CI environment
if [[ "$CI" == true ]]; then
set -e
fi

# copy app files to CFS apps dir
mkdir ./cFE/apps/op
cp -r ./examples/sgp4Prop/* ./cFE/apps/op/
# copy eci source code to CFS apps dir
mkdir ./cFE/apps/eci
mkdir ./cFE/apps/eci/fsw
cp -r ./fsw/* ./cFE/apps/eci/fsw/
# debugging
ls ./cFE/apps/op/
# setup environment for compiling
cd ./cFE

# make any code changes needed to integrate this app
# ensure CFS builds new app we added
sed -i '44a THE_APPS += op' ./build/cpu1/Makefile
sed -i '50a THE_TBLS += op' ./build/cpu1/Makefile
# configure the app to run when CFS starts
sed -i '5a CFE_APP, /cf/apps/op.so, model_AppMain, OP_APP, 90, 8192, 0x0, 0;' ./build/cpu1/exe/cfe_es_startup.scr
sed -i '26a #include "op_app_msgids.h"' ./apps/sch_lab/fsw/platform_inc/sch_lab_sched_tab.h
sed -i '74a { OP_TICK_MID, 1, 0 },' ./apps/sch_lab/fsw/platform_inc/sch_lab_sched_tab.h
# update makefile to include math library
sed -i '42s/.*/\t$(COMPILER) -m32 -shared -o $@ $(OBJS) -lm/' ./psp/fsw/pc-linux/make/link-rules.mak
# Note: this should be a temporary fix until its determined how to
# add a library via a supported mechanism

# prepare environment
. ./setvars.sh
cd ./build/cpu1

# compile
make clean
make config
make
27 changes: 27 additions & 0 deletions ci/buildSimpleExample.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

# intended to be run from root of repo

# enable exit on error when in CI environment
if [[ "$CI" == true ]]; then
set -e
fi

# copy app files to CFS apps dir
mkdir ./cFE/apps/simpleECIApp
cp -r ./examples/simpleECIApp/* ./cFE/apps/simpleECIApp/
# copy eci source code to CFS apps dir
mkdir ./cFE/apps/eci
mkdir ./cFE/apps/eci/fsw
cp -r ./fsw/* ./cFE/apps/eci/fsw/
# setup environment for compiling
cd ./cFE
. ./setvars.sh
cd ./build/cpu1
# ensure CFS builds new app we added
sed -i '44a THE_APPS += simpleECIApp' Makefile
sed -i '50a THE_TBLS += simpleECIApp' Makefile
# compile
make clean
make config
make
18 changes: 18 additions & 0 deletions ci/fetchCFE.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# intended to be run from root of repo and will end at root of repo
pwd
rm -rf ./cFE
git clone https://github.com/nasa/cFE ./cFE
cd cFE
# Reset to cFE 6.5
git reset --hard f26967b80cf3654575c35164b73004c3fc9d84ff
# get OSAL (needed for common_types.h)
git submodule init osal/
git submodule init apps/cfs_lib/
git submodule update
sed -i.bak 's/\r$//' ./setvars.sh
# fix UT assert errors
sed -i '481s/.*/int32 CFE_ES_PoolCreate(CFE_ES_MemHandle_t *HandlePtr, uint8 *MemPtr, uint32 Size)/' tools/ut_assert/src/ut_cfe_es_stubs.c
sed -i '489s/.*/return(Ut_CFE_ES_HookTable.CFE_ES_PoolCreate((uint32*)HandlePtr, MemPtr, Size));/' tools/ut_assert/src/ut_cfe_es_stubs.c
sed -i '494s/.*/int32 CFE_ES_PoolCreateEx(CFE_ES_MemHandle_t *HandlePtr, uint8 *MemPtr, uint32 Size, uint32 NumBlockSizes, uint32 *BlockSizes, uint16 UseMutex)/' tools/ut_assert/src/ut_cfe_es_stubs.c
sed -i '502s/.*/return(Ut_CFE_ES_HookTable.CFE_ES_PoolCreateEx((uint32*)HandlePtr, MemPtr, Size, NumBlockSizes, BlockSizes, UseMutex));/' tools/ut_assert/src/ut_cfe_es_stubs.c
cd ../
19 changes: 19 additions & 0 deletions ci/runECIUnitTest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

# intended to be run from root of repo

# enable exit on error when in CI environment
if [[ "$CI" == true ]]; then
set -e
fi

# setup environment for compiling
cd ./cFE
. ./setvars.sh
# compile
cd ../unit_test
make clean
make all
# run tests
make run
make gcov
19 changes: 19 additions & 0 deletions ci/runSGP4UnitTest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

# intended to be run from root of repo

# enable exit on error when in CI environment
if [[ "$CI" == true ]]; then
set -e
fi

# setup environment for compiling
cd ./cFE
. ./setvars.sh
# compile
cd ../examples/sgp4Prop/unit_test
make clean
make all
# run tests
make run
make gcov
Loading

0 comments on commit 259f1a4

Please sign in to comment.