diff options
Diffstat (limited to 'TC')
-rwxr-xr-x | TC/build.sh | 20 | ||||
-rwxr-xr-x | TC/execute.sh | 19 | ||||
-rwxr-xr-x | TC/tet_code | 12 | ||||
-rwxr-xr-x | TC/tet_scen | 7 | ||||
-rwxr-xr-x | TC/tetbuild.cfg | 3 | ||||
-rwxr-xr-x | TC/tetclean.cfg | 2 | ||||
-rwxr-xr-x | TC/tetexec.cfg | 1 | ||||
-rw-r--r-- | TC/unit/Makefile | 24 | ||||
-rwxr-xr-x | TC/unit/tc_gen.sh | 28 | ||||
-rw-r--r-- | TC/unit/tslist | 3 | ||||
-rw-r--r-- | TC/unit/utc_MODULE_API_func.c.in | 64 | ||||
-rw-r--r-- | TC/unit/utc_SystemFW_pm_change_state_func.c | 63 | ||||
-rw-r--r-- | TC/unit/utc_SystemFW_pm_lock_state_func.c | 65 | ||||
-rw-r--r-- | TC/unit/utc_SystemFW_pm_unlock_state_func.c | 72 |
14 files changed, 383 insertions, 0 deletions
diff --git a/TC/build.sh b/TC/build.sh new file mode 100755 index 0000000..98ebeff --- /dev/null +++ b/TC/build.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +export TET_INSTALL_PATH=/scratchbox/tetware # local tetware 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 + +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 3 -f chtml -o $HTML_RESULT $JOURNAL_RESULT diff --git a/TC/execute.sh b/TC/execute.sh new file mode 100755 index 0000000..6720da0 --- /dev/null +++ b/TC/execute.sh @@ -0,0 +1,19 @@ +#!/bin/sh +export TET_INSTALL_PATH=/mnt/nfs/tetware +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 + +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/tet_code b/TC/tet_code new file mode 100755 index 0000000..a2cf6c1 --- /dev/null +++ b/TC/tet_code @@ -0,0 +1,12 @@ +# 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 b/TC/tet_scen new file mode 100755 index 0000000..43cbc9b --- /dev/null +++ b/TC/tet_scen @@ -0,0 +1,7 @@ +all + ^TEST +##### Scenarios for TEST ##### + +# Test scenario +TEST + :include:/unit/tslist diff --git a/TC/tetbuild.cfg b/TC/tetbuild.cfg new file mode 100755 index 0000000..6192c78 --- /dev/null +++ b/TC/tetbuild.cfg @@ -0,0 +1,3 @@ +TET_OUTPUT_CAPTURE=False +TET_BUILD_TOOL=make +TET_PASS_TC_NAME=True diff --git a/TC/tetclean.cfg b/TC/tetclean.cfg new file mode 100755 index 0000000..c66eda4 --- /dev/null +++ b/TC/tetclean.cfg @@ -0,0 +1,2 @@ +TET_OUTPUT_CAPTURE=False +TET_CLEAN_TOOL=make clean diff --git a/TC/tetexec.cfg b/TC/tetexec.cfg new file mode 100755 index 0000000..0d9d39a --- /dev/null +++ b/TC/tetexec.cfg @@ -0,0 +1 @@ +TET_OUTPUT_CAPTURE=False diff --git a/TC/unit/Makefile b/TC/unit/Makefile new file mode 100644 index 0000000..8474034 --- /dev/null +++ b/TC/unit/Makefile @@ -0,0 +1,24 @@ +CC ?= gcc + +TARGETS = utc_SystemFW_pm_change_state_func \ + utc_SystemFW_pm_lock_state_func \ + utc_SystemFW_pm_unlock_state_func \ + +PKGS = pmapi + +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) + +$(TARGETS): %: %.c + $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS) + +clean: + rm -f $(TARGETS) diff --git a/TC/unit/tc_gen.sh b/TC/unit/tc_gen.sh new file mode 100755 index 0000000..54f482d --- /dev/null +++ b/TC/unit/tc_gen.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +TMPSTR=$0 +SCRIPT=${TMPSTR##*/} + +if [ $# -lt 2 ]; then + echo "Usage) $SCRIPT module_name api_name" + exit 1 +fi + +MODULE=$1 +API=$2 +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 "Testcase file is $TESTCASE.c" +echo "Done" +echo "please put \"$TESTCASE\" as Target in Makefile" +echo "please put \"/unit/$TESTCASE\" in tslist" diff --git a/TC/unit/tslist b/TC/unit/tslist new file mode 100644 index 0000000..4b93156 --- /dev/null +++ b/TC/unit/tslist @@ -0,0 +1,3 @@ +/unit/utc_SystemFW_pm_change_state_func +/unit/utc_SystemFW_pm_lock_state_func +/unit/utc_SystemFW_pm_unlock_state_func diff --git a/TC/unit/utc_MODULE_API_func.c.in b/TC/unit/utc_MODULE_API_func.c.in new file mode 100644 index 0000000..b235fa3 --- /dev/null +++ b/TC/unit/utc_MODULE_API_func.c.in @@ -0,0 +1,64 @@ +#include <tet_api.h> + +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/unit/utc_SystemFW_pm_change_state_func.c b/TC/unit/utc_SystemFW_pm_change_state_func.c new file mode 100644 index 0000000..ebdcedc --- /dev/null +++ b/TC/unit/utc_SystemFW_pm_change_state_func.c @@ -0,0 +1,63 @@ +#include <tet_api.h> +#include <pmapi.h> + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_SystemFW_pm_change_state_func_01(void); +static void utc_SystemFW_pm_change_state_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_SystemFW_pm_change_state_func_01, POSITIVE_TC_IDX }, + { utc_SystemFW_pm_change_state_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 }, +}; + +static void startup(void) +{ +} + +static void cleanup(void) +{ +} + +/** + * @brief Positive test case of pm_change_state() + */ +static void utc_SystemFW_pm_change_state_func_01(void) +{ + int ret_val = 0; + + ret_val = pm_change_state(LCD_NORMAL); + if(ret_val < 0) { + tet_infoline("pm_change_state() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init pm_change_state() + */ +static void utc_SystemFW_pm_change_state_func_02(void) +{ + int r = 0; + + r = pm_change_state(-1); + + if (r>=0) { + tet_infoline("pm_change_state() failed in negative test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/unit/utc_SystemFW_pm_lock_state_func.c b/TC/unit/utc_SystemFW_pm_lock_state_func.c new file mode 100644 index 0000000..cdf5edf --- /dev/null +++ b/TC/unit/utc_SystemFW_pm_lock_state_func.c @@ -0,0 +1,65 @@ +#include <tet_api.h> +#include <pmapi.h> + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_SystemFW_pm_lock_state_func_01(void); +static void utc_SystemFW_pm_lock_state_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_SystemFW_pm_lock_state_func_01, POSITIVE_TC_IDX }, + { utc_SystemFW_pm_lock_state_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 }, +}; + +static void startup(void) +{ +} + +static void cleanup(void) +{ +} + +/** + * @brief Positive test case of pm_lock_state() + */ +static void utc_SystemFW_pm_lock_state_func_01(void) +{ + int ret_val = 0; + + //Lock State as LCD_DIM for infinite time + ret_val = pm_lock_state(LCD_DIM, GOTO_STATE_NOW, 0); + pm_unlock_state (LCD_DIM ,GOTO_STATE_NOW); + if(ret_val < 0) { + tet_infoline("pm_lock_state() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init pm_lock_state() + */ +static void utc_SystemFW_pm_lock_state_func_02(void) +{ + int r = 0; + + r = pm_lock_state(-1, GOTO_STATE_NOW, 0); + + if (r>=0) { + tet_infoline("pm_lock_state() failed in negative test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} diff --git a/TC/unit/utc_SystemFW_pm_unlock_state_func.c b/TC/unit/utc_SystemFW_pm_unlock_state_func.c new file mode 100644 index 0000000..3dc187a --- /dev/null +++ b/TC/unit/utc_SystemFW_pm_unlock_state_func.c @@ -0,0 +1,72 @@ +#include <tet_api.h> +#include <pmapi.h> + +static void startup(void); +static void cleanup(void); + +void (*tet_startup)(void) = startup; +void (*tet_cleanup)(void) = cleanup; + +static void utc_SystemFW_pm_unlock_state_func_01(void); +static void utc_SystemFW_pm_unlock_state_func_02(void); + +enum { + POSITIVE_TC_IDX = 0x01, + NEGATIVE_TC_IDX, +}; + +struct tet_testlist tet_testlist[] = { + { utc_SystemFW_pm_unlock_state_func_01, POSITIVE_TC_IDX }, + { utc_SystemFW_pm_unlock_state_func_02, NEGATIVE_TC_IDX }, + { NULL, 0 }, +}; + +static void startup(void) +{ +} + +static void cleanup(void) +{ +} + +/** + * @brief Positive test case of pm_unlock_state() + */ +static void utc_SystemFW_pm_unlock_state_func_01(void) +{ + int ret_val = 0; + + //Lock State as LCD_DIM for infinite time + ret_val = pm_lock_state(LCD_DIM, GOTO_STATE_NOW, 0); + if(ret_val < 0) + { + tet_infoline("\nSystem Fwk : call to pm_lock_state for unlock failed \n"); + } + + + //Unlock previously locked state + ret_val = pm_unlock_state(LCD_DIM,GOTO_STATE_NOW); + if(ret_val < 0) { + tet_infoline("pm_unlock_state() failed in positive test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} + +/** + * @brief Negative test case of ug_init pm_unlock_state() + */ +static void utc_SystemFW_pm_unlock_state_func_02(void) +{ + int r = 0; + + r = pm_unlock_state(-1 ,GOTO_STATE_NOW); + + if (r>=0) { + tet_infoline("pm_unlock_state() failed in negative test case"); + tet_result(TET_FAIL); + return; + } + tet_result(TET_PASS); +} |