summaryrefslogtreecommitdiff
path: root/tool/lib
diff options
context:
space:
mode:
authorNaoto Ono <onoto1998@gmail.com>2024-03-25 13:42:28 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2024-04-03 16:17:30 +0900
commit56ecd8038ac406a62b3a77b59b2a95ac3f9bd9b8 (patch)
treef98278d456e5de477bea7b92c694b17b88adcf03 /tool/lib
parentb664590c4d7bb6cd4f48c61c3d8a480cd887672c (diff)
Launchable: Add lineNumber field
Diffstat (limited to 'tool/lib')
-rw-r--r--tool/lib/test/unit.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb
index a748090b26..d758b5fb02 100644
--- a/tool/lib/test/unit.rb
+++ b/tool/lib/test/unit.rb
@@ -1374,7 +1374,8 @@ module Test
def record(suite, method, assertions, time, error, source_location = nil)
if writer = @options[:launchable_test_reports]
- if path = (source_location || suite.instance_method(method).source_location).first
+ if loc = (source_location || suite.instance_method(method).source_location)
+ path, lineno = loc
# Launchable JSON schema is defined at
# https://github.com/search?q=repo%3Alaunchableinc%2Fcli+https%3A%2F%2Flaunchableinc.com%2Fschema%2FRecordTestInput&type=code.
e = case error
@@ -1416,7 +1417,10 @@ module Test
duration: time,
createdAt: Time.now.to_s,
stderr: e,
- stdout: nil
+ stdout: nil,
+ data: {
+ lineNumber: lineno
+ }
}
)
end