Skip to content

Commit

Permalink
Add test recipe outputs_overwrite_base_file
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Bargull <[email protected]>
  • Loading branch information
mbargull committed Feb 14, 2024
1 parent f278f71 commit dc95fee
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:: Always output 4 characters to properly test even if "SafetyError: ... incorrect size." is not triggered.
< nul set /p="%PKG_NAME:~0,4%" > "%PREFIX%\file" & call;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## Always output 4 characters to properly test even if "SafetyError: ... incorrect size." is not triggered.
printf '%.4s' "${PKG_NAME}" > "${PREFIX}/file"
40 changes: 40 additions & 0 deletions tests/test-recipes/metadata/outputs_overwrite_base_file/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{% set name = "outputs_overwrite_base_file" %}

package:
name: {{ name }}
version: 1.0

outputs:
- name: base-{{ name }}
script: install.sh # [unix]
script: install.bat # [win]

- name: first-{{ name }}
script: install.sh # [unix]
script: install.bat # [win]
requirements:
host:
- {{ pin_subpackage("base-" + name) }}
run:
- {{ pin_subpackage("base-" + name) }}
test:
commands:
- content="$(cat "${PREFIX}/file")" # [unix]
- test "${content}" = base # [unix]
- < "%PREFIX%\file% set /p content= # [win]
- if not "%content%" == "base" exit 1 # [win]

- name: second-{{ name }}
script: install.sh # [unix]
script: install.bat # [win]
requirements:
host:
- {{ pin_subpackage("base-" + name) }}
run:
- {{ pin_subpackage("base-" + name) }}
test:
commands:
- content="$(cat "${PREFIX}/file")" # [unix]
- test "${content}" = "base" # [unix]
- < "%PREFIX%\file% set /p content= # [win]
- if not "%content%" == "base" exit 1 # [win]

0 comments on commit dc95fee

Please sign in to comment.