-
Notifications
You must be signed in to change notification settings - Fork 683
Added travis script to build and run jerryscript with zephyr #1144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -343,6 +343,10 @@ clean: | |
check-signed-off: | ||
$(Q) ./tools/check-signed-off.sh | ||
|
||
.PHONY: build-zephyr | ||
build-zephyr: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm still confused here. Is this only build or test it too? Release or debug? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure what I should put there. I just followed the example of check-signed-off and did the same with build-zephyr. It basically builds and runs (to test) it. |
||
$(Q) ./tools/build-zephyr.sh | ||
|
||
.PHONY: check-vera | ||
check-vera: | ||
$(Q) $(call SHLOG,./tools/check-vera.sh,$(OUT_DIR)/vera.log,Vera++) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
# Copyright © 2016 Intel Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
sudo apt-get update -q | ||
sudo apt-get install -q -y \ | ||
gcc gcc-multilib g++ g++-multilib libc6-dev-i386 \ | ||
python3-ply linux-libc-dev build-essential |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#!/bin/bash | ||
|
||
# Copyright © 2016 Intel Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# clone zephyr repo | ||
git clone https://gerrit.zephyrproject.org/r/zephyr | ||
cd zephyr | ||
git checkout tags/v1.4.0 | ||
|
||
# download the zephyr_sdk installer script | ||
wget https://nexus.zephyrproject.org/content/repositories/releases/org/\ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that wouldn't work. I tried looking into ways of splitting that as well as indenting, but couldn't find a nice looking one in bash...i am splitting it but i cannot indent it as well (afaik) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. If the whitespaces breaks the |
||
zephyrproject/zephyr-sdk/0.8-i686/zephyr-sdk-0.8-i686-setup.run | ||
|
||
# extract the zephyr-sdk installer | ||
chmod +x zephyr-sdk-0.8-i686-setup.run | ||
mkdir zephyr_sdk_installer && cd zephyr_sdk_installer | ||
../zephyr-sdk-0.8-i686-setup.run --target $(pwd) --noexec | ||
|
||
# install the zephyr_sdk | ||
mkdir ../zephyr_sdk && cd ../zephyr_sdk | ||
export ZEPHYR_SDK_INSTALL_DIR=$(pwd) | ||
cd ../zephyr_sdk_installer | ||
./setup.sh -d $ZEPHYR_SDK_INSTALL_DIR | ||
|
||
# source the zephyr required environment variables | ||
source ../zephyr-env.sh | ||
export ZEPHYR_GCC_VARIANT=zephyr | ||
|
||
# back to jerryscript dir | ||
cd ../.. | ||
|
||
# link asm-generic to asm (otherwise there will be errors with include headers) | ||
sudo ln -s /usr/include/asm-generic /usr/include/asm | ||
|
||
# build jerryscript for qemu | ||
make -f ./targets/arduino_101/Makefile.arduino_101 BOARD=qemu_x86 | ||
|
||
# create 2 named pipes to input jerryscript commands and evaluate the output | ||
mkfifo path.in path.out | ||
|
||
# run the qemu executable in background using the named pipes | ||
./zephyr/zephyr_sdk/sysroots/i686-pokysdk-linux/usr/bin/qemu-system-i386 -m 32 \ | ||
-cpu qemu32 -no-reboot -nographic -vga none -display none -net none \ | ||
-clock dynticks -no-acpi -balloon none \ | ||
-L ./zephyr/zephyr_sdk/sysroots/i686-pokysdk-linux/usr/share/qemu \ | ||
-bios bios.bin -machine type=pc-0.14 -serial pipe:path \ | ||
-kernel ./build/qemu_x86/zephyr/zephyr.elf & sleep 5 | ||
|
||
# listen for any output and direct it to log for further checking | ||
cat path.out > log.txt & sleep 5 | ||
|
||
# write the jerryscript "test" command in the input named pipe | ||
printf "test\r\n" > path.in | ||
sleep 5 | ||
|
||
# kill qemu executable process (which is marked as first job that runs in background) | ||
kill %1 | ||
|
||
# show the log output and check if the string "Hi JS World!" is present there | ||
cat log.txt | ||
if grep "Hi JS World!" log.txt > /dev/null | ||
then | ||
echo -e "\n\nQapla'! (it means \"Success\" in Klingon)" | ||
else | ||
echo -e "\n\nScript has failed" | ||
fi | ||
|
||
# run the grep command again, so that in the case of not finding the string, the | ||
# grep command will return a non 0 value, which will make travis fail the build | ||
grep "Hi JS World!" log.txt > /dev/null | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please make this file more readable. Add some comment and empty line, break long lines where you can, etc. I'd rename this file, because it not just builds zephyr (ex.: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need a $TRAVIS_OS_NAME here?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 3rd build fails (the one with toolchain) if I choose TRAVIS_OS_NAME == linux. I think there are some conflicts in the packages installed.
Travis error is:
CMake Error at CMakeLists.txt:16 (project):
The CMAKE_C_COMPILER:
arm-linux-gnueabihf-gcc
is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
Maybe I can change the order of the dependencies scripts...so that I call the install-zephyr.sh before all other scripts, perhaps this could fix the conflict....Although I thought it was better for that dependency script to be called only for the build in which it's actually building and running the zephyr with jerryscript.