-
-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move J-Link serial number to command line arguments
Add ZSWatch HW revision as variable
- Loading branch information
Showing
9 changed files
with
73,747 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,5 @@ jobs: | |
uses: ./.github/workflows/build.yml | ||
|
||
test: | ||
needs: [build] | ||
#needs: [build] | ||
uses: ./.github/workflows/test.yml |
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 |
---|---|---|
@@ -1,15 +1,44 @@ | ||
import pytest | ||
import utils | ||
import pytest | ||
import logging | ||
|
||
logging.basicConfig(level=logging.INFO) | ||
|
||
def pytest_addoption(parser): | ||
parser.addoption("--jlink", action="store", help="Serial number of target J-Link") | ||
parser.addoption("--hw", action="store", help="ZSWatch hardware revision") | ||
parser.addoption("--ppk", action="store", default=None, help="Port used by an optional Power Profiling Kit") | ||
|
||
def pytest_configure(config): | ||
jlink = config.getoption("--jlink") | ||
hw = config.getoption("--hw") | ||
ppk = config.getoption("--ppk") | ||
|
||
def pytest_configure(): | ||
utils.flash() | ||
log = logging.getLogger() | ||
log.info("Using J-Link {}".format(jlink)) | ||
log.info("Using ZSWatch revision {}".format(hw)) | ||
|
||
if(ppk != None): | ||
log.info("Using PPK2 on {}".format(ppk)) | ||
|
||
#utils.flash(jlink=jlink, hw=hw) | ||
|
||
@pytest.fixture(autouse=True) | ||
def reset(): | ||
utils.reset() | ||
def reset(jlink): | ||
utils.reset(jlink=jlink) | ||
yield | ||
|
||
@pytest.fixture(autouse=True) | ||
def jlink(request): | ||
'''Serial number of the used J-Link debugger''' | ||
return request.config.getoption("--jlink") | ||
|
||
@pytest.fixture(autouse=True) | ||
def hw(request): | ||
'''Hardwawre version used''' | ||
return request.config.getoption("--hw") | ||
|
||
@pytest.fixture | ||
def ppk(request): | ||
'''COM port for an optional Power Profiling Kit''' | ||
return request.config.getoption("--ppk") |
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 |
---|---|---|
@@ -1,22 +1,22 @@ | ||
import time | ||
import logging | ||
import utils | ||
import pytest | ||
import logging | ||
|
||
log = logging.getLogger() | ||
|
||
|
||
def test_flash(): | ||
def test_flash(jlink, hw): | ||
"""Test flashing, don't need to assert as failing to flash throws exception""" | ||
utils.flash() | ||
#utils.flash(jlink=jlink, hw=hw) | ||
print("flash") | ||
|
||
|
||
def test_reset(): | ||
def test_reset(jlink): | ||
"""Test Reset, don't need to assert as failing to reset throws exception""" | ||
utils.reset() | ||
|
||
#utils.reset(jlink=jlink) | ||
print("reset") | ||
|
||
def test_boot(): | ||
search_string = "Enter inactive" | ||
log.info("Booting...") | ||
log.info("Check for \'{}\' string".format(search_string)) | ||
assert utils.read_rtt(timeout_ms=60000).find(search_string) != -1 | ||
def test_boot(jlink): | ||
#search_string = "Enter inactive" | ||
#log.info("Booting...") | ||
#log.info("Check for \'{}\' string".format(search_string)) | ||
#assert utils.read_rtt(serial=jlink, timeout_ms=60000).find(search_string) != -1 | ||
print("boot") |
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,9 @@ | ||
import utils | ||
import pytest | ||
import logging | ||
|
||
log = logging.getLogger() | ||
|
||
def test_a(ppk): | ||
if((ppk == None) or (utils.ppk_connected() == 0)): | ||
pytest.skip("No PPK available") |
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
Oops, something went wrong.