xref: /ide/tools/previewer/test/fuzztest/main.cpp (revision 7c804472)
1/*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#include <gtest/gtest.h>
17#include "secodeFuzz.h"
18#include <iostream>
19#include <common.h>
20
21const char* __asan_default_options()
22{
23    return "halt_on_error=0:log_path=./";
24}
25
26int main(int argc, char **argv)
27{
28    testing::InitGoogleTest(&argc, argv);
29
30    // 设置报告路径
31    DT_Set_Report_Path(const_cast<char*>("./"));
32    // 设置是否输出覆盖率sancov文件
33    DT_Set_Is_Dump_Coverage(1);
34    //设置用例单次执行多久超时,4.9版本后已经默认开启,默认600s
35    DT_Set_TimeOut_Second(600);
36    // 设置单个测试例运行时间,如果设置的运行次数没到而运行时间到了,提前结束
37    DT_Set_Running_Time_Second(TIMEOUT_SECOND);
38    // //关闭内存泄露检测
39    DT_Enable_Leak_Check(0, 0);
40    std::cout << DT_Get_Version() << std::endl;
41    return RUN_ALL_TESTS();
42}