add test for accellog
parent
0109a8114b
commit
16fe84704b
|
|
@ -105,7 +105,6 @@ function startRecord(force) {
|
||||||
showMenu();
|
showMenu();
|
||||||
}}
|
}}
|
||||||
]);
|
]);
|
||||||
layout.update();
|
|
||||||
layout.render();
|
layout.render();
|
||||||
|
|
||||||
// now start writing
|
// now start writing
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1,5 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
cd `dirname $0`
|
cd `dirname $0`/..
|
||||||
cd ../tests
|
ls tests/*.js | xargs -I{} bin/runtest.sh {}
|
||||||
ls *.js | xargs ../bin/runtest.sh
|
|
||||||
|
|
|
||||||
|
|
@ -2,35 +2,38 @@
|
||||||
# Requires Linux x64 (for ./espruino)
|
# Requires Linux x64 (for ./espruino)
|
||||||
# Also imagemagick for display
|
# Also imagemagick for display
|
||||||
|
|
||||||
cd `dirname $0`
|
cd `dirname $0`/..
|
||||||
if [ "$#" -ne 1 ]; then
|
if [ "$#" -ne 1 ]; then
|
||||||
echo "USAGE:"
|
echo "USAGE:"
|
||||||
echo " bin/runtest.sh testxyz.js"
|
echo " bin/runtest.sh tests/testxyz.js"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# temporary test files
|
# temporary test files
|
||||||
TESTJS=tmp.js
|
TESTJS=bin/tmp.js
|
||||||
TESTBMP=tmp.bmp
|
TESTBMP=bin/tmp.bmp
|
||||||
# actual source files
|
# actual source files
|
||||||
SRCDIR=../tests/
|
SRCDIR=tests
|
||||||
SRCJS=$1
|
SRCJS=$1
|
||||||
SRCBMP=`basename $SRCJS .js`.bmp
|
SRCBMP=$SRCDIR/`basename $SRCJS .js`.bmp
|
||||||
echo "TEST $SRCJS ($SRCBMP)"
|
echo "TEST $SRCJS ($SRCBMP)"
|
||||||
|
|
||||||
cat ../../../modules/Layout.js > $TESTJS
|
cat ../../modules/Layout.js > $TESTJS
|
||||||
|
echo 'Bangle = {};BTN1=0;process.env = process.env;process.env.HWVERSION=2;' >> $TESTJS
|
||||||
echo 'g = Graphics.createArrayBuffer(176,176,4);' >> $TESTJS
|
echo 'g = Graphics.createArrayBuffer(176,176,4);' >> $TESTJS
|
||||||
cat $SRCDIR/$SRCJS >> $TESTJS || exit 1
|
cat $SRCJS >> $TESTJS || exit 1
|
||||||
echo 'layout.render()' >> $TESTJS
|
echo 'layout.render()' >> $TESTJS
|
||||||
echo 'layout.debug()' >> $TESTJS
|
#echo 'layout.debug()' >> $TESTJS
|
||||||
echo 'require("fs").writeFileSync("'$TESTBMP'",g.asBMP())' >> $TESTJS
|
echo 'require("fs").writeFileSync("'$TESTBMP'",g.asBMP())' >> $TESTJS
|
||||||
|
|
||||||
./espruino $TESTJS || exit 1
|
bin/espruino $TESTJS || exit 1
|
||||||
if ! cmp $TESTBMP $SRCDIR/$SRCBMP >/dev/null 2>&1
|
if ! cmp $TESTBMP $SRCBMP >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
echo Files differ
|
echo =============================================
|
||||||
convert "+append" $TESTBMP $SRCDIR/$SRCBMP ../testresult.bmp
|
echo $TESTBMP $SRCBMP differ
|
||||||
display ../testresult.bmp
|
echo ==============================================
|
||||||
|
convert "+append" $TESTBMP $SRCBMP testresult.bmp
|
||||||
|
display testresult.bmp
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo Files are the same
|
echo Files are the same
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
|
|
@ -0,0 +1,13 @@
|
||||||
|
// Based on accellog usage
|
||||||
|
var layout = new Layout({ type: "v", c: [
|
||||||
|
{type:"txt", font:"6x8", label:"Samples", pad:2},
|
||||||
|
{type:"txt", id:"samples", font:"6x8:2", label:" - ", pad:5},
|
||||||
|
{type:"txt", font:"6x8", label:"Time", pad:2},
|
||||||
|
{type:"txt", id:"time", font:"6x8:2", label:" - ", pad:5},
|
||||||
|
{type:"txt", font:"6x8:2", label:"RECORDING", bgCol:"#f00", pad:5, fillx:1},
|
||||||
|
]
|
||||||
|
},[ // Buttons...
|
||||||
|
{label:"STOP", cb:()=>{}}
|
||||||
|
]);
|
||||||
|
layout.samples.label = "123";
|
||||||
|
layout.time.label = "123s";
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Loading…
Reference in New Issue