#!/usr/bin/env bash
# most tests are done between two images (-I), do generic tests with system's
set_portroot
touch file{1..4}
ebuild "$(get_ebuild test 1.5 :)" merge
ebuild "$(get_ebuild test 2.5 :)" install
expect -! "CMP:*" -c dev-test/test
ebuild "$(get_ebuild test 2.5 bin:file{1..2} lib.so:"${LIBD100}")" clean merge
xfail 1 expect -2 "*Error: found nothing to compare*" -c dev-test/test
expect "*CMP: listing*" -c --single-all dev-test/test
ebuild "$(get_ebuild test 3.5 bin:file{3..4} lib.so:{"${LIBD200}","${LIBA300}"})" install
expect "*FILES: usr/bin/file3*SONAME: libalt.so.3*FILES:-usr/bin/file1*FILES:+usr/bin/file4*SONAME:-libdummy.so.1*SONAME:+libdummy.so.2*" -c --single-all dev-test/test
expect "*FILES: usr/bin/file1*SONAME: libdummy.so.1*FILES:-usr/bin/file3*FILES:+usr/bin/file2*SONAME:-libalt.so.3*SONAME:+libdummy.so.1*" -c --single-all =dev-test/test-3.5 =dev-test/test-2.5
