Skip to content

Commit

Permalink
Convert AutoAnalyseRawData script to Python (#454)
Browse files Browse the repository at this point in the history
* Port AutoAnalyseRawData script to Python.
* Rename python analysis script to snake_case format.
* Add options to read the data from stdin or from a file.
* Remove old analyse script.
* Improve auto_analyse_raw_data and add lint/unit tests.
* Make analyse script code unittest-able.
* Improve raw data parsing for analyse script.
* Add some unit tests for analyse script.
* Update Makefile(s) to use 'run_tests' to run their tests.
* Add python unit & lint tests into Travis
  • Loading branch information
crankyoldgit authored May 18, 2018
1 parent 7c06012 commit 531dc66
Show file tree
Hide file tree
Showing 9 changed files with 730 additions and 389 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ lib/googletest/**/*
# GCC pre-compiled headers.
**/*.gch

# Python compiled files
**/*.pyc

# Unit Test builds
test/*.o
test/*.a
Expand Down
3 changes: 3 additions & 0 deletions .style.yapf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[style]
based_on_style: google
indent_width: 2
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ install:
- arduino --board $BD --save-prefs
- arduino --pref "compiler.warning_level=all" --save-prefs
- sudo apt-get install jq
- sudo pip install pylint
script:
# Check that everything compiles.
- arduino --verify --board $BD $PWD/examples/IRrecvDemo/IRrecvDemo.ino
Expand All @@ -44,9 +45,11 @@ script:
# Check for lint issues.
- shopt -s nullglob
- python cpplint.py --extensions=c,cc,cpp,ino --headers=h,hpp {src,test,tools}/*.{h,c,cc,cpp,hpp,ino} examples/*/*.{h,c,cc,cpp,hpp,ino}
- pylint {src,test,tools}/*.py
- shopt -u nullglob
# Build and run the unit tests.
- (cd test; make run)
- (cd tools; make run_tests)
# Check the version numbers match.
- LIB_VERSION=$(egrep "^#define\s+_IRREMOTEESP8266_VERSION_\s+" src/IRremoteESP8266.h | cut -d\" -f2)
- test ${LIB_VERSION} == "$(jq -r .version library.json)"
Expand Down
12 changes: 12 additions & 0 deletions pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[REPORTS]

# Tells whether to display a full report or only the messages
reports=no

[FORMAT]

# Maximum number of characters on a single line.
max-line-length=80

# String used as indentation unit.
indent-string=' '
2 changes: 2 additions & 0 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ run : all
echo "PASS: \o/ \o/ All unit tests passed. \o/ \o/"; \
fi

run_tests : run

install-googletest :
git clone https://github.com/google/googletest.git ../lib/googletest

Expand Down
Loading

0 comments on commit 531dc66

Please sign in to comment.