diff --git a/libc-test/test_template.gni b/libc-test/test_template.gni index a116fd7b94f89ed6e44deb167a5575f0341d8706..099930a6b6453296c02cffde24e0f33c90f25ee6 100644 --- a/libc-test/test_template.gni +++ b/libc-test/test_template.gni @@ -97,11 +97,13 @@ template("test_unittest") { #libs += [ "//${root_out_dir}/${test_lib_dir}/libdlopen_dso.so" ] } - if (target_name == "tls_align" || target_name == "tls_align_dlopen") { + if (target_name == "tls_align") { + ldflags += [ "-Wl,-rpath=src/functional" ] libs += [ "//${root_out_dir}/${test_lib_dir}/libtls_align_dso.so" ] } - if (target_name == "tls_init" || target_name == "tls_init_dlopen") { + if (target_name == "tls_init") { + ldflags += [ "-Wl,-rpath=src/functional" ] libs += [ "//${root_out_dir}/${test_lib_dir}/libtls_init_dso.so" ] } } @@ -134,7 +136,7 @@ template("test_unittest") { ] if (target_name == "tls_get_new-dtv") { - ldflags += [ "-Wl,-rpath='\$ORIGIN'" ] + ldflags += [ "-Wl,-rpath=./" ] libs += [ "//${root_out_dir}/${test_lib_dir}/libtls_get_new-dtv_dso.so" ] } diff --git a/scripts/runtest.bat b/scripts/runtest.bat index 88abfb21ef2f95ffe998a0adae3820cf25ce80ad..9086eb20ec4ef0c460ab5f2053a27596aa3163e1 100644 --- a/scripts/runtest.bat +++ b/scripts/runtest.bat @@ -10,6 +10,8 @@ set LOCAL=\\wsl$\ubuntu-20.04\home\OHOS\out\ohos-arm-release\tests\unittest\libc set REMOTE=/data/tests/libc-test/src @REM runtest脚本所在目录 set SHDIR=\\wsl$\Ubuntu-20.04\home\OHOS\third_party\musl\scripts +@REM 动态链接库所在目录 +set DYNLIB=\\wsl$\Ubuntu-18.04\root\openhramony2\out\ohos-arm-release\musl\libc-test\lib @REM 检查设备是否连接 echo HDC device checking... @@ -31,6 +33,14 @@ hdc shell mkdir %REMOTE%/functional hdc shell mkdir %REMOTE%/math hdc shell mkdir %REMOTE%/musl hdc shell mkdir %REMOTE%/regression + +@REM 创建临时文件夹 +hdc shell mkdir /tmp +hdc shell mkdir /dev/shm + +@REM 创建存放动态库文件夹 +hdc shell mkdir %REMOTE%/functional/src +hdc shell mkdir %REMOTE%/functional/src/functional echo Done. goto hdcSend @@ -40,14 +50,26 @@ for /F %%i in ('dir %LOCAL% /S /B') do ( for %%b in ("%%i\..") do ( echo Sending %%~nb/%%~nxi hdc file send -sync %%i %REMOTE%/%%~nb/%%~nxi - hdc shell chmod 777 %REMOTE%/%%~nb/%%~nxi + hdc shell chmod a+x %REMOTE%/%%~nb/%%~nxi ) ) + +@REM 动态库传输 +hdc file send %DYNLIB%\libdlopen_dso.so %REMOTE%/functional +hdc file send %DYNLIB%\libtls_get_new-dtv_dso.so %REMOTE%/regression +hdc file send %DYNLIB%\libtls_align_dso.so %REMOTE%/functional/src/functional +hdc file send %DYNLIB%\libtls_init_dso.so %REMOTE%/functional/src/functional + +@REM 修改动态库权限 +hdc shell chmod a+x %REMOTE%/functional/libdlopen_dso.so +hdc shell chmod a+x %REMOTE%/regression/libtls_get_new-dtv_dso.so +hdc shell chmod a+x %REMOTE%/functional/src/functional/libtls_align_dso.so +hdc shell chmod a+x %REMOTE%/functional/src/functional/libtls_init_dso.so echo Done. echo. echo Sending run.sh hdc file send %SHDIR%\run.sh %REMOTE%/runtest.sh -hdc shell chmod 777 %REMOTE%/runtest.sh +hdc shell chmod a+x %REMOTE%/runtest.sh echo. echo ============================ echo ALL files send finished. @@ -71,6 +93,11 @@ set /a endM=%time:~3,2% set /a diffS_=%endS%-%startS% set /a diffM_=%endM%-%startM% echo All Done. Time cost:%diffM_%m%diffS_%s + +@REM 删除临时文件夹 +hdc shell rm /tmp -rf +hdc shell rm /dev/shm -rf + @REM 完成所用时间 echo. pause diff --git a/scripts/runtest.sh b/scripts/runtest.sh index 788d0c941c3307c1bde4269bbac1d46a27216c14..41e4de6329c8dbbf9e478ee0fd989b9aa5623505 100755 --- a/scripts/runtest.sh +++ b/scripts/runtest.sh @@ -6,8 +6,12 @@ do cd /data/tests/libc-test/src/$filelist for file in $(ls) do - /data/tests/libc-test/src/common/runtest -w '' $file >>../REPORT - echo $filelist/$file + if [ "$file" = "runtest" ] || [ "$file" = "libdlopen_dso.so" ] || [ "$file" = "libtls_get_new-dtv_dso.so" ] || [ "$file" = "src" ]; then + continue + else + /data/tests/libc-test/src/common/runtest -w '' $file >>../REPORT + echo $filelist/$file + fi done cd .. done