+testscript

closes https://github.com/pkgxdev/pkgx/issues/1015
This commit is contained in:
Jacob Heider 2024-06-25 13:25:26 -04:00 committed by Jacob Heider
parent 2648f27d90
commit c31ba83598

View file

@ -0,0 +1,38 @@
distributable:
url: https://github.com/rogpeppe/go-internal/archive/refs/tags/{{ version.tag }}.tar.gz
strip-components: 1
versions:
github: rogpeppe/go-internal
provides:
- bin/testscript
build:
dependencies:
go.dev: ~1.21
script:
- go mod download
- go build -v -trimpath -ldflags="$GO_LDFLAGS" -o '{{prefix}}/bin/testscript' ./cmd/testscript
env:
GO_LDFLAGS: [-s, -w]
linux:
# or segmentation fault
# fix found here https://github.com/docker-library/golang/issues/402#issuecomment-982204575
GO_LDFLAGS:
- -buildmode=pie
test:
dependencies:
pkgx.sh: 1
script:
- run: test "$(pkgx $FIXTURE)" = "PASS"
fixture:
extname: txtar
contents: |
exec echo hello!
stdout hello!
interprets:
extensions: txtar
args: testscript