diff --git a/libs/fuzzlib/README_zh.md b/libs/fuzzlib/README_zh.md index 4f009aceb0492d33f5f93d48b901c8ef79897871..9d17005ebb08b0bcfdcfa86d37b5a8034c3ca138 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 e3af63148f34f81fa0306eae055f1171afb2824a..bcbeecde7cf4c6e36546ce98436d126516d08110 100644 --- a/src/core/command/gen.py +++ b/src/core/command/gen.py @@ -53,10 +53,9 @@ 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) - return + os.makedirs(fuzz_path) + LOG.info("make folder %s" % fuzz_path) - LOG.info("%s exist." % fuzz_path) command = [sys.executable, helper_path, 'generate', options.fuzzername, fuzz_path] LOG.info("command %s" % command)