Add data structure library test on platform native

This commit is contained in:
George Oikonomou 2017-12-12 23:54:34 +00:00
parent bf44dbe62e
commit 5919f120a5
3 changed files with 42 additions and 0 deletions

View File

@ -31,3 +31,4 @@ env:
- TEST_NAME='compile-nxp-ports'
- TEST_NAME='doxygen'
- TEST_NAME='compile-tools'
- TEST_NAME='native-runs'

View File

@ -0,0 +1,40 @@
#!/bin/bash
# Contiki directory
CONTIKI=$1
# Example code directory
CODE_DIR=$CONTIKI/tests/07-simulation-base/code-data-structures/
CODE=test-data-structures
# Starting Contiki-NG native node
echo "Starting native node"
make -C $CODE_DIR TARGET=native > make.log 2> make.err
$CODE_DIR/$CODE.native > $CODE.log 2> $CODE.err &
CPID=$!
sleep 2
echo "Closing native node"
sleep 2
pgrep $CODE | xargs kill -9
if grep -q "=check-me= FAILED" $CODE.log ; then
echo "==== make.log ====" ; cat make.log;
echo "==== make.err ====" ; cat make.err;
echo "==== $CODE.log ====" ; cat $CODE.log;
echo "==== $CODE.err ====" ; cat $CODE.err;
printf "%-32s TEST FAIL\n" "$CODE" | tee $CODE.testlog;
else
cp $CODE.log $CODE.testlog
printf "%-32s TEST OK\n" "$CODE" | tee $CODE.testlog;
fi
rm make.log
rm make.err
rm $CODE.log
rm $CODE.err
# We do not want Make to stop -> Return 0
# The Makefile will check if a log contains FAIL at the end
exit 0

View File

@ -0,0 +1 @@
include ../Makefile.script-test