Skip to content

Repeated --import_dirs in cpp_golden_test implementation #236

@robrussell

Description

@robrussell

The import_dirs field of the cpp_golden_test 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 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions