Tags: EricRahm/emboss
Tags
Update docs to include notes on build.json Add details on how to update `build.json` and generate the build files.
Merge pull request google#231 from jasongraffius/fix-paths embossc: Revert path manipulation
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`.
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
Merge pull request google#218 from reventlov/design_docs_compiler Document the `embossc` compiler design
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.
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
Add action to check Python formatting with black (google#177)
Add action to check Python formatting with black (google#177)
Merge pull request google#159 from jasongraffius/add-bazel-test-workflow Add Github action to run Bazel tests for every PR