Add tct/build_tct.sh script to build Native TCT
authorAleksander Mistewicz <a.mistewicz@samsung.com>
Wed, 13 Jan 2016 16:25:50 +0000 (17:25 +0100)
committerAleksander Mistewicz <a.mistewicz@samsung.com>
Fri, 13 May 2016 12:09:43 +0000 (14:09 +0200)
Change-Id: Ic37573ec68a408a0d3e9272dfe664dfb8e006e45
Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
tct/build_tct.sh [new file with mode: 0755]

diff --git a/tct/build_tct.sh b/tct/build_tct.sh
new file mode 100755 (executable)
index 0000000..3f59b82
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+# Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This script takes up to three arguments, the syntax is:
+#   build_tct.sh $ARCH $NATIVE_TCT_REPO [$RESULTS]
+#
+# It will generate list of all available testsuites in NATIVE_TCT_REPO,
+# compile them for ARCH one-by-one and copy produced zip files to RESULTS.
+# If RESULTS argument is not given, it is set to ${TESTLAB_SCRIPTS}/native_tct/${ARCH}.
+#
+# Author: Aleksander Mistewicz <a.mistewicz@samsung.com>
+
+ARCH="${1}"
+NATIVE_TCT_REPO="${2}"
+RESULTS="${3}"
+
+TESTLAB_SCRIPTS="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)"
+
+. "${TESTLAB_SCRIPTS}/common.sh"
+. "${TESTLAB_SCRIPTS}/build/build.sh"
+
+test -n "${ARCH}" || die "Missing argument: arch"
+test -n "${NATIVE_TCT_REPO}" || die "Missing argument: native_tct_repo"
+
+PACKAGES_PATH="/opt/tct/tizen_native_3.0/packages/"
+
+mkdir -p "${PACKAGES_PATH}/tv"
+mkdir -p "${PACKAGES_PATH}/common"
+
+NATIVE_TCT_LIST_PATH="/tmp/${ARCH}-$(date +%M%S)"
+
+gen_list "${NATIVE_TCT_REPO}" "${NATIVE_TCT_LIST_PATH}"
+
+cd "${NATIVE_TCT_REPO}"
+
+while IFS= read LINE
+do
+    ARCH="${ARCH}" ./tcbuild build "${LINE}"
+    ARCH="${ARCH}" ./tcbuild install "${LINE}"
+done < "${NATIVE_TCT_LIST_PATH}"
+
+test -n "${RESULTS}" || RESULTS="${TESTLAB_SCRIPTS}/native_tct/${ARCH}/"
+mkdir -p "${RESULTS}"
+mv "${PACKAGES_PATH}/tv/"* "${RESULTS}"
+mv "${PACKAGES_PATH}/common/"* "${RESULTS}"
+
+cd "${OLDPWD}"