From c31ba835986712cd104ca78152dc7953d0a32f2e Mon Sep 17 00:00:00 2001 From: Jacob Heider Date: Tue, 25 Jun 2024 13:25:26 -0400 Subject: [PATCH] +testscript closes https://github.com/pkgxdev/pkgx/issues/1015 --- projects/go.dev/testscript/package.yml | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 projects/go.dev/testscript/package.yml diff --git a/projects/go.dev/testscript/package.yml b/projects/go.dev/testscript/package.yml new file mode 100644 index 00000000..0a4168ae --- /dev/null +++ b/projects/go.dev/testscript/package.yml @@ -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