-
-
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
5 changed files
with
46 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,33 @@ | ||
import pytest | ||
import utils | ||
import logging | ||
import pytest | ||
|
||
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") | ||
|
||
def pytest_configure(config): | ||
jlink = config.getoption("--jlink") | ||
hw = config.getoption("--hw") | ||
|
||
def pytest_configure(): | ||
utils.flash() | ||
log = logging.getLogger() | ||
log.info("Using J-Link {}".format(jlink)) | ||
log.info("Using ZSWatch revision {}".format(hw)) | ||
|
||
utils.flash(jlink=jlink, hw=hw) | ||
|
||
@pytest.fixture(autouse=True) | ||
def reset(): | ||
utils.reset() | ||
def reset(jlink): | ||
utils.reset(jlink=jlink) | ||
yield | ||
|
||
@pytest.fixture | ||
def jlink(request): | ||
return request.config.getoption("--jlink") | ||
|
||
@pytest.fixture | ||
def hw(request): | ||
return request.config.getoption("--hw") |
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