From: WooHyun Jung Date: Wed, 8 Sep 2010 01:28:21 +0000 (+0900) Subject: [TC] TC directory is updated X-Git-Tag: origin~263^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=19f954b46ad5a9b084a79e612edd842774ffbd4a;p=framework%2Fuifw%2Felementary.git [TC] TC directory is updated --- diff --git a/TC/_export_env.sh b/TC/_export_env.sh new file mode 100755 index 0000000..b354434 --- /dev/null +++ b/TC/_export_env.sh @@ -0,0 +1,30 @@ +# Customize below path information +TET_INSTALL_PATH=/scratchbox/TETware + +TET_SIMUL_PATH=$TET_INSTALL_PATH/tetware-simulator +TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target +TET_MOUNTED_PATH=/mnt/nfs/TETware/tetware-target + +MACHINE=`echo $SBOX_UNAME_MACHINE` + +if [ $MACHINE = "i686" ] # Scratchbox i686 +then + export ARCH=simulator + export TET_ROOT=$TET_SIMUL_PATH +elif [ $MACHINE = "arm" ] # Scratchbox ARM +then + export ARCH=target + export TET_ROOT=$TET_TARGET_PATH +else + export ARCH=target + export TET_ROOT=$TET_MOUNTED_PATH +fi + +export PATH=$TET_ROOT/bin:$PATH +export LD_LIBRARY_PATH=$TET_ROOT/lib/tet3:$LD_LIBRARY_PATH + +set $(pwd) +export TET_SUITE_ROOT=$1 + +set $(date +%y%m%d_%H%M%S) +FILE_NAME_EXTENSION=$1 diff --git a/TC/build.sh b/TC/build.sh new file mode 100755 index 0000000..d32a327 --- /dev/null +++ b/TC/build.sh @@ -0,0 +1,89 @@ +export MACHINE=`echo $SBOX_UNAME_MACHINE` +echo $MACHINE +if [ $MACHINE = "i686" ] +then + TET_SCEN_FILE=tet_scen_i686 +else + TET_SCEN_FILE=tet_scen_arm +fi + +TET_SCEN_NAME=all +RESULT_TO_JOURNAL="false" + +if [ $# -eq 0 ] +then + echo + echo "ERROR : Scenario name not found" + echo + echo "SYNOPSIS :" + echo "./build-tar-host.sh [-j] [-s scenario file name] [scenario name]" + echo " -j : Write the journal file for test result" + echo " scenario name : A scenario name in 'tet_scen'file" + echo + exit 0 +fi + +SCEN_FILE_INPUT="false" +args_count=0 + +for i in $* +do + args_count=`expr $args_count + 1` + if [ $SCEN_FILE_INPUT = "true" ] + then + TET_SCEN_FILE=$i + SCEN_FILE_INPUT="false" + elif [ $i = "-j" ] + then + RESULT_TO_JOURNAL="true" + elif [ $i = "-s" ] + then + SCEN_FILE_INPUT="true" + elif [ $args_count = $# ] + then + TET_SCEN_NAME=$i + fi +done + +#Export the path information +. ./_export_env.sh + +echo TET_ROOT=$TET_ROOT +echo TET_SUITE_ROOT=$TET_SUITE_ROOT +echo TET_SCEN_FILE=$TET_SCEN_FILE +echo TET_SCEN_NAME=$TET_SCEN_NAME +echo RESULT_TO_JOURNAL=$RESULT_TO_JOURNAL + +RESULT_DIR=result + +if [ $MACHINE = "i686" ] +then + TEXT_RESULT=$RESULT_DIR/BLD-i686-$TET_SCEN_NAME-$FILE_NAME_EXTENSION.html + JOURNAL_RESULT=$RESULT_DIR/BLD-i686-$TET_SCEN_NAME-$FILE_NAME_EXTENSION.journal +else + TEXT_RESULT=$RESULT_DIR/BLD-ARM-$TET_SCEN_NAME-$FILE_NAME_EXTENSION.html + JOURNAL_RESULT=$RESULT_DIR/BLD-ARM-$TET_SCEN_NAME-$FILE_NAME_EXTENSION.journal +fi + +### Make Result output directory +echo +echo "$RESULT_DIR Folder Create" +if [ -e $RESULT_DIR ] +then + echo " -> $RESULT_DIR Folder exist" +else + mkdir $RESULT_DIR +fi + +##execute and mkae html report +tcc -c -p -s $TET_SCEN_FILE ./ $TET_SCEN_NAME +if [ $RESULT_TO_JOURNAL = "false" ] +then + tcc -b -p -j - -s $TET_SCEN_FILE ./ $TET_SCEN_NAME +else + tcc -b -j $JOURNAL_RESULT -p -s $TET_SCEN_FILE ./ $TET_SCEN_NAME + grw -c 3 -f chtml -o $TEXT_RESULT -- $JOURNAL_RESULT + echo RESULT_SUMMARY = $TEXT_RESULT + echo RESULT_JOURNAL = $JOURNAL_RESULT +fi + rm -rf ./results diff --git a/TC/elm_ts/colorpalette/Makefile b/TC/elm_ts/colorpalette/Makefile new file mode 100755 index 0000000..c49c730 --- /dev/null +++ b/TC/elm_ts/colorpalette/Makefile @@ -0,0 +1,23 @@ +CC ?= gcc + +TARGETS = utc_UIFW_elm_colorpalette_add_func \ + utc_UIFW_elm_colorpalette_color_set_func + +PKGS = elementary + +LDFLAGS = `pkg-config --libs $(PKGS)` +LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o +LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s +LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s + +CFLAGS = -I. `pkg-config --cflags $(PKGS)` +CFLAGS += -I$(TET_ROOT)/inc/tet3 +CFLAGS += -Wall + +all: $(TARGETS) + +$(TARGET): %: %.c + $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS) + +clean: + rm -f $(TARGETS) diff --git a/TC/elm_ts/colorpalette/tc_gen.sh b/TC/elm_ts/colorpalette/tc_gen.sh new file mode 100755 index 0000000..a55200a --- /dev/null +++ b/TC/elm_ts/colorpalette/tc_gen.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +TMPSTR=$0 +SCRIPT=${TMPSTR##*/} + +if [ $# -lt 3 ]; then + echo "Usage) $SCRIPT module_name winset_name api_name" + exit 1 +fi + +MODULE=$1 +WINSET=$2 +API=$3 +TEMPLATE=utc_MODULE_API_func.c.in +TESTCASE=utc_${MODULE}_${API}_func + +sed -e ' + s^@API@^'"$API"'^g + s^@MODULE@^'"$MODULE"'^g + ' $TEMPLATE > $TESTCASE.c + +if [ ! -e "$TESTCASE.c" ]; then + echo "Failed" + exit 1 +fi + +echo "/elm_ts/$WINSET/$TESTCASE" >> tslist + +echo "Testcase file is $TESTCASE.c" +echo "$TESTCASE is added to tslist" +echo "Done" +echo "please put \"$TESTCASE\" as Target in Makefile" diff --git a/TC/elm_ts/colorpalette/tslist b/TC/elm_ts/colorpalette/tslist new file mode 100644 index 0000000..25050b6 --- /dev/null +++ b/TC/elm_ts/colorpalette/tslist @@ -0,0 +1,2 @@ +/elm_ts/colorpalette/utc_UIFW_elm_colorpalette_add_func +/elm_ts/colorpalette/utc_UIFW_elm_colorpalette_color_set_func diff --git a/TC/elm_ts/colorpalette/utc_MODULE_API_func.c.in b/TC/elm_ts/colorpalette/utc_MODULE_API_func.c.in new file mode 100755 index 0000000..710e5a1 --- /dev/null +++ b/TC/elm_ts/colorpalette/utc_MODULE_API_func.c.in @@ -0,0 +1,103 @@ +#include +#include + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err == (x1)) \ + { \ + tet_printf("[TET_CHECK_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + +// For checking the result of the negative test case. +#define TET_CHECK_FAIL(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err != (x1)) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + + +Evas_Object *main_win; + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_@MODULE@_@API@_func_01(void); +static void utc_@MODULE@_@API@_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_@MODULE@_@API@_func_01, POSITIVE_TC_IDX }, + { utc_@MODULE@_@API@_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of @API@() + */ +static void utc_@MODULE@_@API@_func_01(void) +{ + int r = 0; + +/* + r = @API@(...); +*/ + if (!r) { + tet_infoline("@API@() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init @API@() + */ +static void utc_@MODULE@_@API@_func_02(void) +{ + int r = 0; + +/* + r = @API@(...); +*/ + if (r) { + tet_infoline("@API@() failed in negative test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/colorpalette/utc_UIFW_elm_colorpalette_add_func.c b/TC/elm_ts/colorpalette/utc_UIFW_elm_colorpalette_add_func.c new file mode 100644 index 0000000..cfb6332 --- /dev/null +++ b/TC/elm_ts/colorpalette/utc_UIFW_elm_colorpalette_add_func.c @@ -0,0 +1,103 @@ +#include +#include + + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err == (x1)) \ + { \ + tet_printf("[TET_CHECK_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + +// For checking the result of the negative test case. +#define TET_CHECK_FAIL(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err != (x1)) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + + +Evas_Object *main_win; + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_colorpalette_add_func_01(void); +static void utc_UIFW_elm_colorpalette_add_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_colorpalette_add_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_colorpalette_add_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_colorpalette_add() + */ +static void utc_UIFW_elm_colorpalette_add_func_01(void) +{ + Evas_Object *colorpalette = NULL; + + colorpalette = elm_colorpalette_add(main_win); + + if (!colorpalette) { + tet_infoline("elm_colorpalette_add() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_colorpalette_add() + */ +static void utc_UIFW_elm_colorpalette_add_func_02(void) +{ + Evas_Object *colorpalette = NULL; + + + colorpalette = elm_colorpalette_add(NULL); + + if (colorpalette) { + tet_infoline("elm_colorpalette_add() failed in negative test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/colorpalette/utc_UIFW_elm_colorpalette_color_set_func.c b/TC/elm_ts/colorpalette/utc_UIFW_elm_colorpalette_color_set_func.c new file mode 100644 index 0000000..a68ef3a --- /dev/null +++ b/TC/elm_ts/colorpalette/utc_UIFW_elm_colorpalette_color_set_func.c @@ -0,0 +1,138 @@ +#include +#include + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err == (x1)) \ + { \ + tet_printf("[TET_CHECK_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + +// For checking the result of the negative test case. +#define TET_CHECK_FAIL(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err != (x1)) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + + +Evas_Object *main_win; +Evas_Object *colorpalette; + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_colorpalette_color_set_func_01(void); +static void utc_UIFW_elm_colorpalette_color_set_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_colorpalette_color_set_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_colorpalette_color_set_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + elm_init(0, NULL); + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + evas_object_show(main_win); + colorpalette = elm_colorpalette_add(main_win); + evas_object_show(colorpalette); +} + +static void cleanup(void) +{ + if ( NULL != main_win ) { + evas_object_del(main_win); + main_win = NULL; + } + else if ( NULL != colorpalette ) { + evas_object_del(colorpalette); + colorpalette = NULL; + } + elm_shutdown(); + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); +} + +/** + * @brief Positive test case of elm_colorpalette_color_set() + */ +static void utc_UIFW_elm_colorpalette_color_set_func_01(void) +{ + Elm_Colorpalette_Color color_set[5]; + + color_set[ 0 ].r = 255; + color_set[ 0 ].g = 90; + color_set[ 0 ].b = 18; + + color_set[ 1 ].r = 255; + color_set[ 1 ].g = 213; + color_set[ 1 ].b = 0; + + color_set[ 2 ].r = 146; + color_set[ 2 ].g = 255; + color_set[ 2 ].b = 11; + + color_set[ 3 ].r = 9; + color_set[ 3 ].g = 186; + color_set[ 3 ].b = 10; + + color_set[ 4 ].r = 86; + color_set[ 4 ].g = 201; + color_set[ 4 ].b = 242; + + elm_colorpalette_color_set(colorpalette, 5, color_set); + + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_colorpalette_color_set() + */ +static void utc_UIFW_elm_colorpalette_color_set_func_02(void) +{ + Elm_Colorpalette_Color color_set[5]; + + color_set[ 0 ].r = 255; + color_set[ 0 ].g = 90; + color_set[ 0 ].b = 18; + + color_set[ 1 ].r = 255; + color_set[ 1 ].g = 213; + color_set[ 1 ].b = 0; + + color_set[ 2 ].r = 146; + color_set[ 2 ].g = 255; + color_set[ 2 ].b = 11; + + color_set[ 3 ].r = 9; + color_set[ 3 ].g = 186; + color_set[ 3 ].b = 10; + + color_set[ 4 ].r = 86; + color_set[ 4 ].g = 201; + color_set[ 4 ].b = 242; + + elm_colorpalette_color_set(NULL, 5, color_set); + + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/imageslider/Makefile b/TC/elm_ts/imageslider/Makefile new file mode 100755 index 0000000..540be4c --- /dev/null +++ b/TC/elm_ts/imageslider/Makefile @@ -0,0 +1,23 @@ +CC ?= gcc + +TARGETS = uts_elm_imageslider_add_test \ + uts_elm_imageslider_add_func + +PKGS = elementary + +LDFLAGS = `pkg-config --libs $(PKGS)` +LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o +LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s +LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s + +CFLAGS = -I. `pkg-config --cflags $(PKGS)` +CFLAGS += -I$(TET_ROOT)/inc/tet3 +CFLAGS += -Wall + +all: $(TARGETS) + +$(TARGET): %: %.c + $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS) + +clean: + rm -f $(TARGETS) diff --git a/TC/elm_ts/imageslider/tc_gen.sh b/TC/elm_ts/imageslider/tc_gen.sh new file mode 100755 index 0000000..a55200a --- /dev/null +++ b/TC/elm_ts/imageslider/tc_gen.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +TMPSTR=$0 +SCRIPT=${TMPSTR##*/} + +if [ $# -lt 3 ]; then + echo "Usage) $SCRIPT module_name winset_name api_name" + exit 1 +fi + +MODULE=$1 +WINSET=$2 +API=$3 +TEMPLATE=utc_MODULE_API_func.c.in +TESTCASE=utc_${MODULE}_${API}_func + +sed -e ' + s^@API@^'"$API"'^g + s^@MODULE@^'"$MODULE"'^g + ' $TEMPLATE > $TESTCASE.c + +if [ ! -e "$TESTCASE.c" ]; then + echo "Failed" + exit 1 +fi + +echo "/elm_ts/$WINSET/$TESTCASE" >> tslist + +echo "Testcase file is $TESTCASE.c" +echo "$TESTCASE is added to tslist" +echo "Done" +echo "please put \"$TESTCASE\" as Target in Makefile" diff --git a/TC/elm_ts/imageslider/tslist b/TC/elm_ts/imageslider/tslist new file mode 100644 index 0000000..4b0e9f1 --- /dev/null +++ b/TC/elm_ts/imageslider/tslist @@ -0,0 +1,2 @@ +/elm_ts/imageslider/utc_UIFW_elm_imageslider_add_func +/elm_ts/imageslider/utc_UIFW_elm_imageslider_add_func diff --git a/TC/elm_ts/imageslider/utc_MODULE_API_func.c.in b/TC/elm_ts/imageslider/utc_MODULE_API_func.c.in new file mode 100755 index 0000000..da52d9f --- /dev/null +++ b/TC/elm_ts/imageslider/utc_MODULE_API_func.c.in @@ -0,0 +1,90 @@ +#include + + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err == (x1)) \ + { \ + tet_printf("[TET_CHECK_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + +// For checking the result of the negative test case. +#define TET_CHECK_FAIL(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err != (x1)) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_@MODULE@_@API@_func_01(void); +static void utc_@MODULE@_@API@_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_@MODULE@_@API@_func_01, POSITIVE_TC_IDX }, + { utc_@MODULE@_@API@_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ +} + +static void cleanup(void) +{ +} + +/** + * @brief Positive test case of @API@() + */ +static void utc_@MODULE@_@API@_func_01(void) +{ + int r = 0; + +/* + r = @API@(...); +*/ + if (r) { + tet_infoline("@API@() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init @API@() + */ +static void utc_@MODULE@_@API@_func_02(void) +{ + int r = 0; + +/* + r = @API@(...); +*/ + if (r) { + tet_infoline("@API@() failed in negative test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/imageslider/utc_UIFW_elm_imageslider_add_func.c b/TC/elm_ts/imageslider/utc_UIFW_elm_imageslider_add_func.c new file mode 100644 index 0000000..72bc6c9 --- /dev/null +++ b/TC/elm_ts/imageslider/utc_UIFW_elm_imageslider_add_func.c @@ -0,0 +1,90 @@ +#include + + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err == (x1)) \ + { \ + tet_printf("[TET_CHECK_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + +// For checking the result of the negative test case. +#define TET_CHECK_FAIL(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err != (x1)) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_imageslider_add_func_01(void); +static void utc_UIFW_elm_imageslider_add_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_imageslider_add_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_imageslider_add_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ +} + +static void cleanup(void) +{ +} + +/** + * @brief Positive test case of elm_imageslider_add() + */ +static void utc_UIFW_elm_imageslider_add_func_01(void) +{ + int r = 0; + +/* + r = elm_imageslider_add(...); +*/ + if (r) { + tet_infoline("elm_imageslider_add() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_imageslider_add() + */ +static void utc_UIFW_elm_imageslider_add_func_02(void) +{ + int r = 0; + +/* + r = elm_imageslider_add(...); +*/ + if (r) { + tet_infoline("elm_imageslider_add() failed in negative test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/template/Makefile b/TC/elm_ts/template/Makefile new file mode 100755 index 0000000..540be4c --- /dev/null +++ b/TC/elm_ts/template/Makefile @@ -0,0 +1,23 @@ +CC ?= gcc + +TARGETS = uts_elm_imageslider_add_test \ + uts_elm_imageslider_add_func + +PKGS = elementary + +LDFLAGS = `pkg-config --libs $(PKGS)` +LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o +LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s +LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s + +CFLAGS = -I. `pkg-config --cflags $(PKGS)` +CFLAGS += -I$(TET_ROOT)/inc/tet3 +CFLAGS += -Wall + +all: $(TARGETS) + +$(TARGET): %: %.c + $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS) + +clean: + rm -f $(TARGETS) diff --git a/TC/elm_ts/template/tc_gen.sh b/TC/elm_ts/template/tc_gen.sh new file mode 100755 index 0000000..a55200a --- /dev/null +++ b/TC/elm_ts/template/tc_gen.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +TMPSTR=$0 +SCRIPT=${TMPSTR##*/} + +if [ $# -lt 3 ]; then + echo "Usage) $SCRIPT module_name winset_name api_name" + exit 1 +fi + +MODULE=$1 +WINSET=$2 +API=$3 +TEMPLATE=utc_MODULE_API_func.c.in +TESTCASE=utc_${MODULE}_${API}_func + +sed -e ' + s^@API@^'"$API"'^g + s^@MODULE@^'"$MODULE"'^g + ' $TEMPLATE > $TESTCASE.c + +if [ ! -e "$TESTCASE.c" ]; then + echo "Failed" + exit 1 +fi + +echo "/elm_ts/$WINSET/$TESTCASE" >> tslist + +echo "Testcase file is $TESTCASE.c" +echo "$TESTCASE is added to tslist" +echo "Done" +echo "please put \"$TESTCASE\" as Target in Makefile" diff --git a/TC/elm_ts/template/tslist b/TC/elm_ts/template/tslist new file mode 100644 index 0000000..5cb662f --- /dev/null +++ b/TC/elm_ts/template/tslist @@ -0,0 +1 @@ +/elm_ts/imageslider/utc_UIFW_elm_imageslider_add_func diff --git a/TC/elm_ts/template/utc_UIFW_elm_imageslider_add_func.c b/TC/elm_ts/template/utc_UIFW_elm_imageslider_add_func.c new file mode 100644 index 0000000..04a79b9 --- /dev/null +++ b/TC/elm_ts/template/utc_UIFW_elm_imageslider_add_func.c @@ -0,0 +1,64 @@ +#include + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_imageslider_add_func_01(void); +static void utc_UIFW_elm_imageslider_add_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_imageslider_add_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_imageslider_add_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ +} + +static void cleanup(void) +{ +} + +/** + * @brief Positive test case of elm_imageslider_add() + */ +static void utc_UIFW_elm_imageslider_add_func_01(void) +{ + int r = 0; + +/* + r = elm_imageslider_add(...); +*/ + if (r) { + tet_infoline("elm_imageslider_add() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_imageslider_add() + */ +static void utc_UIFW_elm_imageslider_add_func_02(void) +{ + int r = 0; + +/* + r = elm_imageslider_add(...); +*/ + if (r) { + tet_infoline("elm_imageslider_add() failed in negative test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/template/utc_UIFW_elm_imageslider_append_func.c b/TC/elm_ts/template/utc_UIFW_elm_imageslider_append_func.c new file mode 100644 index 0000000..235abbe --- /dev/null +++ b/TC/elm_ts/template/utc_UIFW_elm_imageslider_append_func.c @@ -0,0 +1,64 @@ +#include + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_UIFW_elm_imageslider_append_func_01(void); +static void utc_UIFW_elm_imageslider_append_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_UIFW_elm_imageslider_append_func_01, POSITIVE_TC_IDX }, + { utc_UIFW_elm_imageslider_append_func_02, NEGATIVE_TC_IDX }, +}; + +static void startup(void) +{ +} + +static void cleanup(void) +{ +} + +/** + * @brief Positive test case of elm_imageslider_append() + */ +static void utc_UIFW_elm_imageslider_append_func_01(void) +{ + int r = 0; + +/* + r = elm_imageslider_append(...); +*/ + if (r) { + tet_infoline("elm_imageslider_append() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init elm_imageslider_append() + */ +static void utc_UIFW_elm_imageslider_append_func_02(void) +{ + int r = 0; + +/* + r = elm_imageslider_append(...); +*/ + if (r) { + tet_infoline("elm_imageslider_append() failed in negative test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/elm_ts/template/uts_elm_imageslider_add_func.c b/TC/elm_ts/template/uts_elm_imageslider_add_func.c new file mode 100755 index 0000000..ea1fbd0 --- /dev/null +++ b/TC/elm_ts/template/uts_elm_imageslider_add_func.c @@ -0,0 +1,147 @@ + +#include +//#include "winset_test.h" +//#include "winset_until.h" +#include "uts_elm_imageslider_add_test.h" + +// Definitions +// For checking the result of the positive test case. +#define TET_CHECK_PASS(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err == (x1)) \ + { \ + tet_printf("[TET_CHECK_PASS]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + +// For checking the result of the negative test case. +#define TET_CHECK_FAIL(x1, y...) \ +{ \ + Evas_Object *err = y; \ + if (err != (x1)) \ + { \ + tet_printf("[TET_CHECK_FAIL]:: %s[%d] : Test has failed..", __FILE__,__LINE__); \ + tet_result(TET_FAIL); \ + return; \ + } \ +} + +// Declare the global variables +Evas_Object *main_win, *main_bg; +Evas_Object *test_win, *test_bg; +Evas_Object *test_eo = NULL; +// Declare internal functions +void _elm_precondition(void); +static void _win_del(void *data, Evas_Object *obj, void *event_info); + + +// Delete main window +static void _win_del(void *data, Evas_Object *obj, void *event_info) +{ + elm_exit(); +} + +// Do precondition. +void _elm_precondition(void) +{ + elm_init(0, NULL); + + main_win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + elm_win_title_set(main_win, "Elementary Unit Test Suite"); + evas_object_smart_callback_add(main_win, "delete,request", _win_del, NULL); + main_bg = elm_bg_add(main_win); + evas_object_size_hint_weight_set(main_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(main_win, main_bg); + evas_object_show(main_bg); + + // set an initial window size + evas_object_resize(main_win, 320, 480); + // show the window + evas_object_show(main_win); + + //elm_run(); +} + + +// Start up function for each test purpose +static void +startup() +{ + tet_infoline("[[ TET_MSG ]]:: ============ Startup ============ "); + + // Elm precondition + _elm_precondition(); + + // Test precondition + test_win = elm_win_add(NULL, "Image Silder", ELM_WIN_BASIC); + elm_win_title_set(test_win, "Image Slider"); + elm_win_autodel_set(test_win, 1); + + test_bg = elm_bg_add(test_win); + elm_win_resize_object_add(test_win, test_bg); + evas_object_size_hint_weight_set(test_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_show(test_bg); + + evas_object_resize(test_win, 480, 800); + evas_object_show(test_win); + + tet_infoline("[[ TET_MSG ]]:: Completing startup"); +} + +// Clean up function for each test purpose +static void +cleanup() +{ + // Clean up the used resources. + if ( NULL != main_win ) { + main_win = NULL; + } + + if ( NULL != main_bg ) { + main_bg = NULL; + } + + if ( NULL != test_win ) { + test_win = NULL; + } + + if ( NULL != test_bg ) { + test_bg = NULL; + } + + if ( NULL != test_eo ) { + test_eo = NULL; + } + + elm_exit(); + + tet_infoline("[[ TET_MSG ]]:: ============ Cleanup ============ "); + +} + +// Positive test case. +void uts_elm_imageslider_add_test_001() +{ + test_eo = elm_imageslider_add(test_win); + TET_CHECK_PASS(NULL, test_win); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_01, [TYPE]: Positive, [RESULT]:PASS, An Image Slider is added successfully."); + +} + + +// Negative test case. +void uts_elm_imageslider_add_test_002() +{ + test_eo = elm_imageslider_add(NULL); + TET_CHECK_FAIL(NULL, test_eo); + + tet_result(TET_PASS); + tet_infoline("[[ TET_MSG ]]::[ID]:TC_02, [TYPE]: Negative, [RESULT]:PASS, Adding an Image Slider has failed."); +} + + diff --git a/TC/elm_ts/template/uts_elm_imageslider_add_func.h b/TC/elm_ts/template/uts_elm_imageslider_add_func.h new file mode 100755 index 0000000..dc1e354 --- /dev/null +++ b/TC/elm_ts/template/uts_elm_imageslider_add_func.h @@ -0,0 +1,30 @@ + + +#ifndef _UTS_ELM_IMAGESLIDER_ADD_TEST_ +#define _UTS_ELM_IMAGESLIDER_ADD_TEST_ + +#include +#include +#include +#include +#include + +// Test cases in unit test suite +void uts_elm_imageslider_add_test_001(); +void uts_elm_imageslider_add_test_002(); + + +static void startup(); +static void cleanup(); + +// Initialize TCM data structures +void (*tet_startup)() = startup; +void (*tet_cleanup)() = cleanup; + +struct tet_testlist tet_testlist[] = { + {uts_elm_imageslider_add_test_001, 1}, + {uts_elm_imageslider_add_test_002, 2}, + {NULL, 0} +}; + +#endif // _UTS_ELM_IMAGESLIDER_ADD_TEST_ diff --git a/TC/execute.sh b/TC/execute.sh new file mode 100755 index 0000000..e4e43ab --- /dev/null +++ b/TC/execute.sh @@ -0,0 +1,81 @@ +export MACHINE=`echo $SBOX_UNAME_MACHINE` + +if [ $MACHINE = "i686" ] +then + TET_SCEN_FILE=tet_scen_i686 +else + TET_SCEN_FILE=tet_scen_arm +fi + +TET_SCEN_NAME=all +RESULT_TO_JOURNAL="false" + +if [ $# -eq 0 ] +then + RESULT_TO_JOURNAL="false" + TET_SCEN_NAME="tet_scen" +fi + +SCEN_FILE_INPUT="false" +args_count=0 + +for i in $* +do + args_count=`expr $args_count + 1` + if [ $SCEN_FILE_INPUT = "true" ] + then + TET_SCEN_FILE=$i + SCEN_FILE_INPUT="false" + elif [ $i = "-j" ] + then + RESULT_TO_JOURNAL="true" + elif [ $i = "-s" ] + then + SCEN_FILE_INPUT="true" + elif [ $args_count = $# ] + then + TET_SCEN_NAME=$i + fi +done + +#Export the path information +. ./_export_env.sh + +echo TET_ROOT=$TET_ROOT +echo TET_SUITE_ROOT=$TET_SUITE_ROOT +echo TET_SCEN_FILE=$TET_SCEN_FILE +echo TET_SCEN_NAME=$TET_SCEN_NAME +echo RESULT_TO_JOURNAL=$RESULT_TO_JOURNAL + +RESULT_DIR=result +#if [ $MACHINE = "i686" ] +if [ $MACHINE = "i686" ] +then + TEXT_RESULT=$RESULT_DIR/EXE-i686-$TET_SCEN_NAME-$FILE_NAME_EXTENSION.html + JOURNAL_RESULT=$RESULT_DIR/EXE-i686-$TET_SCEN_NAME-$FILE_NAME_EXTENSION.journal +else + TEXT_RESULT=$RESULT_DIR/EXE-ARM-$TET_SCEN_NAME-$FILE_NAME_EXTENSION.html + JOURNAL_RESULT=$RESULT_DIR/EXE-ARM-$TET_SCEN_NAME-$FILE_NAME_EXTENSION.journal +fi + +### Make Result output directory +echo +echo "$RESULT_DIR Folder Creat" +if [ -e $RESULT_DIR ] +then + echo " -> $RESULT_DIR Folder exist" +else + mkdir $RESULT_DIR +fi + +##execute and mkae html report +if [ $RESULT_TO_JOURNAL = "false" ] +then + tcc -e -p -j - -s $TET_SCEN_FILE ./ $TET_SCEN_NAME +else + tcc -e -j $JOURNAL_RESULT -p -s $TET_SCEN_FILE ./ $TET_SCEN_NAME + grw -c 3 -f chtml -o $TEXT_RESULT -- $JOURNAL_RESULT + echo RESULT_SUMMARY = $TEXT_RESULT + echo RESULT_JOURNAL = $JOURNAL_RESULT +fi + rm -rf ./results diff --git a/TC/tet_code b/TC/tet_code new file mode 100755 index 0000000..8d6c2cd --- /dev/null +++ b/TC/tet_code @@ -0,0 +1,13 @@ +# TET reserved codes +0 "PASS" +1 "FAIL" +2 "UNRESOLVED" +3 "NOTINUSE" +4 "UNSUPPORTED" +5 "UNTESTED" +6 "UNINITIATED" +7 "NORESULT" + +# Test suite additional codes +33 "INSPECT" + diff --git a/TC/tet_scen_arm b/TC/tet_scen_arm new file mode 100755 index 0000000..6f45dfc --- /dev/null +++ b/TC/tet_scen_arm @@ -0,0 +1,30 @@ +all + "Test all XO frameworks" + + ^elm + +##### Scenarios for the frameworks ###### + +# EFL +elm + :include:/elm_ts/imageslider/tslist + :include:/elm_ts/colorpalette/tslist + + +#yhkim +ch + /telephony-framework/sim/unit/uts_tapi_verify_chv +pn + /telephony-framework/sim/unit/uts_tapi_change_pin1 +cn + /telephony-framework/sim/unit/uts_tapi_pb_get_storage_count +in + /telephony-framework/sim/unit/uts_tapi_pb_entry_info +ac + /telephony-framework/sim/unit/uts_tapi_pb_read_access +ma + /telephony-framework/sim/unit/uts_tapi_pb_rec_modify_access +da + /telephony-framework/sim/unit/uts_tapi_pb_delete_access +if + /telephony-framework/sim/unit/uts_tapi_pb_capability_info diff --git a/TC/tet_scen_i686 b/TC/tet_scen_i686 new file mode 100755 index 0000000..ddabbd5 --- /dev/null +++ b/TC/tet_scen_i686 @@ -0,0 +1,38 @@ +all + "Test all XO frameworks" + + ^mediaplayer + ^camcorder + ^sound + ^attrs + +##### Scenarios for the frameworks ###### + +# Multimedia +mediaplayer + :include:/multimedia-framework/Multimedia_M2_testscripts/player/tslist +camcorder + :include:/multimedia-framework/Multimedia_M2_testscripts/camcorder/tslist +sound + :include:/multimedia-framework/Multimedia_M2_testscripts/sound/tslist +attrs + :include:/multimedia-framework/Multimedia_M2_testscripts/attrs/tslist + + +#yhkim +ch + /telephony-framework/sim/unit/uts_tapi_verify_chv +pn + /telephony-framework/sim/unit/uts_tapi_change_pin1 +cn + /telephony-framework/sim/unit/uts_tapi_pb_get_storage_count +in + /telephony-framework/sim/unit/uts_tapi_pb_entry_info +ac + /telephony-framework/sim/unit/uts_tapi_pb_read_access +ma + /telephony-framework/sim/unit/uts_tapi_pb_rec_modify_access +da + /telephony-framework/sim/unit/uts_tapi_pb_delete_access +if + /telephony-framework/sim/unit/uts_tapi_pb_capability_info diff --git a/TC/tetbuild.cfg b/TC/tetbuild.cfg new file mode 100755 index 0000000..c95e21e --- /dev/null +++ b/TC/tetbuild.cfg @@ -0,0 +1,5 @@ +TET_OUTPUT_CAPTURE=true +TET_BUILD_TOOL=make +#TET_BUILD_FILE=-f Makefile +#TET_API_COMPLIANT=True + diff --git a/TC/tetclean.cfg b/TC/tetclean.cfg new file mode 100755 index 0000000..48479a9 --- /dev/null +++ b/TC/tetclean.cfg @@ -0,0 +1,4 @@ +TET_OUTPUT_CAPTURE=True +TET_CLEAN_TOOL=make clean +#TET_CLEAN_FILE=clean + diff --git a/TC/tetexec.cfg b/TC/tetexec.cfg new file mode 100755 index 0000000..e1cbaf9 --- /dev/null +++ b/TC/tetexec.cfg @@ -0,0 +1,5 @@ +TET_OUTPUT_CAPTURE=false +#TET_EXEC_IN_PLACE=True +#TET_EXEC_TOOL=exectool + +