Skip to content
This repository has been archived by the owner on Jan 7, 2019. It is now read-only.

Commit

Permalink
[travis] Run multiple examples in one instance.
Browse files Browse the repository at this point in the history
This compiles more examples per test instance, thereby reducing the
total number of TravisCI instances needed, speeding up completion.
  • Loading branch information
salkinium committed Jun 30, 2017
1 parent 100de71 commit 5af9e5c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 39 deletions.
28 changes: 5 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,31 +45,13 @@ cache:
# within the longest running instances, which is the first.
env:
- TEST_SUITE="check=examples examples=stm32f4_discovery"
- TEST_SUITE="check=examples examples=stm32f3_discovery"
- TEST_SUITE="check=examples examples=stm32f469_discovery,lpcxpresso,linux,unittest"
- TEST_SUITE="check=examples examples=stm32,stm32f3_discovery,stm32f429_discovery,stm32f1_discovery,stm32f072_discovery,stm32f746g_discovery,stm32l476_discovery"
- TEST_SUITE="check=examples examples=avr,arduino_uno,zmq"
- TEST_SUITE="check=devices"
- TEST_SUITE="check=examples examples=nucleo_f031k6,nucleo_f103rb,nucleo_f303k8,nucleo_f401re,nucleo_f411re,nucleo_f429zi,nucleo_l476rg"
- TEST_SUITE="unittest"
- TEST_SUITE="unittest target=stm32"
- TEST_SUITE="unittest target=atmega"
- TEST_SUITE="check=examples examples=avr"
- TEST_SUITE="check=devices"
- TEST_SUITE="check=examples examples=linux"
- TEST_SUITE="check=examples examples=stm32f429_discovery"
- TEST_SUITE="check=examples examples=stm32f1_discovery"
- TEST_SUITE="check=examples examples=stm32f072_discovery"
- TEST_SUITE="check=examples examples=lpcxpresso"
- TEST_SUITE="check=examples examples=stm32"
- TEST_SUITE="check=examples examples=arduino_uno"
- TEST_SUITE="check=examples examples=stm32f746g_discovery"
- TEST_SUITE="check=examples examples=stm32f4_loa_v2b"
- TEST_SUITE="check=examples examples=stm32f469_discovery"
- TEST_SUITE="check=examples examples=stm32l476_discovery"
- TEST_SUITE="check=examples examples=nucleo_f031k6"
- TEST_SUITE="check=examples examples=nucleo_f103rb"
- TEST_SUITE="check=examples examples=nucleo_f303k8"
- TEST_SUITE="check=examples examples=nucleo_f401re"
- TEST_SUITE="check=examples examples=nucleo_f411re"
- TEST_SUITE="check=examples examples=nucleo_f429zi"
- TEST_SUITE="check=examples examples=nucleo_l476rg"
- TEST_SUITE="check=examples examples=unittest"
- TEST_SUITE="check=examples examples=zmq"

script: "scons $TEST_SUITE"
36 changes: 20 additions & 16 deletions SConscript.check
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,16 @@ check = 'all' if 'check' in BUILD_TARGETS else ARGUMENTS.get('check')

# make it possible to only check the examples from one example directory
if ARGUMENTS.get('examples'):
examples_dir = os.path.join('examples', ARGUMENTS.get('examples'))
if not os.path.isdir(examples_dir):
print("\033[0;33mWarning: invalid argument value: {} does not exist!\033[0m".format(examples_dir))
examples_dir = 'examples'
raw_dirs = [os.path.join('examples', d) for d in ARGUMENTS.get('examples').split(',')]
examples_dirs = [d for d in raw_dirs if os.path.isdir(d)]
for wrong_dir in [w for w in raw_dirs if w not in examples_dirs]:
print("\033[0;33mWarning: invalid argument value: {} does not exist!\033[0m".format(wrong_dir))
else:
examples_dir = 'examples'
examples_dirs = ['examples']

if not len(examples_dirs):
print("No examples folder selected!")
Exit(1)

if check is not None:
result = []
Expand All @@ -141,17 +144,18 @@ if check is not None:
# examples is not checked!
if check in ['all', 'examples']:
result.append("Examples")
for path, directories, files in os.walk(examples_dir):
if 'SConstruct' in files:
exitStatus = os.system("scons -Q -C %s build" % path)
if exitStatus == 0:
result.append("check: %s -> Ok" % path)
else:
result.append(color_red + ("check: %s -> FAIL!" % path) + color_default)

if exitStatus != 0:
everythingOk = False

for examples_dir in examples_dirs:
for path, directories, files in os.walk(examples_dir):
if 'SConstruct' in files:
exitStatus = os.system("scons -Q -C %s build" % path)
if exitStatus == 0:
result.append("check: %s -> Ok" % path)
else:
result.append(color_red + ("check: %s -> FAIL!" % path) + color_default)

if exitStatus != 0:
everythingOk = False

# Check if the XPCC library compiles against different targets without errors.
# The examples from xpcc/release/tests are compiled for all targets from the
# list 'devices' (at top of this file.
Expand Down

0 comments on commit 5af9e5c

Please sign in to comment.