Files
app-ethereum/tests/build_local_test_elfs.sh

47 lines
1.2 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
set -e
TESTS_FULL_PATH=$(dirname "$(realpath "$0")")
2021-08-26 14:27:49 +02:00
# FILL THESE WITH YOUR OWN SDKs PATHS
# NANOS_SDK=
# NANOX_SDK=
2021-08-26 14:27:49 +02:00
# list of apps required by tests that we want to build here
APPS=("ethereum" "ethereum_classic")
# list of SDKS
NANO_SDKS=("$NANOS_SDK" "$NANOX_SDK")
# list of target elf file name suffix
FILE_SUFFIXES=("nanos" "nanox")
# move to the tests directory
cd "$TESTS_FULL_PATH" || exit 1
2021-08-26 14:27:49 +02:00
# Do it only now since before the cd command, we might not have been inside the repository
GIT_REPO_ROOT=$(git rev-parse --show-toplevel)
TESTS_REL_PATH=$(realpath --relative-to="$GIT_REPO_ROOT" "$TESTS_FULL_PATH")
# create elfs directory if it doesn't exist
2021-08-26 14:27:49 +02:00
mkdir -p elfs
# move to repo's root to build apps
cd "$GIT_REPO_ROOT" || exit 1
2021-08-26 14:27:49 +02:00
for ((sdk_idx=0; sdk_idx < "${#NANO_SDKS[@]}"; sdk_idx++))
2021-08-26 14:27:49 +02:00
do
nano_sdk="${NANO_SDKS[$sdk_idx]}"
elf_suffix="${FILE_SUFFIXES[$sdk_idx]}"
echo "* Building elfs for $(basename "$nano_sdk")..."
for appname in "${APPS[@]}"
do
echo "** Building app $appname..."
make clean BOLOS_SDK="$nano_sdk"
make -j DEBUG=1 NFT_TESTING_KEY=1 BOLOS_SDK="$nano_sdk" CHAIN="$appname"
cp bin/app.elf "$TESTS_REL_PATH/elfs/${appname}_${elf_suffix}.elf"
done
2021-08-26 14:27:49 +02:00
done
echo "done"