提交 15e0464c 编写于 作者: F FondMemoryVVV

Modify the format

Signed-off-by: NFondMemoryVVV <mashuai53@huawei.com>
上级 9b4503c4
......@@ -15,11 +15,9 @@ import("//test/xts/tools/build/suite.gni")
group("toolchain") {
testonly = true
deps = [
"//third_party/musl:libctest",
]
deps = [ "//third_party/musl:libctest" ]
if (is_standard_system) {
deps = [
deps += [
#":tar_testcases",
":tar_dllib",
]
......
......@@ -22,8 +22,8 @@
#include "runtest.h"
using namespace std;
vector<string> filenames;
vector<string> filenames;
vector<std::string> GetFileNames(std::string path)
{
vector<string> tempName;
......
......@@ -20,8 +20,7 @@
#include "runtest.h"
void GetTestNames(std::string path, std::vector<std::string>& tempName)
static void GetTestNames(std::string path, std::vector<std::string>& tempName)
{
DIR *pDir;
struct dirent* ptr;
......@@ -42,10 +41,4 @@ void GetTestNames(std::string path, std::vector<std::string>& tempName)
}
}
closedir(pDir);
}
}
\ No newline at end of file
......@@ -40,5 +40,4 @@ int t_setrlim(int r, long lim)
return -1;
}
return 0;
}
}
\ No newline at end of file
......@@ -27,12 +27,15 @@
#include <sys/time.h>
#include <sys/resource.h>
#include "gtest/gtest.h"
#include "runtest.h"
#include "gtest/gtest.h"
using namespace std;
using namespace testing::ext;
class ToolChainTest : public ::testing::TestWithParam<string> {};
using namespace testing;
class toolchaintest : public ::testing::TestWithParam<string> {};
static string filepath = "/data/local/tmp/libc-test/src";
static vector<std::string> temp = GetFileNames(filepath);
......@@ -68,7 +71,7 @@ static int runTests(const char *argvs)
sigaddset(&set, SIGCHLD);
sigprocmask(SIG_BLOCK, &set, nullptr);
retfunc = signal(SIGCHLD, handler);
if (retfunc == int(SIG_ERR)) {
if (retfunc == SIG_ERR) {
printf("signal triggering failed:%s\n", strerror(errno));
}
pid = start(wrap, argvs);
......@@ -111,11 +114,11 @@ static int runTests(const char *argvs)
}
/**
* @tc.name : ToolChainTest.LibcTest
* @tc.name : toolchaintest.LibcTest
* @tc.desc : start test
* @tc.level : Level 2
*/
static HWTEST_F(ToolChainTest, LibcTest, Function | MediumTest | Level3)
HWTEST_P(toolchaintest, LibcTest, Function | MediumTest | Level3)
{
int ret;
string testName = GetParam();
......@@ -127,4 +130,4 @@ static HWTEST_F(ToolChainTest, LibcTest, Function | MediumTest | Level3)
EXPECT_EQ(-1, ret) << "test " << testName << " failed" << endl;
}
}
INSTANTIATE_TEST_CASE_P(libcTest, ToolChainTest, testing:: ValuesIn(temp.begin(), temp.end()));
INSTANTIATE_TEST_CASE_P(libcTest, toolchaintest, testing::ValuesIn(temp.begin(), temp.end()));
\ No newline at end of file
......@@ -24,17 +24,19 @@ import shutil
copyFileCounts = 0
def copy_files(source_d, target_d):
for f in os.listdir(source_d):
source_files = os.path.join(source_d, f)
target_files = os.path.join(target_d, f)
if os.path.isfile(source_files):
if not os.path.exists(target_d):
os.makedirs(target_d)
def copyFiles(sourceDir, targetDir):
global copyFileCounts
for f in os.listdir(sourceDir):
sourceF = os.path.join(sourceDir, f)
targetF = os.path.join(targetDir, f)
if os.path.isfile(sourceF):
if not os.path.exists(targetDir):
os.makedirs(targetDir)
copyFileCounts += 1
open(target_files, "wb").write(open(source_files, "rb").read())
if os.path.isdir(source_files):
copy_files(source_files, target_files)
if not os.path.exists(targetF) or (os.path.exists(targetF) and (os.path.getsize(targetF) != os.path.getsize(sourceF))):
open(targetF, "wb").write(open(sourceF, "rb").read())
if os.path.isdir(sourceF):
copyFiles(sourceF, targetF)
def make_targz_one_by_one(output_filename, source_dir):
tar = tarfile.open(output_filename,"w")
......@@ -57,4 +59,4 @@ if __name__ == "__main__":
copyFiles(args.input_path, args.temp_path)
make_targz_one_by_one(args.output_path, args.temp_path)
shutil.rmtree(args.temp_path) #delete middle files
shutil.rmtree(args.temp_path) #delete middle files
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册