c3c icon indicating copy to clipboard operation
c3c copied to clipboard

Proposal: Translating Python Tester Script to C for Enhanced Stack Trace Capturing in Meson Build

Open TheCowboyHermit opened this issue 1 year ago • 1 comments

Context

In our current Meson Build setup for c3c, we utilize tester.py for running tests. This script launches a separate Python executable to execute the tests, resulting in an isolated stack trace and execution environment.

Issue

This separation poses a challenge in effectively capturing and analyzing stack traces, especially when a test case fails during compilation. Typically, in a Meson build, if a Python executable wasn't required to run the test cases, we could obtain a stack trace from a failed test case using a command like:

meson test -C build --gdb "Test Suite - casts - cast_expr"

However, due to the nature of the Python script execution, this approach is not feasible.

Proposal

To enhance our debugging capabilities, particularly for capturing useful stack traces during compilation failures in unit tests, I propose we discuss the possibility of translating the existing Python script (tester.py) to a C3C implementation. This transition would potentially allow us to integrate more closely with the Meson build environment and leverage its native testing and debugging tools, such as gdb.

Benefits

  1. Improved stack trace capturing for compilation failures in tests.
  2. Tighter integration with Meson's native testing and debugging features.
  3. Potentially increased performance and efficiency in test execution.

I'm looking forward to discussing this possibility further and hearing any thoughts or concerns about this proposed transition.

TheCowboyHermit avatar Dec 31 '23 01:12 TheCowboyHermit

Some work in this direction is already done. The Python implementation will be replaced with a C3 one.

lerno avatar Jan 10 '24 00:01 lerno