diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/end-to-end/targets/TARGETS | 9 | ||||
-rwxr-xr-x | test/end-to-end/targets/built-in-resolution.sh | 38 |
2 files changed, 46 insertions, 1 deletions
diff --git a/test/end-to-end/targets/TARGETS b/test/end-to-end/targets/TARGETS index 8ec92208..015e12f1 100644 --- a/test/end-to-end/targets/TARGETS +++ b/test/end-to-end/targets/TARGETS @@ -10,9 +10,16 @@ , "test": ["repo_names.sh"] , "deps": [["test/end-to-end", "tool-under-test"]] } +, "resolution of built-in rules": + { "type": ["@", "rules", "shell/test", "script"] + , "name": ["built-in-resolution"] + , "test": ["built-in-resolution.sh"] + , "deps": [["test/end-to-end", "tool-under-test"]] + } , "TESTS": { "type": "install" , "tainted": ["test"] - , "deps": ["upwards reference", "repository naming"] + , "deps": + ["upwards reference", "repository naming", "resolution of built-in rules"] } } diff --git a/test/end-to-end/targets/built-in-resolution.sh b/test/end-to-end/targets/built-in-resolution.sh new file mode 100755 index 00000000..4698e0b8 --- /dev/null +++ b/test/end-to-end/targets/built-in-resolution.sh @@ -0,0 +1,38 @@ +#!/bin/sh +set -e + +TOOL=$(realpath ./bin/tool-under-test) +mkdir -p .root +BUILDROOT=$(realpath .root) +mkdir -p out +OUTDIR=$(realpath out) + +mkdir -p src/some/module +touch src/ROOT +cd src/some/module +cat > RULES <<'EOI' +{ "install": + { "expression": + { "type": "RESULT" + , "artifacts": + { "type": "singleton_map" + , "key": "some internal path" + , "value": {"type": "BLOB", "data": "FROM USER-DEFINED INSTALL"} + } + } + } +} +EOI +cat > TARGETS <<'EOI' +{ "user": {"type": ["./", ".", "install"]} +, "built-in": {"type": "install", "files": {"the/public/path": "user"}} +} +EOI + +echo +${TOOL} install built-in --local-build-root ${BUILDROOT} -o ${OUTDIR} 2>&1 +echo +grep 'FROM USER-DEFINED INSTALL' ${OUTDIR}/the/public/path +echo + +echo DONE |