Skip to content

Commit caa1e17

Browse files
committed
[ci] Add basic regression test to PRs
1 parent e3d86e6 commit caa1e17

20 files changed

+4949
-88
lines changed

.github/workflows/test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Run Regression Tests
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
7+
jobs:
8+
regressions:
9+
runs-on: ubuntu-latest
10+
steps:
11+
12+
- name: Check out Repository
13+
uses: actions/checkout@v3
14+
15+
- name: Check out Test Docs Repository
16+
uses: actions/checkout@v3
17+
with:
18+
repository: modm-ext/modm-data-test-docs
19+
path: ext/test/regression
20+
21+
- name: Setup Python 3.12
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: "3.12"
25+
26+
- name: Install Python Dependencies
27+
run: |
28+
pip3 install .
29+
30+
- name: Run Regression Tests
31+
run: |
32+
make run-regression-tests

test/convert_html.sh

Lines changed: 37 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,55 @@
1-
python3 tools/scripts/pdf2html.py --html --page 170 \
2-
--document ext/cache/stmicro-pdf/DS10693-v10.pdf --output test/data/html/DS10693-v10.html &
1+
python3 -m modm_data.pdf2html.stmicro --html --range 21:23 \
2+
--document ext/test/regression/stmicro/DS10329-v4.pdf --output test/data/html/stmicro/DS10329-v4.html &
33

4-
python3 tools/scripts/pdf2html.py --html --range 21:23 \
5-
--document ext/cache/stmicro-pdf/DS10329-v4.pdf --output test/data/html/DS10329-v4.html &
6-
7-
python3 tools/scripts/pdf2html.py --html --range 88:90 \
8-
--document ext/cache/stmicro-pdf/DS12117-v7.pdf --output test/data/html/DS12117-v7.html &
9-
10-
# Broken table header line, with partial boldness, double header line
11-
python3 tools/scripts/pdf2html.py --html --range 638:641 --page 1143 --range 3055:3058 \
12-
--document ext/cache/stmicro-pdf/RM0399-v3.pdf --output test/data/html/RM0399-v3.html &
13-
14-
# Broken table header line partial boldness
15-
python3 tools/scripts/pdf2html.py --html --range 433:434 \
16-
--document ext/cache/stmicro-pdf/RM0456-v2.pdf --output test/data/html/RM0456-v2.html &
17-
18-
# Broken table header line partial boldness >50%
19-
python3 tools/scripts/pdf2html.py --html --page 893 \
20-
--document ext/cache/stmicro-pdf/RM0313-v6.pdf --output test/data/html/RM0313-v6.html &
4+
python3 -m modm_data.pdf2html.stmicro --html --page 170 \
5+
--document ext/test/regression/stmicro/DS10693-v10.pdf --output test/data/html/stmicro/DS10693-v10.html &
216

227
# Double header line
23-
python3 tools/scripts/pdf2html.py --html --range 51:52 \
24-
--document ext/cache/stmicro-pdf/DS11250-v4.pdf --output test/data/html/DS11250-v4.html &
8+
python3 -m modm_data.pdf2html.stmicro --html --range 51:52 \
9+
--document ext/test/regression/stmicro/DS11250-v4.pdf --output test/data/html/stmicro/DS11250-v4.html &
10+
11+
python3 -m modm_data.pdf2html.stmicro --html --range 88:90 \
12+
--document ext/test/regression/stmicro/DS12117-v7.pdf --output test/data/html/stmicro/DS12117-v7.html &
2513

2614
# Double header line
27-
python3 tools/scripts/pdf2html.py --html --page 114 \
28-
--document ext/cache/stmicro-pdf/DS12556-v6.pdf --output test/data/html/DS12556-v6.html &
15+
python3 -m modm_data.pdf2html.stmicro --html --page 114 \
16+
--document ext/test/regression/stmicro/DS12556-v6.pdf --output test/data/html/stmicro/DS12556-v6.html &
2917

3018
# Header cells with line but <30% bold
31-
python3 tools/scripts/pdf2html.py --html --range 91:92 \
32-
--document ext/cache/stmicro-pdf/DS12930-v1.pdf --output test/data/html/DS12930-v1.html &
19+
python3 -m modm_data.pdf2html.stmicro --html --range 91:92 \
20+
--document ext/test/regression/stmicro/DS12930-v1.pdf --output test/data/html/stmicro/DS12930-v1.html &
3321

34-
# Multiple thick lines and repeated headers without correct pagination
35-
python3 tools/scripts/pdf2html.py --html --range 90:93 \
36-
--document ext/cache/stmicro-pdf/RM0090-v19pdf --output test/data/html/RM0090-v19.html &
3722

38-
# Header cells without line and >50% bold
39-
python3 tools/scripts/pdf2html.py --html --range 1354:1355 \
40-
--document ext/cache/stmicro-pdf/RM0453-v2.pdf --output test/data/html/RM0453-v2.html &
23+
# Multiple thick lines and repeated headers without correct pagination
24+
python3 -m modm_data.pdf2html.stmicro --html --range 90:93 \
25+
--document ext/test/regression/stmicro/RM0090-v19.pdf --output test/data/html/stmicro/RM0090-v19.html &
4126

