提交 b58e88a6 编写于 作者: M maweiye

Fix libc-test

Modify runtest_Windows.bat to push test_dcngettext.mo to '/tmp';
Create /etc/shadow for getspnam_r;
Cancel 6 test shield and add 2 new.

Issue: I6L8HT
Test: Pass: 1156/1160
Signed-off-by: Nmaweiye <maweiye@huawei.com>
上级 08d84c3d
......@@ -29,7 +29,6 @@ char buf[1024 * 1024];
// Mock a CFI-enabled library without relying on the compiler.
__attribute__((aligned(4096))) void __cfi_check(uint64_t call_site_type_id,
void *target_addr, void *diag) {
printf("["__FILE__"][Line: %d][%s]: entry\n", __LINE__, __func__);
++g_count;
g_type_id = call_site_type_id;
g_address = target_addr;
......
......@@ -15,6 +15,16 @@ import("//build/test.gni")
import("../../../test_template.gni")
import("test_src_functionalext_locale.gni")
test_out_dir = "${root_out_dir}/musl"
action("copy_mo_file") {
outputs = [ "${test_out_dir}/libc-test" ]
script =
"//third_party/musl/libc-test/src/functionalext/locale/copy_mo_file.sh"
args = [ "-i" ] + [ rebase_path("//third_party/musl/libc-test") ]
args += [ "-o" ] + [ rebase_path("${test_out_dir}/libc-test") ]
}
foreach(s, functionalext_locale_test) {
test_unittest(s) {
target_dir = "functionalext/locale"
......@@ -27,4 +37,6 @@ group("functionalext_locale_test") {
foreach(s, functionalext_locale_test) {
deps += [ ":${s}" ]
}
deps += [ ":copy_mo_file" ]
}
#!/bin/bash
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2030. All rights reserved.
set -e
while getopts "o:i:t:h" arg
do
case "${arg}" in
"o")
OUT_DIR=${OPTARG}
;;
"i")
SOURCE_DIR=${OPTARG}
;;
"h")
echo "help"
;;
?)
echo "unkonw argument"
exit 1
;;
esac
done
if [ ! -d "${OUT_DIR}" ];then
mkdir -p ${OUT_DIR}
fi
rm -rf ${OUT_DIR}/zh_CN
mkdir ${OUT_DIR}/zh_CN
mkdir ${OUT_DIR}/zh_CN/LC_MESSAGES
cp ${SOURCE_DIR}/src/functionalext/locale/test_dcngettext.mo ${OUT_DIR}/zh_CN/LC_MESSAGES/
......@@ -31,7 +31,7 @@ static void dcngettext_0100(void)
{
char *msgid = "hello";
setlocale(LC_ALL, "zh_CN");
bindtextdomain(PACKAGE, ".");
bindtextdomain(PACKAGE, "/tmp");
textdomain(PACKAGE);
char *result = dcngettext(PACKAGE, msgid, 0, 1, LC_MESSAGES);
if (!result) {
......
......@@ -6,6 +6,7 @@ rm /data/tests/libc-test/SkipList.txt
touch /data/tests/libc-test/REPORT
touch /data/tests/libc-test/FileList.txt
touch /data/tests/libc-test/SkipList.txt
echo 'root:This.is.a.test:18997:0:99999:7:::'>/etc/shadow
function FileSuffix() {
local filename="$1"
......@@ -17,12 +18,14 @@ function FileSuffix() {
#Test cases that need to be shielded
ShieldedList=("trace_stresstest" "syslog" "vsyslog" "runtest"
#Failed when running by shell, need to be run manually
"fatal_message" "tgkill_ext" "exittest01" "exittest02" "stat" "isatty"
"ldso_randomization_manual" "ldso_randomization_test" "dlopen_ext_relro_test"
"tgkill_ext" "exittest02" "stat" "isatty" "ttyname" "a_stack_chk_fail"
"ldso_randomization_manual" "ldso_randomization_test"
"tcgetattr" "tcgetpgrp" "tcgetsid" "tcsendbreak" "tcsetattr" "tcsetpgrp"
#These need run with special condiction
"ipc_msg" "ipc_sem" "ipc_shm" "sem_close-unmap" "sem_open" "pthread_atfork-errno-clobber"
"flockfile-list" "dlns_set_fun_test" "dlns_inherit_test" "dlns_separated_test"
"pthread_atfork-errno-clobber" "flockfile-list"
#Symbol hidden
"dlns_set_fun_test" "dlns_inherit_test" "dlns_separated_test"
"unittest_ldso_ns_config" "unittest_ldso_dynlink"
#Some math test cases need to skip.
"acoshl" "asinhl" "erfcl" "fenv" "fma" "fmaf" "fmal" "lgammal" "nearbyint" "nearbyintf"
"nearbyintl" "rint" "rintf" "rintl" "sqrt" "sqrtf" "sqrtl" "tgammal"
......
......@@ -77,6 +77,8 @@ hdc shell cp %REMOTE%/src/libdlopen_dso.so %REMOTE%/src/inherit_0800.so
hdc shell cp %REMOTE%/src/libdlopen_dso.so %REMOTE%/src/inherit_1100.so
hdc shell cp %REMOTE%/src/libdlopen_ns_dso.so /system/lib
hdc shell mv %REMOTE%/src/zh_CN /tmp/zh_CN
hdc file send %SHDIR%\runtest.sh %REMOTE%/runtest.sh
hdc shell chmod +x %REMOTE%/runtest.sh
hdc shell %REMOTE%/runtest.sh
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册