diff options
Diffstat (limited to 'Tests')
-rwxr-xr-x | Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat | 11 | ||||
-rwxr-xr-x | Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh | 32 |
2 files changed, 27 insertions, 16 deletions
diff --git a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat index f2f86b0..b038370 100755 --- a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat +++ b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.bat @@ -1,7 +1,11 @@ @ECHO OFF + +:LOOP + IF "%1"=="" ( EXIT /B 255 ) + IF "%1"=="--version" ( ECHO 0.0-cmake-dummy EXIT /B 0 @@ -13,6 +17,11 @@ IF "%1"=="--exists" ( ECHO Found: %PKG_CONFIG_PATH% IF NOT "%*"=="%PKG_CONFIG_PATH%" ( EXIT /B 1 + ) ELSE ( + EXIT /B 0 ) ) -EXIT /B 0 +SHIFT +IF NOT "%~1"=="" GOTO LOOP + +EXIT /B 255 diff --git a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh index abe14bf..56bba30 100755 --- a/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh +++ b/Tests/RunCMake/FindPkgConfig/dummy-pkg-config.sh @@ -4,18 +4,20 @@ # to the --exists argument with the PKG_CONFIG_PATH environment variable # and returns 1 if they are different. -case $1 in - --version) - echo "0.0-cmake-dummy" - ;; - --exists) - shift - eval last=\${$#} - echo "Expected: ${last}" - echo "Found: ${PKG_CONFIG_PATH}" - [ "${last}" = "${PKG_CONFIG_PATH}" ] || exit 1 - ;; - *) - exit 255 - ;; -esac +while [ $# -gt 0 ]; do + case $1 in + --version) + echo "0.0-cmake-dummy" + exit 0 + ;; + --exists) + shift + eval last=\${$#} + echo "Expected: ${last}" + echo "Found: ${PKG_CONFIG_PATH}" + [ "${last}" = "${PKG_CONFIG_PATH}" ] && exit 0 || exit 1 + ;; + esac + shift +done +exit 255 |