Skip to content

Tags: EricRahm/emboss

Tags

v2025.1002.234536

Toggle v2025.1002.234536's commit message
Update docs to include notes on build.json

Add details on how to update `build.json` and generate the build files.

v2025.1001.182038

Toggle v2025.1001.182038's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request google#231 from jasongraffius/fix-paths

embossc: Revert path manipulation

v2025.0708.224530

Toggle v2025.0708.224530's commit message
Add C++ golden file test suite

This change introduces a robust, granular testing infrastructure for the C++ backend using golden files. This test suite serves as a critical safety net to enable safe and efficient refactoring of the code generator in the future.

By comparing generated code against a set of "golden" (known-good) header files, we can quickly detect any unintended changes or regressions.

Key Features:

*   **Granular Tests:** Each golden file comparison is a standalone `py_test` target, allowing for parallel execution and precise failure identification.
*   **`cpp_golden_test` Macro:** A new Starlark macro, `cpp_golden_test`, has been added to `compiler/back_end/cpp/build_defs.bzl`. This simplifies adding new golden tests by abstracting away the underlying `py_test` implementation details.
*   **Debugging:** To simplify the diagnosis of regressions, test failures produce a `diff` of the generated file against its golden counterpart.
*   **Full Coverage:** The suite includes tests for all `.emb` files in the `testdata` directory, including those with complex dependencies and imports.

Usage:

**To run all C++ golden tests:**
```
bazel test //compiler/back_end/cpp/... --test_tag_filters=golden
```

**To run a single golden test:**
```
bazel test //compiler/back_end/cpp:bits_golden_test
```

**To add a new golden test:**
1.  Add your `.emb` file to `testdata/`.
2.  Generate the corresponding golden `.emb.h` file (e.g., by temporarily modifying and running the `generate_golden_files.sh` script via a `sh_binary`).
3.  Copy the new golden file into `testdata/golden_cpp/`.
4.  Add a `cpp_golden_test()` rule to `compiler/back_end/cpp/BUILD`.

v2025.0702.234643

Toggle v2025.0702.234643's commit message
Rename Message.HasField to Message.has_field

This change refactors `ir_data.Message.HasField` to `ir_data.Message.has_field`
to conform to PEP-8 naming conventions. All call sites have been updated.

Fixes #google#221

v2025.0701.220551

Toggle v2025.0701.220551's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request google#218 from reventlov/design_docs_compiler

Document the `embossc` compiler design

v2024.1002.213717

Toggle v2024.1002.213717's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Restructure ACTION and GOTO tables. (google#194)

With this change, the `Parser.action` and `.goto` tables are now 2-layer
hash tables, using states as the keys for the outer tables and symbols
as the keys for the inner tables.  Functionally, this means that
`action[state, symbol]` becomes `action[state][symbol]`, and likewise
for `goto`.

This also allows the `expected` table to be eliminated, as it can be
quickly computed from `action[state]` when needed.

v2024.0911.230805

Toggle v2024.0911.230805's commit message
Cast to ValueType before ValueIsOk check

This allows using a larger backing value type to assign a UInt or Int
value when the value itself fits within the range of the internal value
type. Previously this would fail to compile if `-Wshorten-64-to-32` was
specified when building with `clang`:

```
UIntView<FixedSizeViewParameters<16, AllValuesAreOk>> view;
size_t value = 200;
view.TryToWrite(value);
```

Fixes google#185

v2024.0911.231000

Toggle v2024.0911.231000's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add action to check Python formatting with black (google#177)

v2024.0911.193041

Toggle v2024.0911.193041's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add action to check Python formatting with black (google#177)

v2024.0731.155328

Toggle v2024.0731.155328's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request google#159 from jasongraffius/add-bazel-test-workflow

Add Github action to run Bazel tests for every PR