mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
Use macOS signpost api for tracing (#14871)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com> Co-authored-by: Don Isaac <donald.isaac@gmail.com> Co-authored-by: DonIsaac <DonIsaac@users.noreply.github.com> Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
@@ -760,21 +760,15 @@ pub const CommandLineReporter = struct {
|
||||
comptime reporters: TestCommand.Reporters,
|
||||
comptime enable_ansi_colors: bool,
|
||||
) !void {
|
||||
const trace = bun.tracy.traceNamed(@src(), comptime brk: {
|
||||
if (reporters.text and reporters.lcov) {
|
||||
break :brk "TestCommand.printCodeCoverageLCovAndText";
|
||||
}
|
||||
|
||||
if (reporters.text) {
|
||||
break :brk "TestCommand.printCodeCoverageText";
|
||||
}
|
||||
|
||||
if (reporters.lcov) {
|
||||
break :brk "TestCommand.printCodeCoverageLCov";
|
||||
}
|
||||
|
||||
const trace = if (reporters.text and reporters.lcov)
|
||||
bun.perf.trace("TestCommand.printCodeCoverageLCovAndText")
|
||||
else if (reporters.text)
|
||||
bun.perf.trace("TestCommand.printCodeCoverageText")
|
||||
else if (reporters.lcov)
|
||||
bun.perf.trace("TestCommand.printCodeCoverageLCov")
|
||||
else
|
||||
@compileError("No reporters enabled");
|
||||
});
|
||||
|
||||
defer trace.end();
|
||||
|
||||
if (comptime !reporters.text and !reporters.lcov) {
|
||||
@@ -1335,7 +1329,7 @@ pub const TestCommand = struct {
|
||||
strings.startsWith(arg, "./") or
|
||||
strings.startsWith(arg, "../") or
|
||||
(Environment.isWindows and (strings.startsWith(arg, ".\\") or
|
||||
strings.startsWith(arg, "..\\")))) break true;
|
||||
strings.startsWith(arg, "..\\")))) break true;
|
||||
} else false) {
|
||||
// One of the files is a filepath. Instead of treating the arguments as filters, treat them as filepaths
|
||||
for (ctx.positionals[1..]) |arg| {
|
||||
@@ -1453,9 +1447,9 @@ pub const TestCommand = struct {
|
||||
|
||||
if (has_file_like == null and
|
||||
(strings.hasSuffixComptime(filter, ".ts") or
|
||||
strings.hasSuffixComptime(filter, ".tsx") or
|
||||
strings.hasSuffixComptime(filter, ".js") or
|
||||
strings.hasSuffixComptime(filter, ".jsx")))
|
||||
strings.hasSuffixComptime(filter, ".tsx") or
|
||||
strings.hasSuffixComptime(filter, ".js") or
|
||||
strings.hasSuffixComptime(filter, ".jsx")))
|
||||
{
|
||||
has_file_like = i;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user