diff --git a/e2e/binary/dash/BUILD.bazel b/e2e/binary/dash/BUILD.bazel index 1520dca8e729637dcbce88c80eb60e30e0691eff..8eed2a8fd6ab5082a74bddee82bd8767d64536ed 100644 --- a/e2e/binary/dash/BUILD.bazel +++ b/e2e/binary/dash/BUILD.bazel @@ -1,11 +1,30 @@ -load("@bazel_skylib//rules:build_test.bzl", "build_test") +load("@rules_python_pytest//python_pytest:defs.bzl", "py_pytest_test") +load("@bazel_skylib//rules:native_binary.bzl", "native_test") -# TODO: write an _actual_ test for `dash` +py_pytest_test( + name = "pytest", + size = "small", + srcs = ["print.py"], + data = [ + "@ape//ape:dash", + ], + deps = [ + "//binary:pytest", + ], +) -build_test( - name = "dash", +native_test( + name = "native", size = "small", - tags = ["stub"], - targets = ["@ape//ape:dash"], + src = "@ape//ape:dash", + args = ["-c", "echo 'Hello, world!'"], +) + +test_suite( + name = "dash", + tests = [ + "pytest", + "native", + ], visibility = ["//:__subpackages__"], ) diff --git a/e2e/binary/dash/print.py b/e2e/binary/dash/print.py new file mode 100644 index 0000000000000000000000000000000000000000..aa932a09f9d53bc421ab068c654d4749f31ce495 --- /dev/null +++ b/e2e/binary/dash/print.py @@ -0,0 +1,13 @@ +from __future__ import annotations + +from subprocess import run + +from binary.tool import Tool + + +def test_print(tool: Tool) -> None: + binary = tool("dash") + + cmd = (binary, "-c", "echo 'Hello, world!'") + result = run(cmd, check=True, timeout=30, capture_output=True, text=True) + assert "Hello, world!\n" == result.stdout \ No newline at end of file