|
| 1 | +# Linux regression and coverage |
| 2 | + |
| 3 | +The regression workflow builds and tests all 17 profiles on every pull request to |
| 4 | +`dev` or `master`. Its check name is `auto_tests / run_tests`. Workflow |
| 5 | +success alone does not enforce merging: repository rules must separately require |
| 6 | +that check. The staged Otterdog ruleset must remain disabled until this workflow |
| 7 | +is available on `dev`. |
| 8 | + |
| 9 | +Run `scripts/install.sh` on Ubuntu 24.04, then use GCC 14 and its matching gcov with |
| 10 | +CMake and Ninja: |
| 11 | + |
| 12 | +```sh |
| 13 | +TX_COVERAGE=ON ./scripts/build.sh all |
| 14 | +TX_COVERAGE=ON ./scripts/test.sh all |
| 15 | +python3 test/cmake/usbx/test_runner.py |
| 16 | +``` |
| 17 | + |
| 18 | +The installer installs gcovr 8.6 in a virtual environment and exports its location |
| 19 | +through GitHub Actions environment files. Outside Actions, activate the reported |
| 20 | +virtual environment before running coverage. `CC` and `GCOV` can select matching |
| 21 | +compiler and coverage executables. The default build and test concurrency is four. |
| 22 | +CTest runs each case once; failing cases are not retried into a passing result. |
| 23 | + |
| 24 | +`dependencies.txt` records immutable ThreadX, FileX and NetX Duo revisions. FileX |
| 25 | +PR #106 is open at the pinned revision; this setup does not assume it has merged. |
| 26 | +Existing dependency checkouts must be clean and match their pins. Remove an old |
| 27 | +checkout explicitly when updating a pin. The ThreadX bootstrap supplies JUnit |
| 28 | +output without runtime edits to dependency files. |
| 29 | + |
| 30 | +Pass profile names instead of `all` to either script, or select them in the manual |
| 31 | +workflow. Build and test output names the exact selection. JUnit files, test logs |
| 32 | +and `build/results.txt` report actual counts and elapsed test times. The generic |
| 33 | +profile's single CTest case is a build-only placeholder, not a functional USB test. |
| 34 | + |
| 35 | +Every selected profile is instrumented when `TX_COVERAGE=ON`, including the generic |
| 36 | +build. Raw JSON, Cobertura XML and HTML use one inclusion policy: all compiled C |
| 37 | +sources matching `common/*/src/*.c`. Host controllers, simulators, optional classes |
| 38 | +and untested source lines remain in the denominator. Dependency and test code are |
| 39 | +outside that policy. No profile-specific diagnostic exclusion affects the union. |
| 40 | + |
| 41 | +Each input must have nonempty JSON, XML and HTML, measured source lines, and |
| 42 | +repository-relative paths. The merger checks that JSON and XML agree and that its |
| 43 | +measured and covered source-line sets equal the exact unions of its inputs. |
| 44 | +Reports and execution counters are cleared before each test selection. A subset |
| 45 | +cannot consume an earlier full run's reports or publish complete coverage. |
| 46 | +Available diagnostics and coverage survive failing tests; missing coverage itself |
| 47 | +fails the runner. Full-suite line and branch floors are in `coverage-floors.json`. |
| 48 | +Standalone polling produces more than six billion positive hits in a single |
| 49 | +profile. Direct GCC 14 output confirms balanced loop counts. Collection uses a |
| 50 | +2^40 suspicious-hit threshold instead of gcovr's default 2^32 heuristic; negative |
| 51 | +counts and parse errors remain fatal, and no lines are ignored to obtain a report. |
| 52 | + |
| 53 | +Only successful complete runs on `master` can deploy Pages. Callers grant the |
| 54 | +permissions required for GitHub to validate the pinned reusable workflow's |
| 55 | +separate deployment job; its test job retains narrower permissions. The template |
| 56 | +bounds installation, build and test steps and uploads diagnostics on failure. |
| 57 | +The manual selector is parsed from the event file, never interpolated as shell |
| 58 | +code. All pull requests retain the full matrix; there is no conditional routing. |
| 59 | + |
| 60 | +Dependabot targets `dev` once its configuration is present on the default branch. |
| 61 | +The cross-repository workflow/bootstrap revision requires a separate review and |
| 62 | +is excluded from routine action updates. |
0 commit comments