Skip to content

Commit

Permalink
[tests] add test for macro build failure source
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Apr 11, 2024
1 parent 47854ed commit 53ba9ab
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/misc/projects/Issue11635/Macro.macro.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function build() {
// Whoops, not returning anything
}

function build2() {
haxe.macro.Context.error("Abort", haxe.macro.Context.currentPos());
return null;
}
2 changes: 2 additions & 0 deletions tests/misc/projects/Issue11635/Main.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@:build(Macro.build())
class Main {}
2 changes: 2 additions & 0 deletions tests/misc/projects/Issue11635/Main2.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@:build(Macro.build2())
class Main2 {}
1 change: 1 addition & 0 deletions tests/misc/projects/Issue11635/compile-fail.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--main Main
2 changes: 2 additions & 0 deletions tests/misc/projects/Issue11635/compile-fail.hxml.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Macro.macro.hx:1: lines 1-3 : Void should be Array<haxe.macro.Field>
Main.hx:1: characters 1-8 : Build failure (Macro.build)
1 change: 1 addition & 0 deletions tests/misc/projects/Issue11635/compile2-fail.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--main Main2
2 changes: 2 additions & 0 deletions tests/misc/projects/Issue11635/compile2-fail.hxml.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Main2.hx:1: characters 1-8 : Abort
Main2.hx:1: characters 1-8 : Build failure (Macro.build2)

0 comments on commit 53ba9ab

Please sign in to comment.