]> rtime.felk.cvut.cz Git - arc.git/commitdiff
Fixed erronous coding of previously committed script.
authormaek <devnull@localhost>
Fri, 3 Dec 2010 10:12:11 +0000 (11:12 +0100)
committermaek <devnull@localhost>
Fri, 3 Dec 2010 10:12:11 +0000 (11:12 +0100)
scripts/compile_examples.sh [new file with mode: 0644]
scripts/compilers.txt [new file with mode: 0644]

diff --git a/scripts/compile_examples.sh b/scripts/compile_examples.sh
new file mode 100644 (file)
index 0000000..fc0e847
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/bash\r
+\r
+ARC_DIR=../\r
+EXAMPLE_DIR=${ARC_DIR}/examples/\r
+COMPILER_DIR=/opt/compilers/\r
+OUTPUT=test_output.xml\r
+BUILDOUTTMP=tmp_out.txt\r
+\r
+\r
+function failedTest {\r
+echo "<FailedTest id=\"${1}\"> \\r
+  <Name>${2}</Name> \\r
+  <Message>${3}</Message> \\r
+</FailedTest>" >> $OUTPUT\r
+\r
+#      echo "<Location>"\r
+#      echo "<File>c:/ArcticStudio/workspace/arc-tests/ComTests/com_test.c</File>"\r
+#      echo "<Line>444</Line>"\r
+#      echo "</Location>"\r
+#      echo "<Message>UPNotificationCalled == getNumberOfSignalsInPdu(IPduId) &amp;&amp; 0</Message>"\r
+}\r
+\r
+function successfulTest {\r
+echo "<Test id=\"${1}\"> \\r
+  <Name>${2}</Name> \\r
+</Test>" >> $OUTPUT\r
+}\r
+\r
+function warningTest {\r
+echo "<Test id=\"${1}\"> \\r
+  <Name>${2}</Name> \\r
+  <Warning>${3}</Warning>\r
+</Test>" >> $OUTPUT\r
+}\r
+\r
+\r
+\r
+\r
+echo "<?xml version=\"1.0\" encoding='utf8' standalone='yes' ?> \\r
+<?xml-stylesheet type=\"text/xsl\" href=\"unittests.xsl\" ?> \\r
+<TestRuns> \\r
+<TestRun> \\r
+<CompileExamples>" > $OUTPUT\r
+\r
+TEST_ID=1\r
+for EXAMPLE in `ls $EXAMPLE_DIR`; do\r
+       for BOARD in `ls ${EXAMPLE_DIR}${EXAMPLE}/config`; do \r
+\r
+               C=`grep $BOARD compilers.txt`\r
+               COMPILER=${COMPILER_DIR}${C#$BOARD:}\r
+\r
+               TEST_NAME=${EXAMPLE}-${BOARD}\r
+\r
+               if [ -x "${COMPILER}gcc" ]; then\r
+                       BUILD_FILE=${EXAMPLE}_${BOARD}.elf \r
+                       make -C ${ARC_DIR} CROSS_COMPILE=$COMPILER BOARDDIR=$BOARD BDIR=examples/$EXAMPLE build-exe-y=${BUILD_FILE} clean all\r
+\r
+                       if [ -a ${ARC_DIR}/binaries/${BUILD_FILE} ]; then\r
+                               successfulTest $TEST_ID $TEST_NAME\r
+                       else\r
+                               BUILDOUT=`cat $BUILDOUTTMP`\r
+                               failedTest $TEST_ID $TEST_NAME "See console output for information"\r
+                       fi\r
+               else\r
+                       warningTest $TEST_ID $TEST_NAME "No compiler found"\r
+               fi\r
+               let TEST_ID=TEST_ID+1\r
+       done\r
+done\r
+\r
+echo "</CompileExamples> \\r
+</TestRun> \\r
+</TestRuns>" >> $OUTPUT\r
+\r
diff --git a/scripts/compilers.txt b/scripts/compilers.txt
new file mode 100644 (file)
index 0000000..2ca3d4a
--- /dev/null
@@ -0,0 +1,8 @@
+ti_tms570ls:arm-none-eabi/bin/arm-none-eabi-\r
+stm32_mcbstm32:arm-none-eabi/bin/arm-none-eabi-\r
+stm32_stm3210c:arm-none-eabi/bin/arm-none-eabi-\r
+mpc5516it:powerpc-eabispe/bin/powerpc-eabispe-\r
+mpc5567qrtech:powerpc-eabispe/bin/powerpc-eabispe-\r
+mpc551xsim:powerpc-eabispe/bin/powerpc-eabispe-\r
+mpc5554sim:powerpc-eabispe/bin/powerpc-eabispe-\r
+linux:\r