From 05e28fe53d1c9839979e8d0a54dd7095af9902a9 Mon Sep 17 00:00:00 2001 From: renxiang Date: Fri, 6 Aug 2021 10:46:47 +0800 Subject: [PATCH 1/2] fuzz generate commond auto create directory Signed-off-by: renxiang --- libs/fuzzlib/README_zh.md | 10 +++++----- src/core/command/gen.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/fuzzlib/README_zh.md b/libs/fuzzlib/README_zh.md index 4f009ac..9d17005 100644 --- a/libs/fuzzlib/README_zh.md +++ b/libs/fuzzlib/README_zh.md @@ -77,11 +77,11 @@ gen -t TESTTYPE -fn FUZZERNAME -dp DIRECTORYPATH ``` - | 参数 | 说明 | 备注 | - | ---- | -------------- | -------------------------------------------------------- | - | -t | 测试类型 | 目前仅支持"FUZZ" | - | -fn | DTFuzz名称 | 为显式区分DTFuzz,名称必须以"fuzzer"结尾 | - | -dp | DTFuzz生成路径 | 执行命令前需要手动创建fuzztest目录和对应形态目录如common | + | 参数 | 说明 | 备注 | + | ---- | -------------- | ---------------------------------------- | + | -t | 测试类型 | 目前仅支持"FUZZ" | + | -fn | DTFuzz名称 | 为显式区分DTFuzz,名称必须以"fuzzer"结尾 | + | -dp | DTFuzz生成路径 | 路径不存在则自动创建目录 | 3. gen命令示例,-t、-fn和-dp均为必选项 diff --git a/src/core/command/gen.py b/src/core/command/gen.py index e3af631..992d06d 100644 --- a/src/core/command/gen.py +++ b/src/core/command/gen.py @@ -53,10 +53,10 @@ class Gen(object): fuzz_path = os.path.join(sys.source_code_root_path, options.dirpath) LOG.info("fuzz_path = %s" % fuzz_path) if not os.path.exists(fuzz_path): - LOG.error("%s is not exist." % fuzz_path) + os.makedirs(fuzz_path) + LOG.info("make folder %s" % fuzz_path) return - LOG.info("%s exist." % fuzz_path) command = [sys.executable, helper_path, 'generate', options.fuzzername, fuzz_path] LOG.info("command %s" % command) -- Gitee From 31e2ee1a5f5cbfe8c98d6fdc870de5a0ad8eebdd Mon Sep 17 00:00:00 2001 From: NicoYam Date: Fri, 6 Aug 2021 02:54:31 +0000 Subject: [PATCH 2/2] fuzz generate commond auto create directory --- src/core/command/gen.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/command/gen.py b/src/core/command/gen.py index 992d06d..bcbeecd 100644 --- a/src/core/command/gen.py +++ b/src/core/command/gen.py @@ -55,7 +55,6 @@ class Gen(object): if not os.path.exists(fuzz_path): os.makedirs(fuzz_path) LOG.info("make folder %s" % fuzz_path) - return command = [sys.executable, helper_path, 'generate', options.fuzzername, fuzz_path] -- Gitee