Add data structure library test on platform native
This commit is contained in:
parent
bf44dbe62e
commit
5919f120a5
@ -31,3 +31,4 @@ env:
|
||||
- TEST_NAME='compile-nxp-ports'
|
||||
- TEST_NAME='doxygen'
|
||||
- TEST_NAME='compile-tools'
|
||||
- TEST_NAME='native-runs'
|
||||
|
40
tests/08-native-runs/01-test-data-structures.sh
Executable file
40
tests/08-native-runs/01-test-data-structures.sh
Executable 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
|
1
tests/08-native-runs/Makefile
Normal file
1
tests/08-native-runs/Makefile
Normal file
@ -0,0 +1 @@
|
||||
include ../Makefile.script-test
|
Loading…
Reference in New Issue
Block a user