Skip to content

Commit

Permalink
fixed source link issue
Browse files Browse the repository at this point in the history
fixed source link issue
  • Loading branch information
stanley31huang committed Jun 27, 2024
1 parent bada45e commit a236fde
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ None
```

- **file:**
[source file](accelerator.pxu:1-34)
[source file](accelerator.pxu#L1)

- **environ:**
HWRNG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ e.g. DIGITAL_IO_LOOPBACK_GPIO=1:733:2:765 3:734:4:766
```

- **file:**
[source file](jobs.pxu:1-19)
[source file](jobs.pxu#L1)

- **environ:**
DIGITAL_IO_LOOPBACK_GPIO
Expand Down Expand Up @@ -52,7 +52,7 @@ e.g. DIGITAL_IO_LOOPBACK_SERIAL=1:2:1:6 2:3:2:7 3:4:3:8 4:5:4:9
```

- **file:**
[source file](jobs.pxu:41-59)
[source file](jobs.pxu#L41)

- **environ:**
DIGITAL_IO_LOOPBACK_SERIAL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ $ tcp_multi_connections.py server -p 1024 -e 1223
```

- **file:**
[source file](jobs.pxu:24-43)
[source file](jobs.pxu#L24)

- **environ:**
TCP_MULTI_CONNECTIONS_SERVER_IP TCP_MULTI_CONNECTIONS_START_PORT TCP_MULTI_CONNECTIONS_END_PORT TCP_MULTI_CONNECTIONS_PAYLOAD_SIZE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Sprate by comma, and also colon to define a range of ports
```

- **file:**
[source file](jobs.pxu:1-19)
[source file](jobs.pxu#L1)

- **environ:**
EXPECTED_GADGET_GPIO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ e.g. IIO_SENSORS=0:pressure 1:accelerometer 2:humidityrelative
```

- **file:**
[source file](jobs.pxu:1-13)
[source file](jobs.pxu#L1)

- **environ:**
IIO_SENSORS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ None
```

- **file:**
[source file](jobs.pxu:15-29)
[source file](jobs.pxu#L15)

- **environ:**
PLAINBOX_SESSION_SHARE GL_VENDOR GL_RENDERER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ None
```

- **file:**
[source file](jobs.pxu:68-81)
[source file](jobs.pxu#L68)

- **environ:**
OPTEE_CASES
Expand All @@ -44,7 +44,7 @@ None
```

- **file:**
[source file](jobs.pxu:83-96)
[source file](jobs.pxu#L83)

- **environ:**
OPTEE_CASES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ e.g. OTG=USB-C1:11200000 USB-Micro:112a1000
```

- **file:**
[source file](jobs.pxu:1-17)
[source file](jobs.pxu#L1)

- **environ:**
OTG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RPMSG_RP_FIRMWARE_PATH="/home/user1"
```

- **file:**
[source file](jobs.pxu:36-49)
[source file](jobs.pxu#L36)

- **environ:**
RPMSG_RP_FIRMWARE_MAPPING RPMSG_RP_FIRMWARE_PATH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SERIAL_CONSOLE_PORTS=USB:/dev/ttyUSB1:115200
```

- **file:**
[source file](jobs.pxu:1-18)
[source file](jobs.pxu#L1)

- **environ:**
SERIAL_CONSOLE_PORTS
Expand Down Expand Up @@ -51,7 +51,7 @@ SERIAL_PORTS="RS485:/dev/ttyS0:9600 RS485:/dev/ttyS1:9600 RS232:/dev/ttyS2:11520
```

- **file:**
[source file](jobs.pxu:44-61)
[source file](jobs.pxu#L44)

- **environ:**
SERIAL_PORTS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Check if the SPI devices exist
```

- **file:**
[source file](jobs.pxu:1-17)
[source file](jobs.pxu#L1)

- **environ:**
SPI_DEVICE_COUNT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ copies and all further tests will be compared against these.
```

- **file:**
[source file](boot.pxu:1-13)
[source file](boot.pxu#L1)

- **environ:**
LD_LIBRARY_PATH
Expand All @@ -42,7 +42,7 @@ Check there are no failed services after the cold reboot
```

- **file:**
[source file](boot.pxu:43-56)
[source file](boot.pxu#L43)

- **environ:**
LD_LIBRARY_PATH
Expand Down Expand Up @@ -74,7 +74,7 @@ e.g.
```

- **file:**
[source file](boot.pxu:16-40)
[source file](boot.pxu#L16)

- **environ:**
STRESS_BOOT_WAKEUP_DELAY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This test will check your system shutdown/booting cycle via dbus command.
```

- **file:**
[source file](powermanagement-strict-confinement.pxu:1-21)
[source file](confinement.pxu#L1)

- **environ:**
STRESS_BOOT_WAKEUP_DELAY RTC_DEVICE_FILE
Expand All @@ -46,7 +46,7 @@ This is a job to check system bootup without error after cold reboot.
```

- **file:**
[source file](powermanagement-strict-confinement.pxu:24-36)
[source file](confinement.pxu#L24)

- **environ:**
LD_LIBRARY_PATH
Expand All @@ -67,7 +67,7 @@ This is a job to check system bootup without error after warm reboot.
```

- **file:**
[source file](powermanagement-strict-confinement.pxu:59-71)
[source file](confinement.pxu#L59)

- **environ:**
LD_LIBRARY_PATH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Generate resource for all Video Codec scenarios.
```

- **file:**
[source file](jobs.pxu:1-9)
[source file](jobs.pxu#L1)

- **environ:**
VIDEO_CODEC_JSON_CONFIG_NAME VIDEO_CODEC_TESTING_DATA PLAINBOX_PROVIDER_DATA
Expand Down
18 changes: 16 additions & 2 deletions contrib/checkbox-ce-oem/tools/dump_testcase_readme.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
import os
import re
import copy
import json
import yaml
Expand Down Expand Up @@ -378,7 +379,7 @@ def sort_by_directory_for_environ(data):
{{ case[key] }}
```
{%- elif key in ['file'] -%}
[source file]({{ case[key] | basename }})
[source file]({{ case[key] | gen_link }})
{%- else -%}
{{ case[key] }}
{%- endif %}
Expand All @@ -388,6 +389,19 @@ def sort_by_directory_for_environ(data):
"""


def convert_job_origin_relative_link(filename):
filename = os.path.basename(filename)
re_match = re.search(r"([\w\.]+):([0-9]+)-.*", filename)
if re_match:
return f"{re_match.group(1)}#L{re_match.group(2)}"

re_match = re.search(r"([\w\.]+):.*", filename)
if re_match:
return f"{re_match.group(1)}"

return filename


def render_readme_with_env(unit, env_cases, full_cases_set):
JOB_OUTPUT_MAPPING = {
"job": [
Expand All @@ -413,7 +427,7 @@ def render_readme_with_env(unit, env_cases, full_cases_set):
detailed_cases_with_env.append(full_cases_set[case])

jinja2_env = jinja2.Environment(loader=jinja2.BaseLoader)
jinja2_env.filters["basename"] = os.path.basename
jinja2_env.filters["gen_link"] = convert_job_origin_relative_link
jinja_template = jinja2_env.from_string(README_TEMPLATE)
return jinja_template.render(
unit=unit,
Expand Down

0 comments on commit a236fde

Please sign in to comment.