当我尝试运行编译文件

时间:2017-09-22 18:06:25

标签: c++ unit-testing cxxtest

我开始在C ++上编写一个小项目。我只是想用TDD开发,因为在Java中我总是这样做。我遇到了一个问题,在Java IDE和工具(如maven等)中使用任何库等等都要容易一些。但这并不是我所说的话题。

我找到了cxxtest框架并决定在我的项目中添加一个。 我在项目的测试包中添加了最新版本的源代码,然后编写了简单的测试,然后运行了预处理器(使用python)“python cxxtestgen --error-printer -o ../runner.cpp ../ ../testSample.h“来自cxxtest-4.4 / bin文件夹。

之后我将runner.cpp文件放入cxxtest-4.4文件夹。我试图在适当的地方使用命令“g ++ -o runner runner.cpp”运行它...并得到以下消息:

bash-3.2$ g++ -o runner runner.cpp
runner.cpp:8:10: error: 'cxxtest/TestListener.h' file not found with <angled> include; use "quotes" instead
#include <cxxtest/TestListener.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~
         "cxxtest/TestListener.h"
In file included from runner.cpp:8:
./cxxtest/TestListener.h:24:10: fatal error: 'cxxtest/Descriptions.h' file not found
#include <cxxtest/Descriptions.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~

这里我放了我的项目结构: The project structure

这看起来很奇怪,因为我以前从未见过同样的烦恼。并且它无法找到相同的问题。

所以,如果有人告诉我解决这个问题的正确方向,那会很棒。让我知道如果您需要其他东西来更清楚地理解这个问题(代码,任何技术信息等)

一些信息:我在macOS上使用CLion,这意味着我有CMake(至少版本3.6),我的mac上有perl和python。使用C ++ 14语言版本的项目。

0 个答案:

没有答案
相关问题