42-
# Header cells without line and >50% bold
43-
python3 tools/scripts/pdf2html.py --html --range 3005:3006 \
44-
--document ext/cache/stmicro-pdf/RM0456-v2.pdf --output test/data/html/RM0456-v2.html &
27+
# Broken table header line partial boldness >50%
28+
python3 -m modm_data.pdf2html.stmicro --html --page 893 \
29+
--document ext/test/regression/stmicro/RM0313-v6.pdf --output test/data/html/stmicro/RM0313-v6.html &
4530

4631
# Table bottom line is out of template
47-
python3 tools/scripts/pdf2html.py --html --range 773:773 \
48-
--document ext/cache/stmicro-pdf/RM0360-v4.pdf --output test/data/html/RM0360-v4.html &
32+
python3 -m modm_data.pdf2html.stmicro --html --range 773:773 \
33+
--document ext/test/regression/stmicro/RM0360-v4.pdf --output test/data/html/stmicro/RM0360-v4.html &
4934

5035
# Heading 4 does not get recognized
51-
python3 tools/scripts/pdf2html.py --html --range 180:180 \
52-
--document ext/cache/stmicro-pdf/RM0367-v8.pdf --output test/data/html/RM0367-v8.html &
36+
python3 -m modm_data.pdf2html.stmicro --html --range 180:180 \
37+
--document ext/test/regression/stmicro/RM0367-v8.pdf --output test/data/html/stmicro/RM0367-v8.html &
38+
39+
# Broken table header line, with partial boldness, double header line
40+
python3 -m modm_data.pdf2html.stmicro --html --range 638:641 --page 1143 --range 3055:3058 \
41+
--document ext/test/regression/stmicro/RM0399-v3.pdf --output test/data/html/stmicro/RM0399-v3.html &
42+
43+
python3 -m modm_data.pdf2html.stmicro --html --range 265:265 \
44+
--document ext/test/regression/stmicro/RM0434-v9.pdf --output test/data/html/stmicro/RM0434-v9.html &
45+
46+
# Header cells without line and >50% bold
47+
python3 -m modm_data.pdf2html.stmicro --html --range 1354:1355 \
48+
--document ext/test/regression/stmicro/RM0453-v2.pdf --output test/data/html/stmicro/RM0453-v2.html &
5349

54-
python3 tools/scripts/pdf2html.py --html --range 265:265 \
55-
--document ext/cache/stmicro-pdf/RM0434-v9.pdf --output test/data/html/RM0434-v9.html &
50+
# Broken table header line partial boldness, Header cells without line and >50% bold
51+
python3 -m modm_data.pdf2html.stmicro --html --range 433:434 --range 3005:3006 \
52+
--document ext/test/regression/stmicro/RM0456-v2.pdf --output test/data/html/stmicro/RM0456-v2.html &
5653

5754
wait
5855

test/data/html/RM0456-v2.html

Lines changed: 0 additions & 7 deletions
This file was deleted.

test/data/html/DS11250-v4.html renamed to test/data/html/stmicro/DS11250-v4.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,7 @@
192192
<p>
193193
<b>Timing reference: 0.2 Vs - 0.8 Vs (Vs = V<sub>VDDD</sub>-D<sub>GND</sub>)</b>
194194
</p>
195-
<p>Explanation:</p>
196-
<ol>
197-
<li value="c">Q: SCK stable (low or high) before CS falling</li>
198-
<li value="d">P: SCK stable (low or high) after CS rising</li>
199-
</ol>
195+
<p>Explanation:<ol><li value="c">Q: SCK stable (low or high) before CS falling</li><li value="d">P: SCK stable (low or high) after CS rising</li></ol></p>
200196
<h3 id="section5.4">5.4 Error management</h3>
201197
<p>The device replies with an error response if one of the following errors has occurred:</p>
202198
<table id="table50">

