google / google/emboss

Repeated `--import_dirs` in `cpp_golden_test` implementation

Open
#236 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
92
Forks
30
PR merge metrics
No merged PRs in 30d

Description

The `import_dirs` field of the [cpp_golden_test](https://github.com/google/emboss/blob/41c1b64588792e23e60a2cef85b1ea4ed519ca7a/compiler/back_end/cpp/build_defs.bzl#L68) build rule isn't used in any current tests. If it were set, for example `import_dirs = ["foo"]`, then the implementation in `build_defs.bzl` will append `["--import-dir=" + d for d in import_dirs]` to flags passed for `main` in `run_one_golden_test.py`. So `OneGoldenTest` is instantiated with `["--import-dir=somepath/foo"]`. But then in [test_golden_file](https://github.com/google/emboss/blob/41c1b64588792e23e60a2cef85b1ea4ed519ca7a/compiler/back_end/cpp/one_golden_test.py#L49-L50) the frontend args are constructed with
```
for include_dir in self.include_dirs:
front_end_args.extend(["--import-dir", include_dir])
```
So the commandline for the frontend that's actually executed will include the sequence `--import-dir --import-dir=somepath/foo`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.