forked from sfera-labs/exo-sense-py-modbus
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from brainelectronics/feature/create-test-fram…
…ework Create test framework
- Loading branch information
Showing
46 changed files
with
4,377 additions
and
985 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
.DS_Store | ||
.DS_Store? | ||
pymakr.conf | ||
tests/ | ||
config/config*.py | ||
thinking/ | ||
*.bin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "modules"] | ||
path = modules | ||
url = [email protected]:brainelectronics/python-modules.git | ||
# changed to https due to RTD build issue | ||
# see https://github.com/readthedocs/readthedocs.org/issues/4043 | ||
# url = [email protected]:brainelectronics/python-modules.git | ||
url = https://github.com/brainelectronics/python-modules.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Set the version of Python and other tools you might need | ||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.9" | ||
|
||
# Build documentation in the docs/ directory with Sphinx | ||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
# Optionally declare the Python requirements required to build your docs | ||
python: | ||
install: | ||
- requirements: docs/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Build image | ||
# $ docker build -t micropython-client -f Dockerfile.client . | ||
# | ||
# Run image | ||
# $ docker run -it --rm --name micropython-client micropython-client | ||
|
||
FROM micropython/unix:v1.18 | ||
|
||
# use "volumes" in docker-compose file to remove need of rebuilding | ||
# COPY ./ /home | ||
# COPY umodbus /root/.micropython/lib/umodbus | ||
|
||
RUN micropython-dev -m upip install micropython-ulogging | ||
RUN micropython-dev -m upip install micropython-urequests | ||
|
||
CMD [ "micropython-dev", "-m", "examples/tcp_client_example.py" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Build image | ||
# $ docker build -t micropython-host -f Dockerfile.host . | ||
# | ||
# Run image | ||
# $ docker run -it --rm --name micropython-host micropython-host | ||
|
||
FROM micropython/unix:v1.18 | ||
|
||
# use "volumes" in docker-compose file to remove need of rebuilding | ||
# COPY ./ /home | ||
# COPY umodbus /root/.micropython/lib/umodbus | ||
|
||
RUN micropython-dev -m upip install micropython-ulogging | ||
RUN micropython-dev -m upip install micropython-urequests | ||
|
||
CMD [ "micropython-dev", "-m", "examples/tcp_host_example.py" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Build image | ||
# $ docker build -t micropython-tcp-example -f Dockerfile.test_tcp_example . | ||
# if a command fails, it will exit with non-zero code | ||
# | ||
# Run image, only possible if all tests passed | ||
# $ docker run -it --rm --name micropython-tcp-example micropython-tcp-example | ||
|
||
FROM micropython/unix:v1.18 | ||
|
||
# use "volumes" in docker-compose file to remove need of rebuilding | ||
# COPY ./ /home | ||
# COPY umodbus /root/.micropython/lib/umodbus | ||
# COPY mpy_unittest.py /root/.micropython/lib/mpy_unittest.py | ||
|
||
RUN micropython-dev -m upip install micropython-ulogging | ||
RUN micropython-dev -m upip install micropython-urequests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Build image | ||
# $ docker build -t micropython-test -f Dockerfile.tests . | ||
# if a unittest fails, it will exit with non-zero code | ||
# | ||
# Run image, only possible if all tests passed | ||
# $ docker run -it --rm --name micropython-test micropython-test | ||
|
||
FROM micropython/unix:v1.18 | ||
|
||
COPY ./ /home | ||
# keep examples and tests registers JSON file easily in sync | ||
COPY registers/example.json /home/tests/test-registers.json | ||
COPY umodbus /root/.micropython/lib/umodbus | ||
COPY mpy_unittest.py /root/.micropython/lib/mpy_unittest.py | ||
|
||
RUN micropython-dev -m upip install micropython-ulogging | ||
RUN micropython-dev -m upip install micropython-urequests | ||
RUN micropython-dev -c "import mpy_unittest as unittest; unittest.main('tests')" | ||
|
||
ENTRYPOINT ["/bin/bash"] |
Oops, something went wrong.