• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

eclipse-aascw / aas-core-codegen / 36298615561
90%

Build:
DEFAULT BRANCH: main
Ran 27 Sep 2026 06:03AM UTC
Jobs 3
Files 299
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Sep 2026 05:55AM UTC coverage: 88.307% (+0.2%) from 88.079%
36298615561

push

github

web-flow
Transpile modulo, negation and abs (#775)

We transpile the modulo operator ``%``, the arithmetic negation (unary
minus) and the built-in ``abs`` in the verification functions and
the invariants for all the targets.

The parse tree gets the nodes ``Mod`` and ``Neg``, while ``abs``
becomes a built-in function next to ``len``. The negation of a numeric
literal is still parsed as a constant. The type inference allows
the modulo only on integers and lengths, and the negation and ``abs``
only on integers and floating-point numbers, since the lengths are
unsigned in C++. The constrained primitives now behave like their
constrainees in the arithmetic operations.

The meta-model is written in Python, where the division is floored
so that the remainder takes the sign of the divisor (``-7 % 3 == 2``).
C#, C++, Go, Java and TypeScript truncate the division instead, so that
their native remainder takes the sign of the dividend
(``-7 % 3 == -1``). The two coincide only when the operands have
the same sign, but the invariants must behave the same in all
the SDKs. Therefore, we do not transpile the modulo to the native
operator. Java uses ``Math.floorMod``, while C#, C++, Go and TypeScript
call a public helper ``FloorMod`` (``floorMod`` in TypeScript) which
we generate in the verification module only if the meta-model uses
the modulo. Go additionally gets ``AbsInt64`` as its standard library
has no integer ``abs``. A native modulo remains only where both
operands are known to be non-negative.

We generate unit tests for the modulo and ``abs`` in all the SDKs from
the cases in the new module ``aas_core_codegen.tests_common``, which
holds the data shared by the generators of unit tests across
the targets. The expected values are computed by Python itself, so that
the clients can look up the behavior and be certain about it.

Along the way, Java now renders the integer literals as ``long``
literals when passed to verification functions, as Java does not
convert an ``in... (continued)

704 of 764 new or added lines in 38 files covered. (92.15%)

1 existing line in 1 file now uncovered.

40086 of 45394 relevant lines covered (88.31%)

2.65 hits per line

Uncovered Changes

Lines Coverage ∆ File
11
76.79
0.57% aas_core_codegen/golang/transpilation.py
7
72.75
0.73% aas_core_codegen/cpp/transpilation.py
6
78.69
0.63% aas_core_codegen/csharp/transpilation.py
6
75.8
0.63% aas_core_codegen/java/transpilation.py
6
88.43
5.4% aas_core_codegen/parse/tree.py
6
77.9
0.3% aas_core_codegen/typescript/transpilation.py
3
75.51
0.51% aas_core_codegen/cpp/optionaling.py
3
74.17
0.53% aas_core_codegen/golang/pointering.py
3
75.07
0.57% aas_core_codegen/java/optional.py
3
87.7
0.01% aas_core_codegen/parse/_rules.py
3
73.89
0.58% aas_core_codegen/python/transpilation.py
2
94.91
-0.08% aas_core_codegen/intermediate/_types.py
1
78.64
1.33% aas_core_codegen/intermediate/type_inference.py

Coverage Regressions

Lines Coverage ∆ File
1
78.64
1.33% aas_core_codegen/intermediate/type_inference.py
Jobs
ID Job ID Ran Files Coverage
1 3.10 - 36298615561.1 27 Sep 2026 06:04AM UTC 299
88.31
GitHub Action Run
2 3.11 - 36298615561.2 27 Sep 2026 06:04AM UTC 299
88.31
GitHub Action Run
3 3.12 - 36298615561.3 27 Sep 2026 06:04AM UTC 299
88.31
GitHub Action Run
Source Files on build 36298615561
  • Tree
  • List 299
  • Changed 31
  • Source Changed 0
  • Coverage Changed 31
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • bf62d182 on github
  • Prev Build on main (#36297600171)
  • Next Build on main (#36299589704)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc