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.
The
import_dirsfield of the cpp_golden_test build rule isn't used in any current tests. If it were set, for exampleimport_dirs = ["foo"], then the implementation inbuild_defs.bzlwill append["--import-dir=" + d for d in import_dirs]to flags passed formaininrun_one_golden_test.py. SoOneGoldenTestis instantiated with["--import-dir=somepath/foo"]. But then in test_golden_file the frontend args are constructed withSo the commandline for the frontend that's actually executed will include the sequence
--import-dir --import-dir=somepath/foo.