CDash 自定义动态分析
我正在尝试将自定义动态分析工具集成到 CDash 中。例如 KWStyle、CppCheck 和 Visual Leak Detector。
我发现我需要生成一个 DynamicAnalysis.xml 文件并将其从 CTest 脚本提交到 CDash。
我想我知道如何将外部工具作为 ctest 脚本的一部分运行。
通过使用这些变量来更改 ctest_memcheck() 的工作方式
CTEST_MEMORYCHECK_COMMAND
CTEST_MEMORYCHECK_SUPPRESSIONS_FILE
CTEST_MEMORYCHECK_COMMAND_OPTIONS
或通过execute_process() 命令运行该工具。
但我有点不确定该使用哪一个。
我认为我遇到的主要问题是,如何从自定义工具的输出中提取错误并将该信息包含到 DynamicAnalysis.xml 中以提交?
我看到的极端解决方案是我需要制作一个生成有效 DynamicAnalysis.xml 文件的程序。
但问题是我不知道 XML 文件中 DefectList 元素的语法。我没有从 google 找到答案,甚至该文件的 XML 架构也没有帮助。
编辑:
看看这个:
http://www.cdash.org/CDash/viewDynamicAnalysis.php?buildid=987149
引起我注意的是标签,尤其是空的标签。我不明白这些是如何来自 DynamicAnalysis.xml 文件的。也许它会追踪曾经出现过的任何标签?我可以以某种方式创建自己的自定义标签吗?
CDash 是否根据工具类型自动创建标签?这会阻止自定义缺陷类型吗?
我只是在这里猜测,所以问题是;我可以通过生成 DynamicAnalysis.xml 文件来为自定义工具创建自定义标签吗?
我突然想到,与 valgrind 相比,CppCheck(静态代码分析)的不同错误数量是巨大的。我不确定是否应该使用动态分析。也许自定义构建类型(连续/实验/夜间)会更好。像这样:
http://www.cdash.org/CDash/buildSummary.php?buildid=930174
我不知道该怎么做,我想这需要干预 CDash 代码?
哪一个效果更好?
I'm trying to integrate custom dynamic analysis tools to CDash. Such as KWStyle, CppCheck and Visual Leak Detector.
I'v figured out that I need to generate a DynamicAnalysis.xml file and submit it to CDash, from CTest scripts.
I think I know how to run the external tool as a part of the ctest script.
Either by using these variables to change how ctest_memcheck() works
CTEST_MEMORYCHECK_COMMAND
CTEST_MEMORYCHECK_SUPPRESSIONS_FILE
CTEST_MEMORYCHECK_COMMAND_OPTIONS
or by running the tool from the execute_process() command.
But I'm a bit uncertain which one to use.
The main problem I think I have is, how can I extract errors from the output of the custom tool and include that information into the DynamicAnalysis.xml to submit?
The extreme solution i see is that i'd need to make a program that generates a valid DynamicAnalysis.xml file.
But the problem is that I don't know the syntax of the DefectList element in the XML file. I have found no answer from google and even the XML Schema for that file is unhelpful.
EDIT:
Looking at this:
http://www.cdash.org/CDash/viewDynamicAnalysis.php?buildid=987149
What draws my attention are the labels, especially the empty ones. I don't see how these would come from the DynamicAnalysis.xml file. Maybe it tracks any labels that have ever appearred? Can i create my own custom labels somehow?
Does CDash create the labels automatically, depending on the tool type? Does this block custom defect types?
I'm just guessing here, so the question is; can i create custom labels for my custom tool, just by generating a DynamicAnalysis.xml - file.
It occurred to me that the amount of different errors from CppCheck (static code analysis) is huge, compared to valgrind for instance. I'm not that certain that I should use the dynamic analysis. Maybe a custom build type (Continuous / Experimental / Nightly) thing would work better. Like this:
http://www.cdash.org/CDash/buildSummary.php?buildid=930174
I have no idea how to do this, i guess it requires meddling around with CDash code?
Which one would work better?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用 valgrind,您只需将 CTEST_MEMORYCHECK_COMMAND 设置为 valgrind 的完整路径,当您调用 ctest_memcheck 时,ctest 将从 valgrind 输出中为您生成 DynamicAnalysis.xml 文件。
了解 DynamicAnalysis.xml 文件中可能出现的值的最佳方法是分析 CTest 的源代码。
文件 CMake/Source/CTest/cmCTestMemCheckHandler.cxx 在名为“cmCTestMemCheckResultLongStrings”的变量中包含缺陷类型列表。搜索该文件以查找对该变量的引用,以查看可能的值是什么以及如何使用它们来生成“” XML 元素。
编辑(了解更多信息):
您还可以通过检查其源代码轻松查看 CDash 所期望的 XML 元素。具体来说,文件“CDash/xml_handlers/dynamic_analysis_handler.php”。
If you are using valgrind, you can simply set CTEST_MEMORYCHECK_COMMAND to the full path to valgrind, and ctest will generate the DynamicAnalysis.xml file for you from the valgrind output when you call ctest_memcheck.
The best way to understand the possible values that can appear in the DynamicAnalysis.xml file is to analyze the source code of CTest.
The file CMake/Source/CTest/cmCTestMemCheckHandler.cxx has the list of defect types in a variable named "cmCTestMemCheckResultLongStrings". Search through that file for references to that variable to see what the possible values are and how they are used to generate "<Defect/>" xml elements.
EDIT (for additional information):
You can also easily see what XML elements CDash is expecting by inspecting its source code. Specifically, the file "CDash/xml_handlers/dynamic_analysis_handler.php".
从我到目前为止所了解到的情况来看,对于在 cmake 脚本中进行的测试上运行的工具来说,动态分析就是关键。
对于在整个程序上运行的工具,您需要自定义 Build.xml。
我发现我可以使用 FILES 参数从 ctest_submit 命令提交这些文件。
我还发现您可以在 Continuous、Nightly 等方面添加自定义“构建名称”。
并且您可以将某些机器的构建设置为自动传输到这些机器下。
DynamicAnalysis 下的自定义标签确实来自 CDash 中的某个地方,我不记得在哪里了。
From what I'v learned so far, is that for a tool that runs on the tests made in the cmake script, the Dynamic Analysis is the thing.
For tools that run on the entire program, a custom Build.xml is the thing you need.
I found out that i can commit those files from the ctest_submit command by using the FILES parameter.
I also found out that you can add custom "build names" to the side of Continuous, Nightly, and others.
And that you can set the builds from certain machines to be automatically transferred under these.
The custom labels under DynamicAnalysis did come from somewhere in CDash, i can't remember where anymore.