diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000000..90e5a73c4d0fb --- /dev/null +++ b/.travis.yml @@ -0,0 +1,38 @@ +# 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 + +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 + +script: +- ./tools/travis/travis.sh 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" diff --git a/tools/travis/travis.sh b/tools/travis/travis.sh new file mode 100755 index 0000000000000..d4ab74eded602 --- /dev/null +++ b/tools/travis/travis.sh @@ -0,0 +1,73 @@ +#! /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 + if [ $TEST_M32 -ne 0 ]; then + sudo apt-get install -y gcc-multilib + fi + 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 +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 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"