diff options
author | jy910.yun <jy910.yun@samsung.com> | 2012-08-21 19:13:39 +0900 |
---|---|---|
committer | jy910.yun <jy910.yun@samsung.com> | 2012-08-21 19:13:39 +0900 |
commit | abc612c89a84bb39fb6087aa9945413b18e705d7 (patch) | |
tree | 9089dbb1fcae5891e15ee304a3a4dbee5292d7e8 /TC | |
parent | ecb135202477d60f05b3e3067ac834fba6657a6a (diff) | |
download | feedback-master.tar.gz feedback-master.tar.bz2 feedback-master.zip |
patch tizen_2.0_buildHEADsubmit/master/20120920.1510242.0_alphamaster2.0alpha
Diffstat (limited to 'TC')
-rwxr-xr-x | TC/_export_env.sh | 8 | ||||
-rwxr-xr-x | TC/_export_target_env.sh | 7 | ||||
-rwxr-xr-x | TC/build.sh | 16 | ||||
-rwxr-xr-x | TC/clean.sh | 11 | ||||
-rw-r--r-- | TC/config | 2 | ||||
-rwxr-xr-x | TC/execute.sh | 15 | ||||
-rwxr-xr-x | TC/testcase/Makefile | 28 | ||||
-rw-r--r-- | TC/testcase/tslist | 1 | ||||
-rw-r--r-- | TC/testcase/utc_uix_feedback.c | 191 | ||||
-rwxr-xr-x | TC/tet_scen | 7 | ||||
-rw-r--r-- | TC/tetbuild.cfg | 5 | ||||
-rw-r--r-- | TC/tetclean.cfg | 5 | ||||
-rw-r--r-- | TC/tetexec.cfg | 5 |
13 files changed, 301 insertions, 0 deletions
diff --git a/TC/_export_env.sh b/TC/_export_env.sh new file mode 100755 index 0000000..72a11ec --- /dev/null +++ b/TC/_export_env.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +. ./config +export TET_INSTALL_PATH=$TET_INSTALL_HOST_PATH # tetware root path +export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target # tetware target path +export PATH=$TET_TARGET_PATH/bin:$PATH +export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH +export TET_ROOT=$TET_TARGET_PATH diff --git a/TC/_export_target_env.sh b/TC/_export_target_env.sh new file mode 100755 index 0000000..5ddaa53 --- /dev/null +++ b/TC/_export_target_env.sh @@ -0,0 +1,7 @@ +#!/bin/sh +. ./config +export TET_INSTALL_PATH=$TET_INSTALL_TARGET_PATH # path to path +export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target +export PATH=$TET_TARGET_PATH/bin:$PATH +export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH +export TET_ROOT=$TET_TARGET_PATH diff --git a/TC/build.sh b/TC/build.sh new file mode 100755 index 0000000..72aad6c --- /dev/null +++ b/TC/build.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +. ./_export_env.sh # setting environment variables + +export TET_SUITE_ROOT=`pwd` +FILE_NAME_EXTENSION=`date +%s` + +RESULT_DIR=results +HTML_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.html +JOURNAL_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.journal + +mkdir -p $RESULT_DIR + +tcc -c -p ./ +tcc -b -j $JOURNAL_RESULT -p ./ +grw -c 7 -f chtml -o $HTML_RESULT $JOURNAL_RESULT diff --git a/TC/clean.sh b/TC/clean.sh new file mode 100755 index 0000000..29743e0 --- /dev/null +++ b/TC/clean.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +. ./_export_env.sh # setting environment variables + +export TET_SUITE_ROOT=`pwd` +RESULT_DIR=results + +tcc -c -p ./ # executing tcc, with clean option (-c) +rm -r $RESULT_DIR +rm -r tet_tmp_dir +rm testcase/tet_captured diff --git a/TC/config b/TC/config new file mode 100644 index 0000000..8b68019 --- /dev/null +++ b/TC/config @@ -0,0 +1,2 @@ +TET_INSTALL_HOST_PATH=/home/idkiller/work/tetware/TETware +TET_INSTALL_TARGET_PATH=/mnt/nfs/tetware/TETware diff --git a/TC/execute.sh b/TC/execute.sh new file mode 100755 index 0000000..a4f6095 --- /dev/null +++ b/TC/execute.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +. ./_export_target_env.sh # setting environment variables + +export TET_SUITE_ROOT=`pwd` +FILE_NAME_EXTENSION=`date +%s` + +RESULT_DIR=results +HTML_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.html +JOURNAL_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.journal + +mkdir -p $RESULT_DIR + +tcc -e -j $JOURNAL_RESULT -p ./ +grw -c 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT diff --git a/TC/testcase/Makefile b/TC/testcase/Makefile new file mode 100755 index 0000000..9fb37d5 --- /dev/null +++ b/TC/testcase/Makefile @@ -0,0 +1,28 @@ +CC = gcc + +C_FILES = $(shell ls *.c) + +PKGS = dlog capi-uix-feedback + +#TET_ROOT = /home/idkiller/work/tetware/TETware/tetware-target + +LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o +LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s +LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s +LDFLAGS += `pkg-config --libs $(PKGS)` + +CFLAGS += `pkg-config --cflags $(PKGS)` +CFLAGS += -I. +CFLAGS += -I$(TET_ROOT)/inc/tet3 +CFLAGS += -Wall + +#TARGETS = $(C_FILES:%.c=tc-%) +TCS := $(shell ls -1 *.c | cut -d. -f1) + +all: $(TCS) + +%: %.c + $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS) + +clean: + rm -f $(TCS) diff --git a/TC/testcase/tslist b/TC/testcase/tslist new file mode 100644 index 0000000..7972338 --- /dev/null +++ b/TC/testcase/tslist @@ -0,0 +1 @@ +/testcase/utc_uix_feedback diff --git a/TC/testcase/utc_uix_feedback.c b/TC/testcase/utc_uix_feedback.c new file mode 100644 index 0000000..a41da77 --- /dev/null +++ b/TC/testcase/utc_uix_feedback.c @@ -0,0 +1,191 @@ +/* + * + * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of SAMSUNG + * ELECTRONICS ("Confidential Information"). You agree and acknowledge that + * this software is owned by Samsung and you shall not disclose such + * Confidential Information and shall use it only in accordance with the terms + * of the license agreement you entered into with SAMSUNG ELECTRONICS. SAMSUNG + * make no representations or warranties about the suitability of the software, + * either express or implied, including but not limited to the implied + * warranties of merchantability, fitness for a particular purpose, or + * non-infringement. SAMSUNG shall not be liable for any damages suffered by + * licensee arising out of or related to this software. + * + */ +#include <stdio.h> +#include <tet_api.h> +#include <feedback.h> + +#define API_NAME_FEEDBACK_INITIALIZE "feedback_initialize" +#define API_NAME_FEEDBACK_DEINITIALIZE "feedback_deinitialize" +#define API_NAME_FEEDBACK_REACT "feedback_play" +#define API_NAME_FEEDBACK_REACT_TYPE "feedback_play_type" +#define API_NAME_FEEDBACK_RESOURCE_GET_PATH "feedback_get_resource_path" + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_feedback_initialize_p(void); +static void utc_feedback_deinitialize_p(void); +static void utc_feedback_play_p(void); +static void utc_feedback_play_n(void); +static void utc_feedback_play_type_p1(void); +static void utc_feedback_play_type_p2(void); +static void utc_feedback_play_type_n1(void); +static void utc_feedback_play_type_n2(void); +static void utc_feedback_get_resource_path_p(void); +static void utc_feedback_get_resource_path_n(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_feedback_initialize_p, POSITIVE_TC_IDX }, + { utc_feedback_deinitialize_p, POSITIVE_TC_IDX }, + { utc_feedback_play_p, POSITIVE_TC_IDX}, + { utc_feedback_play_n, NEGATIVE_TC_IDX}, + { utc_feedback_play_type_p1, POSITIVE_TC_IDX}, + { utc_feedback_play_type_p2, POSITIVE_TC_IDX}, + { utc_feedback_play_type_n1, NEGATIVE_TC_IDX}, + { utc_feedback_play_type_n2, NEGATIVE_TC_IDX}, + { utc_feedback_get_resource_path_p, POSITIVE_TC_IDX}, + { utc_feedback_get_resource_path_n, NEGATIVE_TC_IDX}, + { NULL, 0}, +}; + +static void startup(void) +{ +} + +static void cleanup(void) +{ +} + +static void utc_feedback_initialize_p(void) +{ + int err = feedback_initialize(); + if(err < 0){ + dts_fail(API_NAME_FEEDBACK_INITIALIZE); + }else{ + feedback_deinitialize(); + dts_pass(API_NAME_FEEDBACK_INITIALIZE); + } +} + +static void utc_feedback_deinitialize_p(void) +{ + feedback_initialize(); + int err = feedback_deinitialize(); + dts_message(API_NAME_FEEDBACK_DEINITIALIZE, "[%x]", err); + if(err < 0){ + dts_fail(API_NAME_FEEDBACK_DEINITIALIZE); + }else{ + dts_pass(API_NAME_FEEDBACK_DEINITIALIZE); + } +} + +static void utc_feedback_play_p(void) +{ + feedback_initialize(); + int err = feedback_play(FEEDBACK_PATTERN_TOUCH_TAP); + feedback_deinitialize(); + dts_message(API_NAME_FEEDBACK_DEINITIALIZE, "[%x]", err); + if(err < 0){ + dts_fail(API_NAME_FEEDBACK_REACT); + }else{ + dts_pass(API_NAME_FEEDBACK_REACT); + } +} + +static void utc_feedback_play_n(void) +{ + feedback_initialize(); + int err = feedback_play(-1); + feedback_deinitialize(); + if(err < 0){ + dts_pass(API_NAME_FEEDBACK_REACT); + }else{ + dts_fail(API_NAME_FEEDBACK_REACT); + } +} + +static void utc_feedback_play_type_p1(void) +{ + feedback_initialize(); + int err = feedback_play_type(FEEDBACK_TYPE_SOUND, FEEDBACK_PATTERN_TOUCH_TAP); + feedback_deinitialize(); + dts_message(API_NAME_FEEDBACK_DEINITIALIZE, "[%x]", err); + if(err < 0){ + dts_fail(API_NAME_FEEDBACK_REACT_TYPE); + }else{ + dts_pass(API_NAME_FEEDBACK_REACT_TYPE); + } +} + +static void utc_feedback_play_type_p2(void) +{ + feedback_initialize(); + int err = feedback_play_type(FEEDBACK_TYPE_VIBRATION, FEEDBACK_PATTERN_TOUCH_TAP); + feedback_deinitialize(); + dts_message(API_NAME_FEEDBACK_DEINITIALIZE, "[%x]", err); + if(err < 0){ + dts_fail(API_NAME_FEEDBACK_REACT_TYPE); + }else{ + dts_pass(API_NAME_FEEDBACK_REACT_TYPE); + } +} + +static void utc_feedback_play_type_n1(void) +{ + feedback_initialize(); + int err = feedback_play_type(-1, FEEDBACK_PATTERN_TOUCH_TAP); + feedback_deinitialize(); + if(err < 0){ + dts_pass(API_NAME_FEEDBACK_REACT_TYPE); + }else{ + dts_fail(API_NAME_FEEDBACK_REACT_TYPE); + } +} + +static void utc_feedback_play_type_n2(void) +{ + feedback_initialize(); + int err = feedback_play_type(FEEDBACK_TYPE_VIBRATION, -1); + feedback_deinitialize(); + if(err < 0){ + dts_pass(API_NAME_FEEDBACK_REACT_TYPE); + }else{ + dts_fail(API_NAME_FEEDBACK_REACT_TYPE); + } +} + +static void utc_feedback_get_resource_path_p(void) +{ + char* path; + int err = feedback_get_resource_path(FEEDBACK_TYPE_SOUND, FEEDBACK_PATTERN_TOUCH_TAP, &path); + dts_message(API_NAME_FEEDBACK_RESOURCE_GET_PATH, "%s", path); + if(err < 0){ + dts_fail(API_NAME_FEEDBACK_RESOURCE_GET_PATH); + }else{ + dts_pass(API_NAME_FEEDBACK_RESOURCE_GET_PATH); + } +} + +static void utc_feedback_get_resource_path_n(void) +{ + int err = feedback_get_resource_path(-1, -1, NULL); + if(err < 0){ + dts_pass(API_NAME_FEEDBACK_RESOURCE_GET_PATH); + }else{ + dts_fail(API_NAME_FEEDBACK_RESOURCE_GET_PATH); + } +} + diff --git a/TC/tet_scen b/TC/tet_scen new file mode 100755 index 0000000..03f029a --- /dev/null +++ b/TC/tet_scen @@ -0,0 +1,7 @@ +all + ^TEST +##### Scenarios for TEST ##### + +# Test scenario +TEST + :include:/testcase/tslist diff --git a/TC/tetbuild.cfg b/TC/tetbuild.cfg new file mode 100644 index 0000000..f7eda55 --- /dev/null +++ b/TC/tetbuild.cfg @@ -0,0 +1,5 @@ +TET_OUTPUT_CAPTURE=True # capture option for build operation checking +TET_BUILD_TOOL=make # build with using make command +TET_BUILD_FILE=-f Makefile # execution file (Makefile) for build +TET_API_COMPLIANT=True # use TET API in Test Case ? +TET_PASS_TC_NAME=True # report passed TC name in Journal file? diff --git a/TC/tetclean.cfg b/TC/tetclean.cfg new file mode 100644 index 0000000..02d7030 --- /dev/null +++ b/TC/tetclean.cfg @@ -0,0 +1,5 @@ +TET_OUTPUT_CAPTURE=True # capture option +TET_CLEAN_TOOL= make clean # clean tool +TET_CLEAN_FILE= Makefile # file for clean +TET_API_COMPLIANT=True # TET API useage +TET_PASS_TC_NAME=True # showing name , passed TC diff --git a/TC/tetexec.cfg b/TC/tetexec.cfg new file mode 100644 index 0000000..ef3e452 --- /dev/null +++ b/TC/tetexec.cfg @@ -0,0 +1,5 @@ +TET_OUTPUT_CAPTURE=True # capturing execution or not +TET_EXEC_TOOL= # ex) exec : execution tool set up/ Optional +TET_EXEC_FILE= # ex) exectool : execution file/ Optional +TET_API_COMPLIANT=True # Test case or Tool usesTET API? +TET_PASS_TC_NAME=True # showing Passed TC name ? |