From patchwork Mon Aug 13 03:05:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 956790 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41pgZr4P7Bz9rvt for ; Mon, 13 Aug 2018 13:05:24 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="TUiUwrgO"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41pgZr2S7dzF0Ws for ; Mon, 13 Aug 2018 13:05:24 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="TUiUwrgO"; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41pgZd53dRzF0Rr for ; Mon, 13 Aug 2018 13:05:13 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="TUiUwrgO"; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 41pgZd1z4Wz9rxx; Mon, 13 Aug 2018 13:05:13 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1534129513; bh=MP150/abv/NI8F4UvZFigXjjeOpRAANrZQ0BAFGDKZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TUiUwrgOBpJOMx9NAKWqJEew6cBdJdHTDiQBQMQfzF/4rbfdi/v9tHcTsQURIBQHb lTu7suGHCst9MbIHHuqzkU8lULzEEOCYYkGsiBfRr4VA/n2TBUh0lhpIAFeWY3MZdj /bYPPCIURxBobZ+nF0VECAUEOiWrDTqkQsHolX6uin32DOp4e6VraJLplHX6RWbwwb YBwEI9wOpeBdz4CLBtqCXfsG90VHaKnesdwJUXltzIpXqu8JRGw+nsDumSpqlVY3Q2 3nTGK0crxWHVANpbyeup2YD3VIRYGm4tfy9mI8Sfxdl66ssktxeNNpBmO5LplpUPZM pLuxlTne0gp2Q== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Mon, 13 Aug 2018 13:05:03 +1000 Message-Id: <20180813030506.429060-2-amitay@ozlabs.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180813030506.429060-1-amitay@ozlabs.org> References: <20180813030506.429060-1-amitay@ozlabs.org> Subject: [Pdbg] [PATCH 1/4] configure: Enable tests X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs MIME-Version: 1.0 Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index e2783f1..f6b8195 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,7 +4,9 @@ AM_MAKEFLAGS = --no-print-directory GIT_SHA1 ?= `git --work-tree=$(top_srcdir) --git-dir=$(top_srcdir)/.git describe --always --long --dirty 2>/dev/null || echo unknown` bin_PROGRAMS = pdbg -noinst_PROGRAMS = optcmd_test +check_PROGRAMS = optcmd_test + +TESTS = optcmd_test ACLOCAL_AMFLAGS = -Im4 AM_CFLAGS = -I$(top_srcdir)/ccan/array_size -Wall -Werror -O2 From patchwork Mon Aug 13 03:05:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 956789 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41pgZm34KXz9rxx for ; Mon, 13 Aug 2018 13:05:20 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="fs2SKY0y"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41pgZm1QKtzF0bZ for ; Mon, 13 Aug 2018 13:05:20 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="fs2SKY0y"; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41pgZd5wynzF0Vv for ; Mon, 13 Aug 2018 13:05:13 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="fs2SKY0y"; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 41pgZd3gTKz9s7X; Mon, 13 Aug 2018 13:05:13 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1534129513; bh=XLIwFBQKCpyzgyhRcEgyO6zazPqAcLPIIMZXLPnq8Gk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fs2SKY0y98UpDDtD6ohehrjH+8uK535B3mSa54XMlK3UFq/MzG+bqbeZ8coW8rbbC 6LO6s5ruWy26C7cOUezQWpE5P/Z4QHroRc82E+3pn/BNpbkQiM7kRVFzE3TBhzA3// L/T2yXLOAc9mlOT/gccVT75WCPK+78N4rHQXdTUPO/UfZHNYre9hCmXBKBVSJEdVZt PwkzYxg7dE1I0Jzn/alQQqvP8VGsKJEn8crOsUMt/irdqZ7B+zFKXjwIiHEILEYI7h DkRLub8ss2lcF2Hm9wLe7ptYUxYl10X2PstZwHYZjrsui9yeaV9VYgsy8nURSKGM03 pi2UAuO7SreyQ== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Mon, 13 Aug 2018 13:05:04 +1000 Message-Id: <20180813030506.429060-3-amitay@ozlabs.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180813030506.429060-1-amitay@ozlabs.org> References: <20180813030506.429060-1-amitay@ozlabs.org> Subject: [Pdbg] [PATCH 2/4] tests: Add simple shell test drivers X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs MIME-Version: 1.0 Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- Makefile.am | 8 +- tests/driver.sh | 247 +++++++++++++++++++++++++++++++++++++++++++ tests/run_test.sh | 91 ++++++++++++++++ tests/test_driver.sh | 38 +++++++ 4 files changed, 383 insertions(+), 1 deletion(-) create mode 100644 tests/driver.sh create mode 100755 tests/run_test.sh create mode 100755 tests/test_driver.sh diff --git a/Makefile.am b/Makefile.am index f6b8195..d7254ff 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,6 +8,9 @@ check_PROGRAMS = optcmd_test TESTS = optcmd_test +TEST_EXTENSIONS = .sh +SH_LOG_DRIVER = $(SHELL) $(srcdir)/tests/run_test.sh + ACLOCAL_AMFLAGS = -Im4 AM_CFLAGS = -I$(top_srcdir)/ccan/array_size -Wall -Werror -O2 @@ -25,7 +28,10 @@ EXTRA_DIST = \ p9w-fsi.dts.m4 \ p9z-fsi.dts.m4 \ template.S \ - generate_dt_header.sh + generate_dt_header.sh \ + tests/driver.sh \ + tests/run_test.sh \ + tests/test_driver.sh if TARGET_ARM DT_ARM = p8-fsi.dts p8-i2c.dts \ diff --git a/tests/driver.sh b/tests/driver.sh new file mode 100644 index 0000000..2b2ee49 --- /dev/null +++ b/tests/driver.sh @@ -0,0 +1,247 @@ +#!/bin/sh + +# +# Simple test driver for shell based testsuite +# +# Each testsuite is a shell script, which sources this driver file. +# Following functions can be used to define testsuite and tests. +# +# test_group +# +# Define a test suite. This function should be called before calling any +# other functions +# +# test_result <--|output> +# +# Define the exit code and the output for the test. If there is no output +# from the commands, then '--' can be specified to denote empty output. +# Multi-line output can be added using a here document. +# +# test_run [] +# +# Define the command to execute for the test. +# +# test_skip +# +# This can be called before test_run, to skip the test. This is useful to +# write tests which are dependent on the environment (e.g. architecture). +# +# +# Example: +# +# test_group "my group of tests" +# +# test_result 0 output1 +# test_run command1 arguments1 +# +# test_result 1 -- +# test_run command2 arguments2 +# +# test_result 0 output3 +# if [ $condition ] ; then +# test_skip +# fi +# test_run command3 arguments3 +# + +set -u + +TESTDIR=$(dirname "$0") +if [ "$TESTDIR" = "." ] ; then + TESTDIR=$(cd "$TESTDIR"; pwd) +fi +SRCDIR=$(dirname "$TESTDIR") +PATH="$SRCDIR":$PATH + +test_name=${TEST_NAME:-$0} +test_logfile=${TEST_LOG:-} +test_trsfile=${TEST_TRS:-} +test_color=${TEST_COLOR:-yes} + +red= grn= lgn= blu= mgn= std= +if [ $test_color = yes ] ; then + red='' # Red. + grn='' # Green. + lgn='' # Light green. + blu='' # Blue. + mgn='' # Magenta. + std='' # No color. +fi + +test_started=0 +test_skipped=0 +test_defined=0 + +count_total=0 +count_skipped=0 +count_failed=0 + +trap 'test_end' 0 + +test_group () +{ + test_name=${1:-$test_name} + test_started=1 + + echo "-- $test_name" +} + +test_end () +{ + trap 0 + if [ $count_total -eq 0 ] ; then + status=99 + elif [ $count_failed -gt 0 ] ; then + status=1 + elif [ $count_skipped -eq $count_total ] ; then + status=77 + else + status=0 + fi + + exit $status +} + +test_error () +{ + echo "$@" + exit 99 +} + +test_log () +{ + if [ -z "$test_logfile" ] ; then + echo "$@" + else + echo "$@" >> "$test_logfile" + fi +} + +test_trs () +{ + if [ -n "$test_trsfile" ] ; then + echo "$@" >> "$test_trsfile" + fi +} + +test_output () +{ + rc=${1:-1} + required_rc=${2:-0} + output_mismatch=${3:-0} + + if [ $required_rc -eq 0 ] ; then + expect_failure=no + else + expect_failure=yes + fi + + case $rc:$expect_failure:$output_mismatch in + 0:*:1) col=$red res=FAIL ;; + 0:yes:*) col=$red res=XPASS ;; + 0:*:*) col=$grn res=PASS ;; + 77:*:*) col=$blu res=SKIP ;; + *:*:1) col=$red res=FAIL ;; + *:yes:*) col=$lgn res=XFAIL ;; + *:*:*) col=$red res=FAIL ;; + esac + + if [ -n "$test_logfile" ] ; then + test_log "${res} ${test_cmd} (exit status: ${rc})" + fi + test_trs ":test-result: ${res}" + + if [ -n "$test_trsfile" ] ; then + indent=" " + else + indent="" + fi + + echo "${indent}${col}${res}${std}: ${test_cmd}" + + count_total=$(( count_total + 1 )) + if [ $res = "SKIP" ] ; then + count_skipped=$(( count_skipped + 1 )) + elif [ $res = "XPASS" -o $res = "FAIL" ] ; then + count_failed=$(( count_failed + 1 )) + fi +} + +#--------------------------------------------------------------------- +# Public functions +#--------------------------------------------------------------------- + +test_result () +{ + if [ $test_started -eq 0 ] ; then + test_error "ERROR: missing call to test_group" + fi + + required_rc="${1:-0}" + if [ $# -eq 2 ] ; then + if [ "$2" = "--" ] ; then + required_output="" + else + required_output="$2" + fi + else + if ! tty -s ; then + required_output=$(cat) + else + required_output="" + fi + fi + + test_defined=1 +} + +test_skip () +{ + if [ $test_started -eq 0 ] ; then + test_error "ERROR: missing call to test_group" + fi + + test_skipped=1 +} + +test_run () +{ + output_mismatch=0 + + if [ $test_started -eq 0 ] ; then + test_error "ERROR: missing call to test_group" + fi + + if [ $test_defined -eq 0 ] ; then + test_error "ERROR: missing call to test_result" + fi + + test_cmd="$@" + + if [ $test_skipped -eq 1 ] ; then + test_output 77 + test_skipped=0 + test_defined=0 + return + fi + + output=$("$@" 2>&1) + rc=$? + + if [ $rc -ne $required_rc ] ; then + test_log "expected rc: $required_rc" + test_log "output rc: $rc" + fi + + if [ "$output" != "$required_output" ] ; then + test_log "expected:" + test_log "$required_output" + test_log "output:" + test_log "$output" + output_mismatch=1 + fi + + test_output $rc $required_rc $output_mismatch + test_skipped=0 + test_defined=0 +} diff --git a/tests/run_test.sh b/tests/run_test.sh new file mode 100755 index 0000000..d5661b3 --- /dev/null +++ b/tests/run_test.sh @@ -0,0 +1,91 @@ +#!/bin/sh + +# Derived from automake basic testsuite driver + +set -u + +usage_error () +{ + echo "$0: $*" >&2 + print_usage >&2 + exit 2 +} + +print_usage () +{ + cat <> "$TEST_LOG" + +echo ":global-test-result: $res" >> "$TEST_TRS" +echo ":recheck: $recheck" >> "$TEST_TRS" +echo ":copy-in-global-log: $gcopy" >> "$TEST_TRS" diff --git a/tests/test_driver.sh b/tests/test_driver.sh new file mode 100755 index 0000000..6b00bf6 --- /dev/null +++ b/tests/test_driver.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +TEST_COLOR=no +TEST_LOG=/dev/null +TEST_TRS="" + +. $(dirname "$0")/driver.sh + +test_group "test driver tests" + +echo "test should PASS" +test_result 0 foo +test_run echo foo + +echo "test should FAIL" +test_result 0 foo +test_run echo bar + +echo "test should XPASS" +test_result 1 foo +test_run echo foo + +echo "test should FAIL" +test_result 1 foo +test_run echo bar + +echo "test should XFAIL" +test_result 1 -- +test_run false + +echo "test should FAIL" +test_result 1 -- +test_run echo foo && false + +echo "test should SKIP" +test_result 0 -- +test_skip +test_run echo foo From patchwork Mon Aug 13 03:05:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 956792 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41pgb00342z9rvt for ; Mon, 13 Aug 2018 13:05:32 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="ldASV0lY"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41pgZz29xBzF0Vv for ; Mon, 13 Aug 2018 13:05:31 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="ldASV0lY"; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41pgZf0NDWzF0WK for ; Mon, 13 Aug 2018 13:05:14 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="ldASV0lY"; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 41pgZd5TFQz9s89; Mon, 13 Aug 2018 13:05:13 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1534129513; bh=eU9p/RhGsea5dAzniAlEoDmkk9cHxybAw275+uMspGk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ldASV0lYHbvDuM1fIKeTBXCVqU/pz6s2OQZWQMU8gWx0b0Zoei6U1V8SzRfISIlO2 QDz0vQGM43M5aO26gicicuqWAc4x8bCU3t4az7Np6xNxaNOS/Mv1JZYxwdsDy7yBbX DooySnf5DtV9fekv9r2ZR89q9yc7LmqgkJlGm6RIqe6KKll2+pxEhGHS7wgx7+yjTP JzvFnlPDW7+6raMqG7b7EKPV7B1j1sC0AZf1cGy4iOG/4/+676GhZQ2TgtkpXVvgM4 040mHgU2F2Qjf0zMJpHK5kx6gRJ5ldKEJ6PG54ixYdcMoMJcYHkh4RcAZW3pwyTCKW 3jwLQd4D2r4dA== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Mon, 13 Aug 2018 13:05:05 +1000 Message-Id: <20180813030506.429060-4-amitay@ozlabs.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180813030506.429060-1-amitay@ozlabs.org> References: <20180813030506.429060-1-amitay@ozlabs.org> Subject: [Pdbg] [PATCH 3/4] gitignore: Ignore tests related files X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs MIME-Version: 1.0 Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 94dbc50..6816ad5 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,6 @@ m4 *.dts *.dt.h optcmd_test +*.trs +*.log +test-driver From patchwork Mon Aug 13 03:05:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 956793 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41pgb36yrZz9s8T for ; Mon, 13 Aug 2018 13:05:35 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="eQAwljl0"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41pgb34Vx3zF0bq for ; Mon, 13 Aug 2018 13:05:35 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="eQAwljl0"; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41pgZf27lpzF0WL for ; Mon, 13 Aug 2018 13:05:14 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="eQAwljl0"; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 41pgZd73F5z9s8T; Mon, 13 Aug 2018 13:05:13 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1534129514; bh=K9FVABnPY5QyT5Av/LIC71jQCwY7o4+YV1SGksmi4Qc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eQAwljl0SwaXCFSY1vj574Zh7mdcF8jrdp4bVWIpXFM91YVtLHhOdJZwmMuAHUa7O lTHAtpl1x/aoH+y9KuldPovEwS88oYZ+qvg0mTDuKG/RfaTShsfaZZ94+nZ7PUDmoO c91IjDJJPeR0OHOiHxJhTV3MI1jZaOiG/pAJ9WxX7k5s9Wm56B1fLypgGmP6u6e4O4 b9SebLkJ8L74nwhkJX/Hg80ddElvfP5hmwzxopOWTyT9BzvCEgDUuXapgA10pIM7mh oXj0ueyLw0OAgueAVvZk7/Mn4Knt2so0LmWrDdNMXBGUqIIT8b8AtVxuOJ+WdMZFIX 5V5Nzqb/lV0qg== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Mon, 13 Aug 2018 13:05:06 +1000 Message-Id: <20180813030506.429060-5-amitay@ozlabs.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180813030506.429060-1-amitay@ozlabs.org> References: <20180813030506.429060-1-amitay@ozlabs.org> Subject: [Pdbg] [PATCH 4/4] tests: Add target selection tests X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs MIME-Version: 1.0 Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- Makefile.am | 8 +- tests/test_selection.sh | 496 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 502 insertions(+), 2 deletions(-) create mode 100755 tests/test_selection.sh diff --git a/Makefile.am b/Makefile.am index d7254ff..571660d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,10 @@ GIT_SHA1 ?= `git --work-tree=$(top_srcdir) --git-dir=$(top_srcdir)/.git describe bin_PROGRAMS = pdbg check_PROGRAMS = optcmd_test -TESTS = optcmd_test +PDBG_TESTS = \ + tests/test_selection.sh + +TESTS = optcmd_test $(PDBG_TESTS) TEST_EXTENSIONS = .sh SH_LOG_DRIVER = $(SHELL) $(srcdir)/tests/run_test.sh @@ -31,7 +34,8 @@ EXTRA_DIST = \ generate_dt_header.sh \ tests/driver.sh \ tests/run_test.sh \ - tests/test_driver.sh + tests/test_driver.sh \ + $(PDBG_TESTS) if TARGET_ARM DT_ARM = p8-fsi.dts p8-i2c.dts \ diff --git a/tests/test_selection.sh b/tests/test_selection.sh new file mode 100755 index 0000000..606b99c --- /dev/null +++ b/tests/test_selection.sh @@ -0,0 +1,496 @@ +#!/bin/sh + +. $(dirname "$0")/driver.sh + +test_group "target selection tests" + +arch=$(arch 2>/dev/null) + +do_skip () +{ + if [ "$arch" != "x86_64" ] ; then + test_skip + fi +} + +test_result 0 <