From 4e2a1fbb8ad4a354e7f4d1db6aef2e7d66f91e8f Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 29 Jan 2020 18:29:34 +0900 Subject: [PATCH 1/4] sim: enable CONFIG_TESTING_OSTEST_POWEROFF in ostest config To make it easier to run on CI jobs. --- boards/sim/sim/sim/configs/ostest/defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boards/sim/sim/sim/configs/ostest/defconfig b/boards/sim/sim/sim/configs/ostest/defconfig index 19068e61de90f..b3ddf5d5f9bf0 100644 --- a/boards/sim/sim/sim/configs/ostest/defconfig +++ b/boards/sim/sim/sim/configs/ostest/defconfig @@ -10,10 +10,12 @@ CONFIG_ARCH_BOARD="sim" CONFIG_ARCH_BOARD_SIM=y CONFIG_ARCH_CHIP="sim" CONFIG_ARCH_SIM=y +CONFIG_BOARDCTL_POWEROFF=y CONFIG_BOARD_LOOPSPERMSEC=100 CONFIG_DEBUG_SYMBOLS=y CONFIG_FS_NAMED_SEMAPHORES=y CONFIG_IDLETHREAD_STACKSIZE=4096 +CONFIG_LIB_BOARDCTL=y CONFIG_MAX_TASKS=64 CONFIG_NFILE_DESCRIPTORS=32 CONFIG_PTHREAD_MUTEX_TYPES=y @@ -27,5 +29,6 @@ CONFIG_START_MONTH=2 CONFIG_START_YEAR=2007 CONFIG_TESTING_OSTEST=y CONFIG_TESTING_OSTEST_LOOPS=100 +CONFIG_TESTING_OSTEST_POWEROFF=y CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_USER_ENTRYPOINT="ostest_main" From 44750f8e3e0bd432f66f7b87bada157e7f5ba7df Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 29 Jan 2020 17:01:58 +0900 Subject: [PATCH 2/4] Add Travis CI configuration Run sim:ostest on Linux and macOS. --- .travis.yml | 34 +++++++++++++++++++++++ tools/travis/travis.sh | 63 ++++++++++++++++++++++++++++++++++++++++++ tools/travis/version | 23 +++++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 .travis.yml create mode 100755 tools/travis/travis.sh create mode 100755 tools/travis/version diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000000..0d3d92e662018 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,34 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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: required + +os: +- linux +- osx + +dist: +- bionic + +language: +- c + +install: +- true + +script: +- ./tools/travis/travis.sh diff --git a/tools/travis/travis.sh b/tools/travis/travis.sh new file mode 100755 index 0000000000000..14d5c01cb1d32 --- /dev/null +++ b/tools/travis/travis.sh @@ -0,0 +1,63 @@ +#! /bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. + +set -e +set -x + +HOSTOS=$(uname -s) + +case $HOSTOS in + Linux) + sudo apt-get update -q + sudo apt-get install -y gperf + MAKE=make + CONFIGURE_HOSTOS=-l + ;; + Darwin) + MAKE=make + CONFIGURE_HOSTOS=-m + ;; + *) + echo Unknown OS: $HOSTOS + exit 1 + ;; +esac + +ORIG_DIR=$(pwd) + +cd .. +git clone --depth=1 https://github.com/apache/incubator-nuttx-apps apps +git clone --depth=1 https://github.com/nuttx/tools + +cd tools/kconfig-frontends +./configure --disable-kconfig --disable-nconf --disable-qconf \ + --disable-gconf --disable-mconf --disable-static --disable-shared \ + --disable-L10n --disable-utils +${MAKE} +sudo ${MAKE} install +cd .. + +cd ${ORIG_DIR} +# git-based versioning doesn't always work because +# travis only clones the repo with shallow history. +mv .git .git.bak +cp tools/travis/version .version +./tools/configure.sh ${CONFIGURE_HOSTOS} sim:ostest +${MAKE} +./nuttx diff --git a/tools/travis/version b/tools/travis/version new file mode 100755 index 0000000000000..797b557a214c8 --- /dev/null +++ b/tools/travis/version @@ -0,0 +1,23 @@ +#!/bin/bash + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. + +CONFIG_VERSION_STRING="Travis-CI" +CONFIG_VERSION_MAJOR=0 +CONFIG_VERSION_MINOR=0 +CONFIG_VERSION_BUILD="0000000000" From 6e611e2e10afae032661b8801121e129c9a44ccc Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 30 Jan 2020 01:50:37 +0900 Subject: [PATCH 3/4] travis: Add CONFIG_SIM_M32=y build for linux --- .travis.yml | 18 +++++++++++------- tools/travis/travis.sh | 7 +++++++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0d3d92e662018..90e5a73c4d0fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,16 +17,20 @@ sudo: required -os: -- linux -- osx - -dist: -- bionic - language: - c +jobs: + include: + - os: linux + dist: bionic + env: TEST_M32=0 + - os: linux + dist: bionic + env: TEST_M32=1 + - os: osx + env: TEST_M32=0 + install: - true diff --git a/tools/travis/travis.sh b/tools/travis/travis.sh index 14d5c01cb1d32..5f197ba6bdc59 100755 --- a/tools/travis/travis.sh +++ b/tools/travis/travis.sh @@ -26,6 +26,9 @@ case $HOSTOS in Linux) sudo apt-get update -q sudo apt-get install -y gperf + if [ $TEST_M32 -ne 0 ]; then + sudo apt-get install -y gcc-multilib + fi MAKE=make CONFIGURE_HOSTOS=-l ;; @@ -59,5 +62,9 @@ cd ${ORIG_DIR} mv .git .git.bak cp tools/travis/version .version ./tools/configure.sh ${CONFIGURE_HOSTOS} sim:ostest +if [ $TEST_M32 -ne 0 ]; then + echo CONFIG_SIM_M32=y >> .config + ${MAKE} oldconfig +fi ${MAKE} ./nuttx From d45fc888ddfd5c68fd0fd679da1562ce6da2accb Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 30 Jan 2020 01:54:37 +0900 Subject: [PATCH 4/4] travis: dump .config for easier trouble shooting --- tools/travis/travis.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/travis/travis.sh b/tools/travis/travis.sh index 5f197ba6bdc59..d4ab74eded602 100755 --- a/tools/travis/travis.sh +++ b/tools/travis/travis.sh @@ -66,5 +66,8 @@ if [ $TEST_M32 -ne 0 ]; then echo CONFIG_SIM_M32=y >> .config ${MAKE} oldconfig fi +echo ===== .config START ===== +cat .config +echo ===== .config END ===== ${MAKE} ./nuttx