Skip to content

Commit 3deb788

Browse files
committed
Added travis script to build and run jerryscript with zephyr
Travis will build jerryscript against zephyr and run the "test" command in the virtual console, using named pipe. The output is directed to log.txt which is then checked to see if the command was successfull. JerryScript-DCO-1.0-Signed-off-by: Adrian Moldovan adrian.moldovan@intel.com
1 parent 836a14e commit 3deb788

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ before_install:
88
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tools/apt-get-install-deps.sh; fi
99
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tools/apt-get-install-qemu-arm.sh; fi
1010
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then tools/brew-install-deps.sh; fi
11+
- if [[ "$TARGET" == "build-zephyr" ]]; then tools/apt-get-install-zephyr-deps.sh; fi
1112

1213
install:
1314

@@ -26,5 +27,8 @@ matrix:
2627
env: TARGET="build.darwin test-js"
2728
- os: osx
2829
env: TARGET=test-unit
30+
- os: linux
31+
env: TARGET=build-zephyr
2932
allow_failures:
3033
- os: osx
34+
- env: TARGET=build-zephyr

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,10 @@ clean:
343343
check-signed-off:
344344
$(Q) ./tools/check-signed-off.sh
345345

346+
.PHONY: check-signed-off
347+
build-zephyr:
348+
$(Q) ./tools/build-zephyr.sh
349+
346350
.PHONY: check-vera
347351
check-vera:
348352
$(Q) $(call SHLOG,./tools/check-vera.sh,$(OUT_DIR)/vera.log,Vera++)

tools/apt-get-install-zephyr-deps.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
# Copyright © 2016 Intel Corporation
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
sudo apt-get update -q
18+
sudo apt-get install -q -y \
19+
gcc gcc-multilib g++ g++-multilib libc6-dev-i386 \
20+
python3-ply linux-libc-dev build-essential

tools/build-zephyr.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
3+
# Copyright © 2016 Intel Corporation
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
git clone https://gerrit.zephyrproject.org/r/zephyr
18+
cd zephyr
19+
wget https://nexus.zephyrproject.org/content/repositories/releases/org/zephyrproject/zephyr-sdk/0.8-i686/zephyr-sdk-0.8-i686-setup.run
20+
chmod +x zephyr-sdk-0.8-i686-setup.run
21+
mkdir zephyr_uncompressed && cd zephyr_uncompressed
22+
../zephyr-sdk-0.8-i686-setup.run --target $(pwd) --noexec
23+
mkdir ../zephyr_sdk && cd ../zephyr_sdk
24+
export ZEPHYR_SDK_INSTALL_DIR=$(pwd)
25+
cd ../zephyr_uncompressed
26+
./setup.sh -d $ZEPHYR_SDK_INSTALL_DIR
27+
source ../zephyr-env.sh
28+
export ZEPHYR_GCC_VARIANT=zephyr
29+
cd ../..
30+
sudo ln -s /usr/include/asm-generic /usr/include/asm
31+
make -f ./targets/arduino_101/Makefile.arduino_101 BOARD=qemu_x86
32+
mkfifo path.in path.out
33+
./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 -pidfile qemu.pid -serial pipe:path -kernel ./build/qemu_x86/zephyr/zephyr.elf & sleep 5
34+
cat path.out > log.txt & sleep 5
35+
printf "test\r\n" > path.in
36+
sleep 5
37+
kill %1
38+
cat log.txt
39+
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
40+
grep "Hi JS World!" log.txt > /dev/null

0 commit comments

Comments
 (0)