Coder Social home page Coder Social logo

jeroendoggen / arduino-testsuite Goto Github PK

View Code? Open in Web Editor NEW
16.0 8.0 1.0 828 KB

Arduino TestSuite to automate Arduino unit tests

Home Page: http://jeroendoggen.github.io/Arduino-TestSuite

License: GNU General Public License v3.0

Python 88.91% Arduino 11.09%

arduino-testsuite's Introduction

Arduino TestSuite: Automated Arduino Unit Tests

This Python scripts allows automated running of several Arduino unit tests. The testing process is started on the PC but the tests run on the actual Arduino hardware. One set of unit tests is typically used to test one Arduino library.

The following steps are performed for each set of unit tests:

  1. The script compiles and uploads an Arduino sketch that contains the unit testing.
  2. The unit tests are run on the Arduino board.
  3. The results of the test are printed over the serial port and analyzed by the Python script.
  4. The script starts the next test, repeating steps 1,2 and 3 for all test that are requested in the configuration file. The script prints a summary showing an overview of all the failed/passed tests in the complete testsuite.

Installation:

Usage:

Typical test output:

user@computer:~/tests$ python -m arduino_testsuite
==============================
Planned tests:
 1. examples/floatingPin
 2. examples/inInterval
 3. examples/simpleTest
 4. examples/buildErrorTest
 5. examples/nonExistingFolder
 6. examples/slowTest
 7. examples/verySlowTest
==============================
.... output normally continues for a while ... link to full log below.

https://raw.github.com/jeroendoggen/Arduino-TestSuite/master/resources/example.log

Requirements:

Limitations:

  • Currently only tested on Linux and Windows 7
  • The program was created with other OS users in mind, so it will eventually get full cross-platform support.

License:

If not stated otherwise arduino_testsuite is distributed in terms of the GPLv2 software license. See COPYING in the distribution for details.

Bug reports:

Changelog:

0.2.2: Error handling:

  • Compile & upload errors
  • Timing: timeout for uploading & running of the tests
  • Missing files: wrong test folder, no config file
  • Hardware: Disconnect Arduino during test

0.2.1: Settings & configuration

  • Passing cli arguments & cli help messages
  • Settings separated from other code
  • Start tests from config file

0.2: First working OOP version

  • Subprocess for arscons
  • Classes: Test, TestSuite, InfoPrinter
  • Divided the code in several modules

0.1: Initial release:

  • Call scons
  • Run unit test
  • Print summary

arduino-testsuite's People

Contributors

jeroendoggen avatar mmurdoch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

mmurdoch

arduino-testsuite's Issues

Create a basic GUI

Show test status
Enable/disable test
Read a lists, (write a test list?)

Maintain a single copy of arscons SConstruct

Currently every example test contains a copy of arscons SConstruct. Maintaining several copies (e.g. when upgrading to a new version) is time consuming and error prone.

Perhaps the SConstruct file should be moved out of the examples directory?

Include support for Windows

  • The default port (/dev/ttyUSB0) is Unix-specific, on Windows it should probably be COMx (the first Arduino comes up as COM5 on my Windows 7 box). The port can be overridden using the -p command line parameter but it would be good if there is a reasonable default
  • scons.bat needs to be on the path (it is installed into <python_installation_dir>\Scripts)
  • To execute scons on Windows subprocess.Popen needs to be passed scons.bat (and not simply scons as currently). It also needs to run scons.bat from the directory in which it resides, by passing it: cwd=<python_installation_dir>\Scripts
  • To kill a process portably use Popen.terminate() rather than os.kill() in testhelper.py
  • When a parent process (python -m arduino_testsuite here) is using a serial port then a child process (scons in this case) gets an 'Access Denied' error when it tries to use it on Windows. The fix for this may be to open the serial port after the test upload to retrieve the test results and close it again before the next upload.

Build-system flexibility/independence

Currently we build the the Arduino source code with arscons.

It would be nice to make the testsuite program more flexible towards build-systems (independent of) by detecting the existence of a makefile, SConstruct, CMake or other similar files and just use them to build & upload the code.

If none of these files exist, we could fall back to building the Arduino sketch with pyavrutils (which is based on arscons).

Links:
https://github.com/mjoldfield/Arduino-Makefile
https://github.com/queezythegreat/arduino-cmake
https://github.com/ponty/pyavrutils
https://github.com/amperka/ino

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.