test/data/html/DS12930-v1.html renamed to test/data/html/stmicro/DS12930-v1.html

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,41 @@
99
<b>Table 8. Port A alternate functions</b>
1010
</caption>
1111
<tr>
12-
<td colspan="2" rowspan="2">
13-
<b>Port</b>
14-
</td>
15-
<th class="thb">AF0</th>
16-
<th class="thb">AF1</th>
17-
<th class="thb">AF2</th>
18-
<th class="thb">AF3</th>
19-
<th class="thb">AF4</th>
20-
<th class="thb">AF5</th>
21-
<th class="thb">AF6</th>
22-
<th class="thb">AF7</th>
23-
<th class="thb">AF8</th>
24-
<th class="thb">AF9</th>
25-
<th class="thb">AF10</th>
26-
<th class="thb">AF11</th>
27-
<th class="thb">AF12</th>
28-
<th class="thb">AF13</th>
29-
<th class="thb">AF14</th>
30-
<th class="thb">AF15</th>
12+
<th colspan="2" rowspan="2" class="thb">Port</th>
13+
<th>AF0</th>
14+
<th>AF1</th>
15+
<th>AF2</th>
16+
<th>AF3</th>
17+
<th>AF4</th>
18+
<th>AF5</th>
19+
<th>AF6</th>
20+
<th>AF7</th>
21+
<th>AF8</th>
22+
<th>AF9</th>
23+
<th>AF10</th>
24+
<th>AF11</th>
25+
<th>AF12</th>
26+
<th>AF13</th>
27+
<th>AF14</th>
28+
<th>AF15</th>
3129
</tr>
3230
<tr>
33-
<td>SYS</td>
34-
<td>TIM1/2/16/1<br/>7/LPTIM1/<br/>HRTIM1</td>
35-
<td>SAI1/TIM3/<br/>4/5/HRTIM<br/>1</td>
36-
<td>LPUART/<br/>TIM8/LPTIM<br/>2/3/4/5/<br/>HRTIM1/<br/>DFSDM1</td>
37-
<td>I2C1/2/3/4/U<br/>SART1/<br/>TIM15/<br/>LPTIM2/<br/>DFSDM1/CE<br/>C</td>
38-
<td>SPI1/2/3/4/<br/>5/6/CEC</td>
39-
<td>SPI2/3/SAI1<br/>/3/I2C4/<br/>UART4/<br/>DFSDM1</td>
40-
<td>SPI2/3/6/<br/>USART1/2/<br/>3/6/UART7/<br/>SDMMC1</td>
41-
<td>SPI6/SAI2/<br/>4/UART4/5/<br/>8/LPUART/<br/>SDMMC1/<br/>SPDIFRX1</td>
42-
<td>SAI4/FDCA<br/>N1/FDACN<br/>2/TIM13/14<br/>/QUADSPI/<br/>FMC/SDM<br/>MC2/LCD/<br/>SPDIFRX1</td>
43-
<td>SAI2/4/TIM<br/>8/QUADSPI<br/>/SDMMC2/<br/>OTG1_HS/<br/>OTG2_FS/<br/>LCD</td>
44-
<td>I2C4/UART<br/>7/SWPMI1/<br/>TIM1/8/<br/>DFSDM1/<br/>SDMMC2/<br/>MDIOS/<br/>ETH</td>
45-
<td>TIM1/8/FMC<br/>/SDMMC1/<br/>MDIOS/<br/>OTG1_FS/<br/>LCD</td>
46-
<td>TIM1/DCMI/<br/>LCD/DSI/<br/>COMP</td>
47-
<td>UART5/<br/>LCD</td>
48-
<td>SYS</td>
31+
<th class="thb">SYS</th>
32+
<th class="thb">TIM1/2/16/1<br/>7/LPTIM1/<br/>HRTIM1</th>
33+
<th class="thb">SAI1/TIM3/<br/>4/5/HRTIM<br/>1</th>
34+
<th class="thb">LPUART/<br/>TIM8/LPTIM<br/>2/3/4/5/<br/>HRTIM1/<br/>DFSDM1</th>
35+
<th class="thb">I2C1/2/3/4/U<br/>SART1/<br/>TIM15/<br/>LPTIM2/<br/>DFSDM1/CE<br/>C</th>
36+
<th class="thb">SPI1/2/3/4/<br/>5/6/CEC</th>
37+
<th class="thb">SPI2/3/SAI1<br/>/3/I2C4/<br/>UART4/<br/>DFSDM1</th>
38+
<th class="thb">SPI2/3/6/<br/>USART1/2/<br/>3/6/UART7/<br/>SDMMC1</th>
39+
<th class="thb">SPI6/SAI2/<br/>4/UART4/5/<br/>8/LPUART/<br/>SDMMC1/<br/>SPDIFRX1</th>
40+
<th class="thb">SAI4/FDCA<br/>N1/FDACN<br/>2/TIM13/14<br/>/QUADSPI/<br/>FMC/SDM<br/>MC2/LCD/<br/>SPDIFRX1</th>
41+
<th class="thb">SAI2/4/TIM<br/>8/QUADSPI<br/>/SDMMC2/<br/>OTG1_HS/<br/>OTG2_FS/<br/>LCD</th>
42+
<th class="thb">I2C4/UART<br/>7/SWPMI1/<br/>TIM1/8/<br/>DFSDM1/<br/>SDMMC2/<br/>MDIOS/<br/>ETH</th>
43+
<th class="thb">TIM1/8/FMC<br/>/SDMMC1/<br/>MDIOS/<br/>OTG1_FS/<br/>LCD</th>
44+
<th class="thb">TIM1/DCMI/<br/>LCD/DSI/<br/>COMP</th>
45+
<th class="thb">UART5/<br/>LCD</th>
46+
<th class="thb">SYS</th>
4947
</tr>
5048
<tr>
5149
<td rowspan="13">

0 commit comments

Comments
 (0)