context: version: "1.2.3" package: name: test-execution version: ${{ version }} build: script: - if: unix then: - echo "Hello World" > $PREFIX/test-execution.txt else: - echo "Hello World" > %PREFIX%\test-execution.txt tests: - script: - if: unix then: - test -f $PREFIX/test-execution.txt - test -f ./testfile.txt - test -f ./testfolder/data.txt # check that the version is rendered properly from context into the script - if [[ "${{ version }}" == "1.2.3" ]]; then echo "Version matches 1.2.3"; else exit 123; fi else: - if not exist %PREFIX%\test-execution.txt (exit 1) - if not exist .\testfile.txt (exit 1) - if not exist .\testfolder\data.txt (exit 1) files: recipe: - testfile.txt - testfolder/ - script: - if: unix then: - test $PKG_VERSION = "1.2.3" - test $PKG_NAME = "test-execution" - test $PKG_BUILDNUM = "0" - test -n $PKG_BUILD_STRING else: - if not "%PKG_VERSION%" == "1.2.3" (exit 1) - if not "%PKG_NAME%" == "test-execution" (exit 1) - if not "%PKG_BUILDNUM%" == "0" (exit 1) # make sure that the build string is not empty - if "%PKG_BUILD_STRING%" == "" (exit 1)