Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/actions/build-and-test-with-slang/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,18 @@ runs:
run: python tools/ci.py test-examples -p

# Upload Crashpad Reports
# Upload the whole database rather than just reports/: Windows writes minidumps directly to
# reports/, but POSIX Crashpad leaves them in pending/ until the Python harness copies them
# over, which never happens when the C++ sgl_tests step itself crashes (#1062).
- name: Upload Crashpad Reports
if: always() && contains(inputs.flags, 'crashpad')
uses: actions/upload-artifact@v7
with:
name: crash-reports-${{ inputs.os }}-${{ inputs.platform }}-${{ inputs.compiler }}-${{ inputs.config }}
path: .crashpad/reports/
path: .crashpad/
# .crashpad is a dot-directory; upload-artifact treats its contents as hidden and skips
# them by default, which if-no-files-found:ignore would silently mask.
include-hidden-files: true
if-no-files-found: ignore

# Generate Coverage Report
Expand Down
13 changes: 13 additions & 0 deletions tests/sgl/sgl_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
#include "sgl/sgl.h"
#include "sgl/device/device.h"
#include "sgl/device/agility_sdk.h"
#include "sgl/core/config.h"
#include "sgl/core/object.h"
#include "sgl/core/logger.h"
#include "sgl/core/error.h"
#include "sgl/utils/crashpad.h"

#define DOCTEST_CONFIG_IMPLEMENT
#include <doctest/doctest.h>
Expand Down Expand Up @@ -50,6 +52,17 @@ int main(int argc, char** argv)
{
sgl::testing::static_init();

#if SGL_HAS_CRASHPAD
// Capture teardown faults (#1062) as a minidump. The database must be the `.crashpad`
// directory CI archives, not the default beside the binary. Arming is best-effort:
// these diagnostics must never affect the test result.
try {
sgl::crashpad::start_handler({}, ".crashpad");
} catch (const std::exception& e) {
sgl::log_warn("Failed to start Crashpad handler: {}", e.what());
}
#endif

doctest::Context context(argc, argv);
context.setOption("--reporters", "sgl");

Expand Down
Loading