Commit c5538ff8 authored by Vitaly Lipatov's avatar Vitaly Lipatov

test: improve replacement checking

parent 20afea58
...@@ -7,15 +7,18 @@ load_mod repl ...@@ -7,15 +7,18 @@ load_mod repl
# #
check() check()
{ {
[ "$2" != "$3" ] && echo "FATAL with '$1': result '$2' do not match with '$3'" || echo "OK for '$1' with '$2'" [ "$2" != "$3" ] && echo "FATAL with '$1': result '$2' do not match with expected '$3'" || echo "OK for '$1' with '$2'"
}
print_replace()
{
tolocal_anyrepl $1 `print_pkgrepl_list` || TARGETPKGNAME="$1"
echo -n "$TARGETPKGNAME"
} }
get_pkglist() get_pkglist()
{ {
VENDOR=Fedora
TARGET=rpm
DISTRVERSION=10
for i in `print_pkgrepl_list` ; do for i in `print_pkgrepl_list` ; do
echo $(basename $i) echo $(basename $i)
done done
...@@ -23,19 +26,38 @@ done ...@@ -23,19 +26,38 @@ done
get_grplist() get_grplist()
{ {
VENDOR=Fedora
TARGET=rpm
DISTRVERSION=10
for i in `print_grprepl_list` ; do for i in `print_grprepl_list` ; do
echo $(basename $i) echo $(basename $i)
done done
} }
VENDOR=Fedora
TARGET=rpm
DISTRVERSION=10
echo "PkgRepl:" echo "PkgRepl:"
get_pkglist get_pkglist
echo echo
check pkgrepl "fedora" `get_pkglist` #check pkgrepl "fedora" `get_pkglist`
echo "GrpRepl:" echo "GrpRepl:"
get_grplist get_grplist
echo echo
check_repl()
{
check $1 "`print_replace $1`" $2
}
echo "Correct replacement checking for $VENDOR/$DISTRVERSION (target $TARGET):"
check_repl rpm-build-compat rpm-build-altlinux-compat
check_repl libusb-devel libusb-devel
VENDOR=Debian
TARGET=deb
DISTRVERSION=5.0
echo "Correct replacement checking for $VENDOR/$DISTRVERSION (target $TARGET):"
check_repl rpm-build-compat rpm-build-altlinux-compat
check_repl libusb-devel libusb-dev
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment