diff --git a/tests/textflag/attrtest.go b/tests/textflag/attrtest.go new file mode 100644 index 0000000..b841929 --- /dev/null +++ b/tests/textflag/attrtest.go @@ -0,0 +1,6 @@ +// Package textflag tests that avo attribute constants agree with textflag.h. +package textflag + +//go:generate go run make_attrtest.go -output zattrtest.s -seed 42 -num 256 + +func attrtest() bool diff --git a/tests/textflag/attrtest_test.go b/tests/textflag/attrtest_test.go index 2abba43..1c785d1 100644 --- a/tests/textflag/attrtest_test.go +++ b/tests/textflag/attrtest_test.go @@ -2,12 +2,8 @@ package textflag import "testing" -//go:generate go run make_attrtest.go -output zattrtest.s -seed 42 -num 256 - -func AttrTest() bool - func TestAttributes(t *testing.T) { - if !AttrTest() { + if !attrtest() { t.Fail() } } diff --git a/tests/textflag/doc.go b/tests/textflag/doc.go deleted file mode 100644 index 41e64f3..0000000 --- a/tests/textflag/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package textflag tests that avo attribute constants agree with textflag.h. -package textflag diff --git a/tests/textflag/make_attrtest.go b/tests/textflag/make_attrtest.go index f57e59b..25134ba 100644 --- a/tests/textflag/make_attrtest.go +++ b/tests/textflag/make_attrtest.go @@ -44,7 +44,7 @@ func PrintAttributesTest(w io.Writer, as []attr.Attribute) { _, self, _, _ := runtime.Caller(0) fmt.Fprintf(w, "// Code generated by %s. DO NOT EDIT.\n\n", filepath.Base(self)) fmt.Fprintf(w, "#include \"textflag.h\"\n\n") - fmt.Fprintf(w, "TEXT ·AttrTest(SB), $0-1\n") + fmt.Fprintf(w, "TEXT ·attrtest(SB), $0-1\n") fmt.Fprintf(w, "\tMOVB $0, ret+0(FP)\n") for i, a := range as { diff --git a/tests/textflag/zattrtest.s b/tests/textflag/zattrtest.s index 4a1fe6a..cd43d19 100644 --- a/tests/textflag/zattrtest.s +++ b/tests/textflag/zattrtest.s @@ -2,7 +2,7 @@ #include "textflag.h" -TEXT ·AttrTest(SB), $0-1 +TEXT ·attrtest(SB), $0-1 MOVB $0, ret+0(FP) MOVW $(1), R8 MOVW $(NOPROF), R9