`enableBazelEnvSupport` behavior breaks test executions relying on memory allocation free test execution

Đang mở
#2,881 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
cpp
Lĩnh vực
build-system, testing-qa

Hướng nghiên cứu

Bắt đầu với src/catch2/catch_config.cpp tại các dòng 24-29 và 222-227, sau đó tái hiện lỗi bằng cách sử dụng bazel test với một test từ chối các lần cấp phát mới. Kiểm tra enableBazelEnvSupport thay đổi hành vi của reporter như thế nào và xác minh rằng các test không cấp phát bộ nhớ აღარ còn thất bại, trong khi hỗ trợ tường minh vẫn khả dụng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Describe the bug

Executing a test with Bazel that requires a memory allocation free test execution breaks due to the memory allocation done here.

Expected behavior

The test framework should not behave differently based on the build system that is used.
Ideally, Bazel would set the xml reporter in case it detects catch.
Since this is beyond the scope of this issue, an alternative solution would be to give the user the option to disable this behavior.
Currently, you can only enable this explicitly or it is automatically enabled if used with Bazel: https://github.com/catchorg/Catch2/blob/4e8d92bf02f7d1c8006a0e7a5ecabd8e62d98502/src/catch2/catch_config.cpp#L24C21-L29

Reproduction steps
Steps to reproduce the bug.

  • Have a function that fails/throws if someone uses new
  • Execture the test with bazel test
  • Boom

Platform information:

  • OS: Ubuntu 20.04
  • Compiler+version: GCC 9.3 / Clang 12
  • Catch version: tested with 3.1.0 and 3.6.0 (but should happen with 3.x)

Additional context
Add any other context about the problem here.

Ngôn ngữ chính
C++
Star
21.6k
Fork
3.4k
Merge trung bình
3 ngày 12 giờ
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của catchorg/Catch2

Tất cả issue của catchorg/Catch2

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.