mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2025-12-27 00:50:04 +01:00
Test that --version prints the current version and --atleast-pkgconfig-version validates it.
92 lines
2.2 KiB
Bash
Executable file
92 lines
2.2 KiB
Bash
Executable file
#! /bin/sh
|
|
|
|
set -e
|
|
|
|
. ${srcdir}/common
|
|
|
|
# --atleast-pkgconfig-version
|
|
RESULT=""
|
|
run_test --atleast-pkgconfig-version=$PACKAGE_VERSION
|
|
|
|
EXPECT_RETURN=1
|
|
RESULT=""
|
|
run_test --atleast-pkgconfig-version=999
|
|
|
|
v1=0.9.9
|
|
v2=1.0.0
|
|
v3=1.0.1
|
|
|
|
# exact version testing
|
|
EXPECT_RETURN=1
|
|
RESULT="Requested 'simple = $v1' but version of Simple test is $v2"
|
|
run_test --exists --print-errors simple = $v1
|
|
|
|
EXPECT_RETURN=1
|
|
RESULT="Requested 'simple = $v1' but version of Simple test is $v2"
|
|
run_test --exists --print-errors --exact-version=$v1 simple
|
|
|
|
EXPECT_RETURN=0
|
|
RESULT=""
|
|
run_test --exists --print-errors simple = $v2
|
|
|
|
EXPECT_RETURN=0
|
|
RESULT=""
|
|
run_test --exists --print-errors --exact-version=$v2 simple
|
|
|
|
EXPECT_RETURN=1
|
|
RESULT="Requested 'simple = $v3' but version of Simple test is $v2"
|
|
run_test --exists --print-errors simple = $v3
|
|
|
|
EXPECT_RETURN=1
|
|
RESULT="Requested 'simple = $v3' but version of Simple test is $v2"
|
|
run_test --exists --print-errors --exact-version=$v3 simple
|
|
|
|
# atleast version testing
|
|
EXPECT_RETURN=0
|
|
RESULT=""
|
|
run_test --exists --print-errors simple \>= $v1
|
|
|
|
EXPECT_RETURN=0
|
|
RESULT=""
|
|
run_test --exists --print-errors --atleast-version=$v1 simple
|
|
|
|
EXPECT_RETURN=0
|
|
RESULT=""
|
|
run_test --exists --print-errors simple \>= $v2
|
|
|
|
EXPECT_RETURN=0
|
|
RESULT=""
|
|
run_test --exists --print-errors --atleast-version=$v2 simple
|
|
|
|
EXPECT_RETURN=1
|
|
RESULT="Requested 'simple >= $v3' but version of Simple test is $v2"
|
|
run_test --exists --print-errors simple \>= $v3
|
|
|
|
EXPECT_RETURN=1
|
|
RESULT="Requested 'simple >= $v3' but version of Simple test is $v2"
|
|
run_test --exists --print-errors --atleast-version=$v3 simple
|
|
|
|
# max version testing
|
|
EXPECT_RETURN=1
|
|
RESULT="Requested 'simple <= $v1' but version of Simple test is $v2"
|
|
run_test --exists --print-errors simple \<= $v1
|
|
|
|
EXPECT_RETURN=1
|
|
RESULT="Requested 'simple <= $v1' but version of Simple test is $v2"
|
|
run_test --exists --print-errors --max-version=$v1 simple
|
|
|
|
EXPECT_RETURN=0
|
|
RESULT=""
|
|
run_test --exists --print-errors simple \<= $v2
|
|
|
|
EXPECT_RETURN=0
|
|
RESULT=""
|
|
run_test --exists --print-errors --max-version=$v2 simple
|
|
|
|
EXPECT_RETURN=0
|
|
RESULT=""
|
|
run_test --exists --print-errors simple \<= $v3
|
|
|
|
EXPECT_RETURN=0
|
|
RESULT=""
|
|
run_test --exists --print-errors --max-version=$v3 simple
|