Skip to content

Repository files navigation

CodeGen Compare Tool

Test Python 3.8+ License: MIT Release

🇻🇳 Tiếng Việt

CodeGen Compare Tool

Compare two AUTOSAR MATLAB/Simulink code-generation snapshots and focus on the changes that need review.

The tool filters generator noise that it can prove is harmless, then summarizes changes to generated C/C++, ARXML, RTE access and A2L objects.

If a difference cannot be proven to be noise, it remains a real change.

Quick start

Download compare-tool.exe or compare_tool.pyz from the latest release. Both accept the options shown below.

To run from source:

git clone https://github.com/longvo92/codegen-compare-tool.git
cd codegen-compare-tool

For downloaded builds, replace python -m compare_tool with compare-tool.exe or python compare_tool.pyz.

Create a self-contained HTML report:

python -m compare_tool baseline current --report report.html

Print only a terminal summary:

python -m compare_tool baseline current --no-report

The terminal mode shows a per-model Overview, AUTOSAR/A2L changes, consistency warnings, effective compare settings, hunk-classification totals and one summary for each non-identical file. Add --check-consistency to validate CURRENT generated RTE calls against CURRENT ARXML declarations. It does not print individual hunks, source diffs or create HTML.

Open the desktop viewer:

python -m compare_tool

The viewer requires PySide6. The CLI and compare_tool.pyz use only the Python standard library.

Folders and ZIP archives are accepted as inputs.

Outputs

Output Use it for
Desktop viewer Interactive side-by-side review
HTML report Sharing or publishing as a CI artifact
--no-report Detailed terminal review and diagnostics without generated files
--json Structured pipeline processing
--sarif Code-scanning annotations

The comparison engine also reports:

  • model/SWC ownership;
  • ports, port interfaces, runnables and events;
  • Rte_* access points;
  • A2L CHARACTERISTIC and MEASUREMENT objects;
  • possible incomplete regeneration across ARXML, A2L and generated C;
  • generated RTE calls that disagree with CURRENT ARXML access declarations when --check-consistency is enabled.

Old/new regeneration warnings remain advisory. The optional CURRENT-tree check is disabled by default; when enabled, a fail finding exits 1, an incomplete consistency scan exits 2, and a warn finding does not change the exit code. No consistency result changes a file verdict.

Verdicts

Verdict Meaning
Modified A real change needs review
Comment Only comments changed
Unimportant Only proven generator noise changed
Added / Deleted The file exists on one side only
Identical No difference
Not compared The file could not be read or compared

CI exit codes

Code Meaning
0 No real changes
1 Real changes found
2 Comparison incomplete or failed

--exit-zero converts exit code 1 to 0. It never suppresses exit code 2.

Requirements

  • Python 3.8 or newer
  • No server, database or network access at runtime
  • PySide6 only for the desktop viewer
  • Self-contained HTML reports with no CDN or external assets

Documentation

Run python -m compare_tool --help for the complete CLI reference.

License

MIT © 2026 Long Vo Thien

About

Diff two AUTOSAR/Simulink codegen folders and see only the real changes — noise filtered, self-contained HTML report, zero dependencies

Topics

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages