| author | |
| committer | |
| log | aba67ecf4475a72035b60dbc0284c2076600f2e1 |
| tree | 8390117f094bc8297e1d62c6924592a689863240 |
| parent | 1fd24791a7ea74260c86212e65b13cafd6243863 |
| signature |
4 files changed, 286 insertions(+), 286 deletions(-)
build.zig+1-1| ... | @@ -138,7 +138,7 @@ pub fn build(b: *Builder) !void { | ... | @@ -138,7 +138,7 @@ pub fn build(b: *Builder) !void { |
| 138 | 138 | ||
| 139 | test_step.dependOn(tests.addCompareOutputTests(b, test_filter, modes)); | 139 | test_step.dependOn(tests.addCompareOutputTests(b, test_filter, modes)); |
| 140 | test_step.dependOn(tests.addStandaloneTests(b, test_filter, modes)); | 140 | test_step.dependOn(tests.addStandaloneTests(b, test_filter, modes)); |
| 141 | test_step.dependOn(tests.addCompareStackTracesTests(b, test_filter, modes)); | 141 | test_step.dependOn(tests.addStackTraceTests(b, test_filter, modes)); |
| 142 | test_step.dependOn(tests.addCliTests(b, test_filter, modes)); | 142 | test_step.dependOn(tests.addCliTests(b, test_filter, modes)); |
| 143 | test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter, modes)); | 143 | test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter, modes)); |
| 144 | test_step.dependOn(tests.addRuntimeSafetyTests(b, test_filter, modes)); | 144 | test_step.dependOn(tests.addRuntimeSafetyTests(b, test_filter, modes)); |
test/compare_traces.zig deleted-274| ... | @@ -1,274 +0,0 @@ | ||
| 1 | const builtin = @import("builtin"); | ||
| 2 | const std = @import("std"); | ||
| 3 | const os = std.os; | ||
| 4 | const tests = @import("tests.zig"); | ||
| 5 | |||
| 6 | pub fn addCases(cases: *tests.CompareStackTracesContext) void { | ||
| 7 | const source_return = | ||
| 8 | \\const std = @import("std"); | ||
| 9 | \\ | ||
| 10 | \\pub fn main() !void { | ||
| 11 | \\ return error.TheSkyIsFalling; | ||
| 12 | \\} | ||
| 13 | ; | ||
| 14 | const source_try_return = | ||
| 15 | \\const std = @import("std"); | ||
| 16 | \\ | ||
| 17 | \\fn foo() !void { | ||
| 18 | \\ return error.TheSkyIsFalling; | ||
| 19 | \\} | ||
| 20 | \\ | ||
| 21 | \\pub fn main() !void { | ||
| 22 | \\ try foo(); | ||
| 23 | \\} | ||
| 24 | ; | ||
| 25 | const source_try_try_return_return = | ||
| 26 | \\const std = @import("std"); | ||
| 27 | \\ | ||
| 28 | \\fn foo() !void { | ||
| 29 | \\ try bar(); | ||
| 30 | \\} | ||
| 31 | \\ | ||
| 32 | \\fn bar() !void { | ||
| 33 | \\ return make_error(); | ||
| 34 | \\} | ||
| 35 | \\ | ||
| 36 | \\fn make_error() !void { | ||
| 37 | \\ return error.TheSkyIsFalling; | ||
| 38 | \\} | ||
| 39 | \\ | ||
| 40 | \\pub fn main() !void { | ||
| 41 | \\ try foo(); | ||
| 42 | \\} | ||
| 43 | ; | ||
| 44 | switch (builtin.os) { | ||
| 45 | .linux => { | ||
| 46 | cases.addCase( | ||
| 47 | "return", | ||
| 48 | source_return, | ||
| 49 | [_][]const u8{ | ||
| 50 | // debug | ||
| 51 | \\error: TheSkyIsFalling | ||
| 52 | \\source.zig:4:5: [address] in main (test) | ||
| 53 | \\ | ||
| 54 | , | ||
| 55 | // release-safe | ||
| 56 | \\error: TheSkyIsFalling | ||
| 57 | \\source.zig:4:5: [address] in std.special.posixCallMainAndExit (test) | ||
| 58 | \\ | ||
| 59 | , | ||
| 60 | // release-fast | ||
| 61 | \\error: TheSkyIsFalling | ||
| 62 | \\ | ||
| 63 | , | ||
| 64 | // release-small | ||
| 65 | \\error: TheSkyIsFalling | ||
| 66 | \\ | ||
| 67 | }, | ||
| 68 | ); | ||
| 69 | cases.addCase( | ||
| 70 | "try return", | ||
| 71 | source_try_return, | ||
| 72 | [_][]const u8{ | ||
| 73 | // debug | ||
| 74 | \\error: TheSkyIsFalling | ||
| 75 | \\source.zig:4:5: [address] in foo (test) | ||
| 76 | \\source.zig:8:5: [address] in main (test) | ||
| 77 | \\ | ||
| 78 | , | ||
| 79 | // release-safe | ||
| 80 | \\error: TheSkyIsFalling | ||
| 81 | \\source.zig:4:5: [address] in std.special.posixCallMainAndExit (test) | ||
| 82 | \\source.zig:8:5: [address] in std.special.posixCallMainAndExit (test) | ||
| 83 | \\ | ||
| 84 | , | ||
| 85 | // release-fast | ||
| 86 | \\error: TheSkyIsFalling | ||
| 87 | \\ | ||
| 88 | , | ||
| 89 | // release-small | ||
| 90 | \\error: TheSkyIsFalling | ||
| 91 | \\ | ||
| 92 | }, | ||
| 93 | ); | ||
| 94 | cases.addCase( | ||
| 95 | "try try return return", | ||
| 96 | source_try_try_return_return, | ||
| 97 | [_][]const u8{ | ||
| 98 | // debug | ||
| 99 | \\error: TheSkyIsFalling | ||
| 100 | \\source.zig:12:5: [address] in make_error (test) | ||
| 101 | \\source.zig:8:5: [address] in bar (test) | ||
| 102 | \\source.zig:4:5: [address] in foo (test) | ||
| 103 | \\source.zig:16:5: [address] in main (test) | ||
| 104 | \\ | ||
| 105 | , | ||
| 106 | // release-safe | ||
| 107 | \\error: TheSkyIsFalling | ||
| 108 | \\source.zig:12:5: [address] in std.special.posixCallMainAndExit (test) | ||
| 109 | \\source.zig:8:5: [address] in std.special.posixCallMainAndExit (test) | ||
| 110 | \\source.zig:4:5: [address] in std.special.posixCallMainAndExit (test) | ||
| 111 | \\source.zig:16:5: [address] in std.special.posixCallMainAndExit (test) | ||
| 112 | \\ | ||
| 113 | , | ||
| 114 | // release-fast | ||
| 115 | \\error: TheSkyIsFalling | ||
| 116 | \\ | ||
| 117 | , | ||
| 118 | // release-small | ||
| 119 | \\error: TheSkyIsFalling | ||
| 120 | \\ | ||
| 121 | }, | ||
| 122 | ); | ||
| 123 | }, | ||
| 124 | .macosx => { | ||
| 125 | cases.addCase( | ||
| 126 | "return", | ||
| 127 | source_return, | ||
| 128 | [_][]const u8{ | ||
| 129 | // debug | ||
| 130 | \\error: TheSkyIsFalling | ||
| 131 | \\source.zig:4:5: [address] in _main.0 (test.o) | ||
| 132 | \\ | ||
| 133 | , | ||
| 134 | // release-safe | ||
| 135 | \\error: TheSkyIsFalling | ||
| 136 | \\source.zig:4:5: [address] in _main (test.o) | ||
| 137 | \\ | ||
| 138 | , | ||
| 139 | // release-fast | ||
| 140 | \\error: TheSkyIsFalling | ||
| 141 | \\ | ||
| 142 | , | ||
| 143 | // release-small | ||
| 144 | \\error: TheSkyIsFalling | ||
| 145 | \\ | ||
| 146 | }, | ||
| 147 | ); | ||
| 148 | cases.addCase( | ||
| 149 | "try return", | ||
| 150 | source_try_return, | ||
| 151 | [_][]const u8{ | ||
| 152 | // debug | ||
| 153 | \\error: TheSkyIsFalling | ||
| 154 | \\source.zig:4:5: [address] in _foo (test.o) | ||
| 155 | \\source.zig:8:5: [address] in _main.0 (test.o) | ||
| 156 | \\ | ||
| 157 | , | ||
| 158 | // release-safe | ||
| 159 | \\error: TheSkyIsFalling | ||
| 160 | \\source.zig:4:5: [address] in _main (test.o) | ||
| 161 | \\source.zig:8:5: [address] in _main (test.o) | ||
| 162 | \\ | ||
| 163 | , | ||
| 164 | // release-fast | ||
| 165 | \\error: TheSkyIsFalling | ||
| 166 | \\ | ||
| 167 | , | ||
| 168 | // release-small | ||
| 169 | \\error: TheSkyIsFalling | ||
| 170 | \\ | ||
| 171 | }, | ||
| 172 | ); | ||
| 173 | cases.addCase( | ||
| 174 | "try try return return", | ||
| 175 | source_try_try_return_return, | ||
| 176 | [_][]const u8{ | ||
| 177 | // debug | ||
| 178 | \\error: TheSkyIsFalling | ||
| 179 | \\source.zig:12:5: [address] in _make_error (test.o) | ||
| 180 | \\source.zig:8:5: [address] in _bar (test.o) | ||
| 181 | \\source.zig:4:5: [address] in _foo (test.o) | ||
| 182 | \\source.zig:16:5: [address] in _main.0 (test.o) | ||
| 183 | \\ | ||
| 184 | , | ||
| 185 | // release-safe | ||
| 186 | \\error: TheSkyIsFalling | ||
| 187 | \\source.zig:12:5: [address] in _main (test.o) | ||
| 188 | \\source.zig:8:5: [address] in _main (test.o) | ||
| 189 | \\source.zig:4:5: [address] in _main (test.o) | ||
| 190 | \\source.zig:16:5: [address] in _main (test.o) | ||
| 191 | \\ | ||
| 192 | , | ||
| 193 | // release-fast | ||
| 194 | \\error: TheSkyIsFalling | ||
| 195 | \\ | ||
| 196 | , | ||
| 197 | // release-small | ||
| 198 | \\error: TheSkyIsFalling | ||
| 199 | \\ | ||
| 200 | }, | ||
| 201 | ); | ||
| 202 | }, | ||
| 203 | .windows => { | ||
| 204 | cases.addCase( | ||
| 205 | "return", | ||
| 206 | source_return, | ||
| 207 | [_][]const u8{ | ||
| 208 | // debug | ||
| 209 | \\error: TheSkyIsFalling | ||
| 210 | \\source.zig:4:5: [address] in main (test.obj) | ||
| 211 | \\ | ||
| 212 | , | ||
| 213 | // release-safe | ||
| 214 | // --disabled-- results in segmenetation fault | ||
| 215 | "", | ||
| 216 | // release-fast | ||
| 217 | \\error: TheSkyIsFalling | ||
| 218 | \\ | ||
| 219 | , | ||
| 220 | // release-small | ||
| 221 | \\error: TheSkyIsFalling | ||
| 222 | \\ | ||
| 223 | }, | ||
| 224 | ); | ||
| 225 | cases.addCase( | ||
| 226 | "try return", | ||
| 227 | source_try_return, | ||
| 228 | [_][]const u8{ | ||
| 229 | // debug | ||
| 230 | \\error: TheSkyIsFalling | ||
| 231 | \\source.zig:4:5: [address] in foo (test.obj) | ||
| 232 | \\source.zig:8:5: [address] in main (test.obj) | ||
| 233 | \\ | ||
| 234 | , | ||
| 235 | // release-safe | ||
| 236 | // --disabled-- results in segmenetation fault | ||
| 237 | "", | ||
| 238 | // release-fast | ||
| 239 | \\error: TheSkyIsFalling | ||
| 240 | \\ | ||
| 241 | , | ||
| 242 | // release-small | ||
| 243 | \\error: TheSkyIsFalling | ||
| 244 | \\ | ||
| 245 | }, | ||
| 246 | ); | ||
| 247 | cases.addCase( | ||
| 248 | "try try return return", | ||
| 249 | source_try_try_return_return, | ||
| 250 | [_][]const u8{ | ||
| 251 | // debug | ||
| 252 | \\error: TheSkyIsFalling | ||
| 253 | \\source.zig:12:5: [address] in make_error (test.obj) | ||
| 254 | \\source.zig:8:5: [address] in bar (test.obj) | ||
| 255 | \\source.zig:4:5: [address] in foo (test.obj) | ||
| 256 | \\source.zig:16:5: [address] in main (test.obj) | ||
| 257 | \\ | ||
| 258 | , | ||
| 259 | // release-safe | ||
| 260 | // --disabled-- results in segmenetation fault | ||
| 261 | "", | ||
| 262 | // release-fast | ||
| 263 | \\error: TheSkyIsFalling | ||
| 264 | \\ | ||
| 265 | , | ||
| 266 | // release-small | ||
| 267 | \\error: TheSkyIsFalling | ||
| 268 | \\ | ||
| 269 | }, | ||
| 270 | ); | ||
| 271 | }, | ||
| 272 | else => {}, | ||
| 273 | } | ||
| 274 | } | ||
test/stack_traces.zig created+274| ... | @@ -0,0 +1,274 @@ | ||
| 1 | const builtin = @import("builtin"); | ||
| 2 | const std = @import("std"); | ||
| 3 | const os = std.os; | ||
| 4 | const tests = @import("tests.zig"); | ||
| 5 | |||
| 6 | pub fn addCases(cases: *tests.StackTracesContext) void { | ||
| 7 | const source_return = | ||
| 8 | \\const std = @import("std"); | ||
| 9 | \\ | ||
| 10 | \\pub fn main() !void { | ||
| 11 | \\ return error.TheSkyIsFalling; | ||
| 12 | \\} | ||
| 13 | ; | ||
| 14 | const source_try_return = | ||
| 15 | \\const std = @import("std"); | ||
| 16 | \\ | ||
| 17 | \\fn foo() !void { | ||
| 18 | \\ return error.TheSkyIsFalling; | ||
| 19 | \\} | ||
| 20 | \\ | ||
| 21 | \\pub fn main() !void { | ||
| 22 | \\ try foo(); | ||
| 23 | \\} | ||
| 24 | ; | ||
| 25 | const source_try_try_return_return = | ||
| 26 | \\const std = @import("std"); | ||
| 27 | \\ | ||
| 28 | \\fn foo() !void { | ||
| 29 | \\ try bar(); | ||
| 30 | \\} | ||
| 31 | \\ | ||
| 32 | \\fn bar() !void { | ||
| 33 | \\ return make_error(); | ||
| 34 | \\} | ||
| 35 | \\ | ||
| 36 | \\fn make_error() !void { | ||
| 37 | \\ return error.TheSkyIsFalling; | ||
| 38 | \\} | ||
| 39 | \\ | ||
| 40 | \\pub fn main() !void { | ||
| 41 | \\ try foo(); | ||
| 42 | \\} | ||
| 43 | ; | ||
| 44 | switch (builtin.os) { | ||
| 45 | .linux => { | ||
| 46 | cases.addCase( | ||
| 47 | "return", | ||
| 48 | source_return, | ||
| 49 | [_][]const u8{ | ||
| 50 | // debug | ||
| 51 | \\error: TheSkyIsFalling | ||
| 52 | \\source.zig:4:5: [address] in main (test) | ||
| 53 | \\ | ||
| 54 | , | ||
| 55 | // release-safe | ||
| 56 | \\error: TheSkyIsFalling | ||
| 57 | \\source.zig:4:5: [address] in std.special.posixCallMainAndExit (test) | ||
| 58 | \\ | ||
| 59 | , | ||
| 60 | // release-fast | ||
| 61 | \\error: TheSkyIsFalling | ||
| 62 | \\ | ||
| 63 | , | ||
| 64 | // release-small | ||
| 65 | \\error: TheSkyIsFalling | ||
| 66 | \\ | ||
| 67 | }, | ||
| 68 | ); | ||
| 69 | cases.addCase( | ||
| 70 | "try return", | ||
| 71 | source_try_return, | ||
| 72 | [_][]const u8{ | ||
| 73 | // debug | ||
| 74 | \\error: TheSkyIsFalling | ||
| 75 | \\source.zig:4:5: [address] in foo (test) | ||
| 76 | \\source.zig:8:5: [address] in main (test) | ||
| 77 | \\ | ||
| 78 | , | ||
| 79 | // release-safe | ||
| 80 | \\error: TheSkyIsFalling | ||
| 81 | \\source.zig:4:5: [address] in std.special.posixCallMainAndExit (test) | ||
| 82 | \\source.zig:8:5: [address] in std.special.posixCallMainAndExit (test) | ||
| 83 | \\ | ||
| 84 | , | ||
| 85 | // release-fast | ||
| 86 | \\error: TheSkyIsFalling | ||
| 87 | \\ | ||
| 88 | , | ||
| 89 | // release-small | ||
| 90 | \\error: TheSkyIsFalling | ||
| 91 | \\ | ||
| 92 | }, | ||
| 93 | ); | ||
| 94 | cases.addCase( | ||
| 95 | "try try return return", | ||
| 96 | source_try_try_return_return, | ||
| 97 | [_][]const u8{ | ||
| 98 | // debug | ||
| 99 | \\error: TheSkyIsFalling | ||
| 100 | \\source.zig:12:5: [address] in make_error (test) | ||
| 101 | \\source.zig:8:5: [address] in bar (test) | ||
| 102 | \\source.zig:4:5: [address] in foo (test) | ||
| 103 | \\source.zig:16:5: [address] in main (test) | ||
| 104 | \\ | ||
| 105 | , | ||
| 106 | // release-safe | ||
| 107 | \\error: TheSkyIsFalling | ||
| 108 | \\source.zig:12:5: [address] in std.special.posixCallMainAndExit (test) | ||
| 109 | \\source.zig:8:5: [address] in std.special.posixCallMainAndExit (test) | ||
| 110 | \\source.zig:4:5: [address] in std.special.posixCallMainAndExit (test) | ||
| 111 | \\source.zig:16:5: [address] in std.special.posixCallMainAndExit (test) | ||
| 112 | \\ | ||
| 113 | , | ||
| 114 | // release-fast | ||
| 115 | \\error: TheSkyIsFalling | ||
| 116 | \\ | ||
| 117 | , | ||
| 118 | // release-small | ||
| 119 | \\error: TheSkyIsFalling | ||
| 120 | \\ | ||
| 121 | }, | ||
| 122 | ); | ||
| 123 | }, | ||
| 124 | .macosx => { | ||
| 125 | cases.addCase( | ||
| 126 | "return", | ||
| 127 | source_return, | ||
| 128 | [_][]const u8{ | ||
| 129 | // debug | ||
| 130 | \\error: TheSkyIsFalling | ||
| 131 | \\source.zig:4:5: [address] in _main.0 (test.o) | ||
| 132 | \\ | ||
| 133 | , | ||
| 134 | // release-safe | ||
| 135 | \\error: TheSkyIsFalling | ||
| 136 | \\source.zig:4:5: [address] in _main (test.o) | ||
| 137 | \\ | ||
| 138 | , | ||
| 139 | // release-fast | ||
| 140 | \\error: TheSkyIsFalling | ||
| 141 | \\ | ||
| 142 | , | ||
| 143 | // release-small | ||
| 144 | \\error: TheSkyIsFalling | ||
| 145 | \\ | ||
| 146 | }, | ||
| 147 | ); | ||
| 148 | cases.addCase( | ||
| 149 | "try return", | ||
| 150 | source_try_return, | ||
| 151 | [_][]const u8{ | ||
| 152 | // debug | ||
| 153 | \\error: TheSkyIsFalling | ||
| 154 | \\source.zig:4:5: [address] in _foo (test.o) | ||
| 155 | \\source.zig:8:5: [address] in _main.0 (test.o) | ||
| 156 | \\ | ||
| 157 | , | ||
| 158 | // release-safe | ||
| 159 | \\error: TheSkyIsFalling | ||
| 160 | \\source.zig:4:5: [address] in _main (test.o) | ||
| 161 | \\source.zig:8:5: [address] in _main (test.o) | ||
| 162 | \\ | ||
| 163 | , | ||
| 164 | // release-fast | ||
| 165 | \\error: TheSkyIsFalling | ||
| 166 | \\ | ||
| 167 | , | ||
| 168 | // release-small | ||
| 169 | \\error: TheSkyIsFalling | ||
| 170 | \\ | ||
| 171 | }, | ||
| 172 | ); | ||
| 173 | cases.addCase( | ||
| 174 | "try try return return", | ||
| 175 | source_try_try_return_return, | ||
| 176 | [_][]const u8{ | ||
| 177 | // debug | ||
| 178 | \\error: TheSkyIsFalling | ||
| 179 | \\source.zig:12:5: [address] in _make_error (test.o) | ||
| 180 | \\source.zig:8:5: [address] in _bar (test.o) | ||
| 181 | \\source.zig:4:5: [address] in _foo (test.o) | ||
| 182 | \\source.zig:16:5: [address] in _main.0 (test.o) | ||
| 183 | \\ | ||
| 184 | , | ||
| 185 | // release-safe | ||
| 186 | \\error: TheSkyIsFalling | ||
| 187 | \\source.zig:12:5: [address] in _main (test.o) | ||
| 188 | \\source.zig:8:5: [address] in _main (test.o) | ||
| 189 | \\source.zig:4:5: [address] in _main (test.o) | ||
| 190 | \\source.zig:16:5: [address] in _main (test.o) | ||
| 191 | \\ | ||
| 192 | , | ||
| 193 | // release-fast | ||
| 194 | \\error: TheSkyIsFalling | ||
| 195 | \\ | ||
| 196 | , | ||
| 197 | // release-small | ||
| 198 | \\error: TheSkyIsFalling | ||
| 199 | \\ | ||
| 200 | }, | ||
| 201 | ); | ||
| 202 | }, | ||
| 203 | .windows => { | ||
| 204 | cases.addCase( | ||
| 205 | "return", | ||
| 206 | source_return, | ||
| 207 | [_][]const u8{ | ||
| 208 | // debug | ||
| 209 | \\error: TheSkyIsFalling | ||
| 210 | \\source.zig:4:5: [address] in main (test.obj) | ||
| 211 | \\ | ||
| 212 | , | ||
| 213 | // release-safe | ||
| 214 | // --disabled-- results in segmenetation fault | ||
| 215 | "", | ||
| 216 | // release-fast | ||
| 217 | \\error: TheSkyIsFalling | ||
| 218 | \\ | ||
| 219 | , | ||
| 220 | // release-small | ||
| 221 | \\error: TheSkyIsFalling | ||
| 222 | \\ | ||
| 223 | }, | ||
| 224 | ); | ||
| 225 | cases.addCase( | ||
| 226 | "try return", | ||
| 227 | source_try_return, | ||
| 228 | [_][]const u8{ | ||
| 229 | // debug | ||
| 230 | \\error: TheSkyIsFalling | ||
| 231 | \\source.zig:4:5: [address] in foo (test.obj) | ||
| 232 | \\source.zig:8:5: [address] in main (test.obj) | ||
| 233 | \\ | ||
| 234 | , | ||
| 235 | // release-safe | ||
| 236 | // --disabled-- results in segmenetation fault | ||
| 237 | "", | ||
| 238 | // release-fast | ||
| 239 | \\error: TheSkyIsFalling | ||
| 240 | \\ | ||
| 241 | , | ||
| 242 | // release-small | ||
| 243 | \\error: TheSkyIsFalling | ||
| 244 | \\ | ||
| 245 | }, | ||
| 246 | ); | ||
| 247 | cases.addCase( | ||
| 248 | "try try return return", | ||
| 249 | source_try_try_return_return, | ||
| 250 | [_][]const u8{ | ||
| 251 | // debug | ||
| 252 | \\error: TheSkyIsFalling | ||
| 253 | \\source.zig:12:5: [address] in make_error (test.obj) | ||
| 254 | \\source.zig:8:5: [address] in bar (test.obj) | ||
| 255 | \\source.zig:4:5: [address] in foo (test.obj) | ||
| 256 | \\source.zig:16:5: [address] in main (test.obj) | ||
| 257 | \\ | ||
| 258 | , | ||
| 259 | // release-safe | ||
| 260 | // --disabled-- results in segmenetation fault | ||
| 261 | "", | ||
| 262 | // release-fast | ||
| 263 | \\error: TheSkyIsFalling | ||
| 264 | \\ | ||
| 265 | , | ||
| 266 | // release-small | ||
| 267 | \\error: TheSkyIsFalling | ||
| 268 | \\ | ||
| 269 | }, | ||
| 270 | ); | ||
| 271 | }, | ||
| 272 | else => {}, | ||
| 273 | } | ||
| 274 | } | ||
test/tests.zig+11-11| ... | @@ -16,7 +16,7 @@ const LibExeObjStep = build.LibExeObjStep; | ... | @@ -16,7 +16,7 @@ const LibExeObjStep = build.LibExeObjStep; |
| 16 | 16 | ||
| 17 | const compare_output = @import("compare_output.zig"); | 17 | const compare_output = @import("compare_output.zig"); |
| 18 | const standalone = @import("standalone.zig"); | 18 | const standalone = @import("standalone.zig"); |
| 19 | const compare_panic = @import("compare_traces.zig"); | 19 | const stack_traces = @import("stack_traces.zig"); |
| 20 | const compile_errors = @import("compile_errors.zig"); | 20 | const compile_errors = @import("compile_errors.zig"); |
| 21 | const assemble_and_link = @import("assemble_and_link.zig"); | 21 | const assemble_and_link = @import("assemble_and_link.zig"); |
| 22 | const runtime_safety = @import("runtime_safety.zig"); | 22 | const runtime_safety = @import("runtime_safety.zig"); |
| ... | @@ -58,17 +58,17 @@ pub fn addCompareOutputTests(b: *build.Builder, test_filter: ?[]const u8, modes: | ... | @@ -58,17 +58,17 @@ pub fn addCompareOutputTests(b: *build.Builder, test_filter: ?[]const u8, modes: |
| 58 | return cases.step; | 58 | return cases.step; |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | pub fn addCompareStackTracesTests(b: *build.Builder, test_filter: ?[]const u8, modes: []const Mode) *build.Step { | 61 | pub fn addStackTraceTests(b: *build.Builder, test_filter: ?[]const u8, modes: []const Mode) *build.Step { |
| 62 | const cases = b.allocator.create(CompareStackTracesContext) catch unreachable; | 62 | const cases = b.allocator.create(StackTracesContext) catch unreachable; |
| 63 | cases.* = CompareStackTracesContext{ | 63 | cases.* = StackTracesContext{ |
| 64 | .b = b, | 64 | .b = b, |
| 65 | .step = b.step("test-compare-traces", "Run the compare stack traces tests"), | 65 | .step = b.step("test-stack-traces", "Run the stack trace tests"), |
| 66 | .test_index = 0, | 66 | .test_index = 0, |
| 67 | .test_filter = test_filter, | 67 | .test_filter = test_filter, |
| 68 | .modes = modes, | 68 | .modes = modes, |
| 69 | }; | 69 | }; |
| 70 | 70 | ||
| 71 | compare_panic.addCases(cases); | 71 | stack_traces.addCases(cases); |
| 72 | 72 | ||
| 73 | return cases.step; | 73 | return cases.step; |
| 74 | } | 74 | } |
| ... | @@ -565,7 +565,7 @@ pub const CompareOutputContext = struct { | ... | @@ -565,7 +565,7 @@ pub const CompareOutputContext = struct { |
| 565 | } | 565 | } |
| 566 | }; | 566 | }; |
| 567 | 567 | ||
| 568 | pub const CompareStackTracesContext = struct { | 568 | pub const StackTracesContext = struct { |
| 569 | b: *build.Builder, | 569 | b: *build.Builder, |
| 570 | step: *build.Step, | 570 | step: *build.Step, |
| 571 | test_index: usize, | 571 | test_index: usize, |
| ... | @@ -575,7 +575,7 @@ pub const CompareStackTracesContext = struct { | ... | @@ -575,7 +575,7 @@ pub const CompareStackTracesContext = struct { |
| 575 | const Expect = [@typeInfo(Mode).Enum.fields.len][]const u8; | 575 | const Expect = [@typeInfo(Mode).Enum.fields.len][]const u8; |
| 576 | 576 | ||
| 577 | pub fn addCase( | 577 | pub fn addCase( |
| 578 | self: *CompareStackTracesContext, | 578 | self: *StackTracesContext, |
| 579 | name: []const u8, | 579 | name: []const u8, |
| 580 | source: []const u8, | 580 | source: []const u8, |
| 581 | expect: Expect, | 581 | expect: Expect, |
| ... | @@ -591,7 +591,7 @@ pub const CompareStackTracesContext = struct { | ... | @@ -591,7 +591,7 @@ pub const CompareStackTracesContext = struct { |
| 591 | const expect_for_mode = expect[@enumToInt(mode)]; | 591 | const expect_for_mode = expect[@enumToInt(mode)]; |
| 592 | if (expect_for_mode.len == 0) continue; | 592 | if (expect_for_mode.len == 0) continue; |
| 593 | 593 | ||
| 594 | const annotated_case_name = fmt.allocPrint(self.b.allocator, "{} {} ({})", "compare-stack-traces", name, @tagName(mode)) catch unreachable; | 594 | const annotated_case_name = fmt.allocPrint(self.b.allocator, "{} {} ({})", "stack-trace", name, @tagName(mode)) catch unreachable; |
| 595 | if (self.test_filter) |filter| { | 595 | if (self.test_filter) |filter| { |
| 596 | if (mem.indexOf(u8, annotated_case_name, filter) == null) continue; | 596 | if (mem.indexOf(u8, annotated_case_name, filter) == null) continue; |
| 597 | } | 597 | } |
| ... | @@ -616,7 +616,7 @@ pub const CompareStackTracesContext = struct { | ... | @@ -616,7 +616,7 @@ pub const CompareStackTracesContext = struct { |
| 616 | 616 | ||
| 617 | const RunAndCompareStep = struct { | 617 | const RunAndCompareStep = struct { |
| 618 | step: build.Step, | 618 | step: build.Step, |
| 619 | context: *CompareStackTracesContext, | 619 | context: *StackTracesContext, |
| 620 | exe: *LibExeObjStep, | 620 | exe: *LibExeObjStep, |
| 621 | name: []const u8, | 621 | name: []const u8, |
| 622 | mode: Mode, | 622 | mode: Mode, |
| ... | @@ -624,7 +624,7 @@ pub const CompareStackTracesContext = struct { | ... | @@ -624,7 +624,7 @@ pub const CompareStackTracesContext = struct { |
| 624 | test_index: usize, | 624 | test_index: usize, |
| 625 | 625 | ||
| 626 | pub fn create( | 626 | pub fn create( |
| 627 | context: *CompareStackTracesContext, | 627 | context: *StackTracesContext, |
| 628 | exe: *LibExeObjStep, | 628 | exe: *LibExeObjStep, |
| 629 | name: []const u8, | 629 | name: []const u8, |
| 630 | mode: Mode, | 630 | mode: Mode, |