Skip to content

"# time=..." directive #16

@isaacs

Description

@isaacs

It'd be nice to have a standard way to pass test duration (ie, the amount of time it took for a test to complete), as well as the total time for the set.

I've been experimenting with this approach:

1..3
ok 1 flurb is fast # time=1.234ms
ok 2 blub is slow # time=432.543ms
not ok 3 slow failure # time=501.3ms
# failed 1 of 3 tests
# time=942.5ms

Of course, it could be put in a yaml diag as well, but since diags are typically not printed for passing tests, that doesn't help in the typical case where you have lots of passing tests, but want to optimize just the slow ones.

The directive would look like /time=((?:[1-9][0-9]*|0)(?:\.[0-9]+)?)(ms|s)/i where $1 is the number and $2 is the label (either seconds or ms).

I don't expect that this would conflict with todo or skip directives, since todo/skip test points are usually near-immediate anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions