summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-05-02 14:15:32 +0200
committerAlexander Larsson <alexl@redhat.com>2016-05-02 14:15:32 +0200
commitdcfb950c3175fa613b368bb442e2934956c90649 (patch)
treef18b9f620b41ea6d2eefd2a272e82ea4a37d6605 /tests
parentdf4deecccc37e34c972183f8f6dda7134d00ad3f (diff)
downloadxdg-app-dcfb950c3175fa613b368bb442e2934956c90649.tar.gz
make-test-runtime.sh: Make this a bit more generic
We pass the id and contents on the commandline
Diffstat (limited to 'tests')
-rw-r--r--tests/libtest.sh2
-rwxr-xr-xtests/make-test-runtime.sh23
2 files changed, 12 insertions, 13 deletions
diff --git a/tests/libtest.sh b/tests/libtest.sh
index a42bff9..060a934 100644
--- a/tests/libtest.sh
+++ b/tests/libtest.sh
@@ -144,7 +144,7 @@ assert_file_empty() {
}
setup_repo () {
- . $(dirname $0)/make-test-runtime.sh > /dev/null
+ . $(dirname $0)/make-test-runtime.sh org.test.Platform bash ls cat echo readlink > /dev/null
. $(dirname $0)/make-test-app.sh > /dev/null
xdg-app remote-add --user --no-gpg-verify test-repo repo
}
diff --git a/tests/make-test-runtime.sh b/tests/make-test-runtime.sh
index 47c816f..631af63 100755
--- a/tests/make-test-runtime.sh
+++ b/tests/make-test-runtime.sh
@@ -4,7 +4,10 @@ set -e
DIR=`mktemp -d`
-xdg-app build-init ${DIR} org.test.Platform org.test.Platform org.test.Platform
+ID=$1
+shift
+
+xdg-app build-init ${DIR} ${ID} ${ID} ${ID}
sed -i s/Application/Runtime/ ${DIR}/metadata
# Add bash and dependencies
@@ -12,18 +15,14 @@ mkdir -p ${DIR}/usr/bin
mkdir -p ${DIR}/usr/lib
ln -s ../lib ${DIR}/usr/lib64
ln -s ../lib ${DIR}/usr/lib32
-BASH=`which bash`
-LS=`which ls`
-CAT=`which cat`
-ECHO=`which echo`
-READLINK=`which readlink`
-cp ${BASH} ${DIR}/usr/bin
-cp ${LS} ${DIR}/usr/bin
-cp ${CAT} ${DIR}/usr/bin
-cp ${ECHO} ${DIR}/usr/bin
-cp ${READLINK} ${DIR}/usr/bin
+T=`mktemp`
+for i in $@; do
+ I=`which $i`
+ cp $I ${DIR}/usr/bin
+ ldd $I | sed "s/.* => //" | awk '{ print $1}' | grep ^/ | grep ^/ >> $T
+done
ln -s bash ${DIR}/usr/bin/sh
-for i in `ldd ${BASH} ${LS} ${CAT} ${ECHO} ${READLINK} | sed "s/.* => //" | awk '{ print $1}' | grep -v :$ | grep ^/ | sort -u`; do
+for i in `sort -u $T`; do
cp "$i" ${DIR}/usr/lib/
done