bazelbuild / bazelbuild/bazel

Use cross-platform C++ code for testing tools in @bazel_tools

Open
#15,838 4 comments 1 reaction 0 assignees View on GitHub
coverage not stale P3 team-Rules-CPP type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the feature request:

There are testing/test coverage tools which are written either in bash or OS-specific C++ (such as tw.exe that uses winapi calls).

This FR is a proposal to refactor these tools to use cross-platform C++ code instead. For example, filesystem OS calls can be replaced with C++17 `` code (or boost/filesystem).

List of tools-candidates to be rewritten:

https://github.com/bazelbuild/bazel/tree/master/tools/test
- [x] collect_coverage.sh
- [x] collect_cc_coverage.sh
- [ ] generate-xml.sh (partially done with windows/xml_main.cc)
- [ ] test-setup.sh
- [ ] windows/tw_main.cc
- [ ] windows/xml_main.cc

### What underlying problem are you trying to solve with this feature?

Make Bazel test-related tools (including coverage tools) truly cross-platform.

This FR (when implemented) will allow us to implement normal `bazel coverage` cmd support on windows: https://github.com/bazelbuild/bazel/issues/6374

### Which operating system are you running Bazel on?

Windows

### What is the output of `bazel info release`?

development version

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.

`bazel build //src:bazel-dev.exe`

commit: d35f923b098e4dc9c90b1ab66b413c216bdee638

### What's the output of `git remote get-url origin; git rev-parse master; git rev-parse HEAD` ?

```text
d35f923b098e4dc9c90b1ab66b413c216bdee638
```

### Have you found anything relevant by searching the web?

No

### Any other information, logs, or outputs that you want to share?

No

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the candidate tools under tools/test, especially generate-xml.sh, test-setup.sh, windows/tw_main.cc, and windows/xml_main.cc, along with the already completed coverage-tool changes. Identify the platform-specific behavior each remaining tool requires and the existing Windows coverage path. Done means the selected testing tools use cross-platform C++ code and support the intended cross-platform test and coverage workflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, cpp
Domain
build-system, operating-systems, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.