Documentation
¶
Overview ¶
Package testbin hand-builds tiny, byte-for-byte deterministic binaries for tests.
It exists because the alternatives aren't reproducible. Compiling a fixture (internal/binfile's buildSample) depends on the host toolchain, and opening a system binary (/bin/ls) depends on the host OS and libc. Neither can back a golden-frame test, whose whole premise is that the same input renders the same bytes on every machine.
Nothing outside tests imports this package, so it does not link into exex.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TinyELF64 ¶
func TinyELF64() []byte
TinyELF64 returns a complete, deterministic ET_EXEC ELF64 image for x86-64. The same bytes every call, on every platform.
func WriteTinyELF64 ¶
WriteTinyELF64 writes the fixture into t.TempDir() and returns its path.
Types ¶
This section is empty.