From 2f0cbfcb32a35a0bde4e6854225e99eec8e6de51 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Wed, 17 Jun 2020 18:15:06 +0100 Subject: [PATCH] tests: Add script to make LFS for running tests The NTest tests take a lot of RAM if we just run them there. So instead, push them into LFS to give us some more wiggle room. --- tests/preflight-lfs.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 tests/preflight-lfs.sh diff --git a/tests/preflight-lfs.sh b/tests/preflight-lfs.sh new file mode 100755 index 00000000..51cdee9f --- /dev/null +++ b/tests/preflight-lfs.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env zsh + +set -e -u + +SELFDIR=$(dirname $(readlink -f $0)) + +LUAFILES=( + # Infrastructure + ${SELFDIR}/../lua_examples/lfs/_init.lua + ${SELFDIR}/../lua_examples/lfs/dummy_strings.lua + ${SELFDIR}/../lua_examples/pipeutils.lua # accelerates TCL xfer + + ${SELFDIR}/NTest/NTest.lua + ${SELFDIR}/utils/NTestEnv.lua + ${SELFDIR}/utils/NTestTapOut.lua + + # Lua modules exercised by test programs + + # Test programs + ${SELFDIR}/NTest_*.lua +) + +if [ -e ${SELFDIR}/../luac.cross.int ]; then + echo "Found integer Lua cross compiler..." + ${SELFDIR}/../luac.cross.int -f -o ${NODEMCU_TESTTMP}/tmp-lfs-int.img ${LUAFILES[@]} + echo " ... and generated ${NODEMCU_TESTTMP}/tmp-lfs-int.img" +fi + +if [ -e ${SELFDIR}/../luac.cross ]; then + echo "Found float Lua cross compiler..." + ${SELFDIR}/../luac.cross -f -o ${NODEMCU_TESTTMP}/tmp-lfs-float.img ${LUAFILES[@]} + echo " ... and generated ${NODEMCU_TESTTMP}/tmp-lfs-float.img" +fi