1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00

docs: fix markdown issues

This commit is contained in:
Pavol Rusnak 2018-06-05 23:42:26 +02:00
parent fb4b2aa608
commit 9e16eb4122
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
3 changed files with 35 additions and 4 deletions

View File

@ -16,36 +16,47 @@ make vendor
``` ```
Install the required packages, depending on your operating system. Install the required packages, depending on your operating system.
* __Debian/Ubuntu__: * __Debian/Ubuntu__:
```sh ```sh
sudo apt-get update
sudo apt-get install scons libsdl2-dev libsdl2-image-dev sudo apt-get install scons libsdl2-dev libsdl2-image-dev
``` ```
* __Fedora__: * __Fedora__:
```sh ```sh
sudo yum install scons SDL2-devel SDL2_image-devel sudo yum install scons SDL2-devel SDL2_image-devel
``` ```
* __OpenSUSE__: * __OpenSUSE__:
```sh ```sh
sudo zypper install scons libSDL2-devel libSDL2_image-devel sudo zypper install scons libSDL2-devel libSDL2_image-devel
``` ```
* __Arch__: * __Arch__:
```sh ```sh
sudo pacman -S scons sdl2 sdl2_image sudo pacman -S scons sdl2 sdl2_image
``` ```
* __Mac OS X__: * __Mac OS X__:
```sh ```sh
brew install scons sdl2 sdl2_image brew install scons sdl2 sdl2_image
``` ```
* __Windows__: not supported yet, sorry. * __Windows__: not supported yet, sorry.
Run the build with: Run the build with:
```sh ```sh
make build_unix make build_unix
``` ```
Now you can start the emulator: Now you can start the emulator:
```sh ```sh
./emu.sh ./emu.sh
``` ```

View File

@ -101,6 +101,7 @@
* Integrated STMicroelectronics ST-LINK/V2.1 debugger * Integrated STMicroelectronics ST-LINK/V2.1 debugger
Minimum MCU requirements: Minimum MCU requirements:
* STM32F4 family [STM32F427VIT6](http://www.st.com/en/microcontrollers/stm32f427vi.html) * STM32F4 family [STM32F427VIT6](http://www.st.com/en/microcontrollers/stm32f427vi.html)
* 168 MHz, 8 MHz HSE * 168 MHz, 8 MHz HSE
* 2048 KB Flash memory * 2048 KB Flash memory
@ -112,4 +113,3 @@ Minimum MCU requirements:
#### Clock Tree #### Clock Tree
![Clock Tree](hardware/clock-tree.png) ![Clock Tree](hardware/clock-tree.png)

View File

@ -7,14 +7,19 @@ Apart from the internal tests, Trezor core has a suite of integration tests in t
### 1. Running the suite with pipenv ### 1. Running the suite with pipenv
[`pipenv`](https://docs.pipenv.org/) is a tool for making reproducible Python environments. Install it with: [`pipenv`](https://docs.pipenv.org/) is a tool for making reproducible Python environments. Install it with:
```sh ```sh
sudo pip3 install pipenv sudo pip3 install pipenv
``` ```
Inside `trezor-core` checkout, install the environment: Inside `trezor-core` checkout, install the environment:
```sh ```sh
pipenv install pipenv install
``` ```
And run the automated tests: And run the automated tests:
```sh ```sh
pipenv run make test_emu pipenv run make test_emu
``` ```
@ -22,37 +27,48 @@ pipenv run make test_emu
### 2. Developing new tests ### 2. Developing new tests
You will need a separate checkout of `python-trezor`. It's probably a good idea to do this outside the `trezor-core` directory: You will need a separate checkout of `python-trezor`. It's probably a good idea to do this outside the `trezor-core` directory:
```sh ```sh
git clone https://github.com/trezor/python-trezor git clone https://github.com/trezor/python-trezor
``` ```
Prepare a virtual environment with all the requirements, and switch into it. Again, it's easiest to do this with `pipenv`: Prepare a virtual environment with all the requirements, and switch into it. Again, it's easiest to do this with `pipenv`:
```sh ```sh
cd python-trezor cd python-trezor
pipenv install -r requirements-dev.txt pipenv install -r requirements-dev.txt
pipenv install -e . pipenv install -e .
pipenv shell pipenv shell
``` ```
Alternately, if you have an existing virtualenv, you can install python-trezor in "develop" mode: Alternately, if you have an existing virtualenv, you can install python-trezor in "develop" mode:
```sh ```sh
python setup.py develop python setup.py develop
``` ```
If you want to test against the emulator, run it in a separate terminal from the `trezor-core` checkout directory: If you want to test against the emulator, run it in a separate terminal from the `trezor-core` checkout directory:
```sh ```sh
PYOPT=0 ./emu.sh PYOPT=0 ./emu.sh
``` ```
Find the device address and export it as an environment variable. For the emulator, this is: Find the device address and export it as an environment variable. For the emulator, this is:
```sh ```sh
export TREZOR_PATH="udp:127.0.0.1:21324" export TREZOR_PATH="udp:127.0.0.1:21324"
``` ```
(You can find other devices with `trezorctl list`.) (You can find other devices with `trezorctl list`.)
Now you can run the test suite, either from `python-trezor` or `trezor-core` root directory: Now you can run the test suite, either from `python-trezor` or `trezor-core` root directory:
```sh ```sh
pytest pytest
``` ```
Or from anywhere else: Or from anywhere else:
```sh ```sh
pytest --pyargs trezorlib.tests.device_tests # this works from other locations pytest --pyargs trezorlib.tests.device_tests # this works from other locations
``` ```
@ -60,6 +76,7 @@ pytest --pyargs trezorlib.tests.device_tests # this works from other locations
You can place your own tests in `trezorlib/tests/device_tests`. See test style guide (TODO). You can place your own tests in `trezorlib/tests/device_tests`. See test style guide (TODO).
If you only want to run a particular test, pick it with `-k <keyword>` or `-m <marker>`: If you only want to run a particular test, pick it with `-k <keyword>` or `-m <marker>`:
```sh ```sh
pytest -k nem # only runs tests that have "nem" in the name pytest -k nem # only runs tests that have "nem" in the name
pytest -m stellar # only runs tests marked with @pytest.mark.stellar pytest -m stellar # only runs tests marked with @pytest.mark.stellar
@ -76,9 +93,12 @@ When you're happy with your tests, follow these steps:
If you want to run that test as usual, run `pytest --runxfail` If you want to run that test as usual, run `pytest --runxfail`
3. Submit a PR to `python-trezor`, containing these tests. 3. Submit a PR to `python-trezor`, containing these tests.
4. Edit the file `trezor-core/pytest.ini`, and add your marker to the `run_xfail` item: 4. Edit the file `trezor-core/pytest.ini`, and add your marker to the `run_xfail` item:
```
``` ini
run_xfail = lisk nem ultracoin2000 run_xfail = lisk nem ultracoin2000
``` ```
This will cause your PR to re-enable the `xfail`ed tests. That way we will see whether your feature actually implements what it claims. This will cause your PR to re-enable the `xfail`ed tests. That way we will see whether your feature actually implements what it claims.
5. Submit a PR to `trezor-core`. 5. Submit a PR to `trezor-core`.
6. Optionally, if you like to be extra nice: after both your PRs are accepted, submit a new one to `python-trezor` that removes the `xfail` markers, and one to `trezor-core` that removes the `run_xfail` entry. 6. Optionally, if you like to be extra nice: after both your PRs are accepted, submit a new one to `python-trezor` that removes the `xfail` markers, and one to `trezor-core` that removes the `run_xfail` entry.