Building and running C++ unit tests in Visual Studio (TDD)

I have a large project for which I am attempting to use TDD. I am using Tut as my test framework, which has its flaws but is sufficient for what I need. I need to exploit link time test seams, each test must be in its own executable . The project for this executable then launches itself as a post build step. Unfortunately, this means that my Visual Studio Sln is filling up with tests, which

在Visual Studio(TDD)中构建和运行C ++单元测试

我有一个大型项目,我试图使用TDD。 我使用Tut作为我的测试框架,它有缺陷但足以满足我的需要。 我需要利用链接时间测试接缝, 每个测试必须在它自己的可执行文件中 。 这个可执行文件的项目然后作为后期构建步骤启动。 不幸的是,这意味着我的Visual Studio Sln正在填充测试,这是不可扩展的,并且隐藏了实际的重要项目。 有谁知道运行这些测试的更好方法吗? 是否有可能从构建中隐藏项目并仍然构建它们? “是否可以

Is such difference between mingw and msvc normal

Today we found a bug at work, which can be simplified to this: std::map<int, Obj*> workMap; for(auto a : workMap) { workMap.erase(a.first); } Actually, we invoked function, that invoked function that did erase, but it is not the point. The point is, that on my computer with visual studio compiler I've got list iterator is not incrementable error , while my colleague with mingw

mingw和msvc之间的这种区别是正常的

今天我们发现了一个工作中的错误,可以简化为: std::map<int, Obj*> workMap; for(auto a : workMap) { workMap.erase(a.first); } 实际上,我们调用了函数,它调用了擦除的函数,但它不是重点。 关键是,在我的电脑上使用Visual Studio编译器时,我得到了列表迭代器不是可增加的错误 ,而我的同事与mingw一起没有任何错误! 我明白,我们有不同的编译器和不同的STL实现(可能)。 这是正常的,他们可以有不

Create a Mingw DLL to be used with a VB exe

I cannot find any solution in the web that works for my case. I read in Microsoft Developer Network, problems from here and several wikis, but nothing, but after reading so many info and some of the in contradiction to others ... I have a mess! My history: 1- I have to change a software already created in Visual C++ (a DLL) and I do not know which Visual Studio was used to compile it, this D

创建一个用于VB exe的Mingw DLL

我找不到适用于我的案例的任何解决方案。 我在微软开发者网络上读到过这里和几个维基的问题,但是没有任何结果,但是在阅读了很多信息和一些与其他人相矛盾的信息之后......我有一团糟! 我的历史: 1-我必须更改已经在Visual C ++(一个DLL)中创建的软件,并且我不知道使用哪个Visual Studio编译它,此DLL使用Visual Basic程序。 2 - 我成功地改变了程序使用另一种通信协议(这是变化...容易),我已经使用Visual Stud

Linking to MSVC DLL from MinGW

I'm trying to link the LizardTech GeoExpress DSDK into my own application. I use gcc so that we can compile on for platforms. On Linux and Mac this works easily: they provide a static library ( libltidsdk.a ) and headers and all that we have to do is use them. Compiling for windows isn't so easy. They've built the library using Microsoft Visual Studio, and we use MinGW. I've

链接到MinGW的MSVC DLL

我试图将LizardTech GeoExpress DSDK链接到我自己的应用程序中。 我使用gcc,以便我们可以在平台上进行编译。 在Linux和Mac上,这很容易实现:它们提供一个静态库( libltidsdk.a )和头文件,我们所要做的就是使用它们。 编译Windows并不容易。 他们使用Microsoft Visual Studio构建了这个库,我们使用MinGW。 我已阅读MinGW常见问题解答,并且遇到以下问题。 库是所有C ++,所以我的第一个问题:这甚至可能吗? 只要

Flex and Bison tools

I want know which is best whether compiler design using either tools like Flex & Bison or C/C++. Because I've heard that developing with tools is not worthy at all. I'm a beginner to compiler design so I need clarification about this. And other thing that I want to ask you is which of those two ways as I said above expected by a company in compiler design. Please help me!!! This

Flex和Bison工具

我想知道使用Flex和Bison或C / C ++之类的工具进行编译器设计是最好的。 因为我听说用工具开发并不值得。 我是编译器设计的初学者,所以我需要澄清这一点。 还有一件事我想问你,就是我在编译器设计公司所期望的那两种方式中的哪一种。 请帮帮我!!! 这取决于你想要解析的语法的复杂性。 手工实现简单的语法并不难,但没有经验对于复杂的语法很难。 如果您对词法分析器和解析器没有任何经验,最好从不使用LR(LALR)

Flex/Bison not evaluating properly

For some reason or another, bison doesn't want to do any evaluation. Compilation of all files goes smoothly and the program runs. When I enter the expression 4+5 and press return, it creates tokens for 4 + 5 respectively. I can even put in some printf into the places where bison recognizes the attributes of each token including the plus (43). However the program never evaluates this prod

Flex / Bison没有正确评估

由于某种原因,野牛不想做任何评估。 所有文件的编译顺利进行,程序运行。 当我输入表达式4+5并按回车时,它会分别为4 + 5创建令牌。 我甚至可以把一些printf放到野牛认识每个令牌属性的地方,包括加号(43)。 然而,程序从不评估这个生产expr '+' term { $$ = $1 + $3; } expr '+' term { $$ = $1 + $3; } 。 至少根据我的知识,这绝不会被调用,即使是这样的制作也会assign 'n' { printf(&quo

numbers flex & bison

I'm writing my first flex and bison program which is a simple calculator, and I'd like the calculator to support complex number operations. But, I cannot manage to insert or even handle any complex numbers in it, since I need the flex to somehow handle both real value and image value of the complex number in the same time and pass it to the bison, and also I dont know how the bison coul

数字灵活和野牛

我正在编写我的第一个flex和bison程序,它是一个简单的计算器,我希望计算器支持复杂的数字操作。 但是,我无法插入甚至处理任何复杂的数字,因为我需要flex以某种方式处理复数的实际值和图像值,并将其传递给野牛,并且我也不知道野牛如何处理2个参数。 这是我的flex文件: 正如你所看到的,我尝试了一些东西,但是这甚至不能编译(使用所有复杂的数字过程)。 而为了记录,一个复杂的数字看起来像1.000 + 2.111i,3i等

Advantages of Antlr (versus say, lex/yacc/bison)

I've used lex and yacc (more usually bison) in the past for various projects, usually translators (such as a subset of EDIF streamed into an EDA app). Additionally, I've had to support code based on lex/yacc grammars dating back decades. So I know my way around the tools, though I'm no expert. I've seen positive comments about Antlr in various fora in the past, and I'm cur

Antlr的优势(比如说,lex / yacc / bison)

过去,我曾在各种项目中使用lex和yacc(通常是野牛),通常是翻译人员(例如EDIF的子集流入EDA应用程序)。 另外,我必须支持基于lex / yacc语法的代码,这些代码可以追溯到几十年前。 所以我知道我的工具,虽然我不是专家。 我在过去的各种论坛上看到过关于Antlr的积极评论,我很好奇我可能会错过什么。 所以,如果你已经使用了两者,请告诉我Antlr更好或更先进。 我目前的限制是我在C ++商店工作,我们发布的任何产品都

Const correctness in struct initialization

I'm playing with C++ and const-correctness right now. Assume you have the following structure template <typename T> struct important_structure { public: T* data; int a; important_structure(const T& el, int a); void change(); }; template <typename T> void important_structure<T>::change() { //alter data field in some way } template <typename

在结构初始化中保持正确性

我现在在玩C ++和const-correctness。 假设你有以下结构 template <typename T> struct important_structure { public: T* data; int a; important_structure(const T& el, int a); void change(); }; template <typename T> void important_structure<T>::change() { //alter data field in some way } template <typename T> important_structure <T>::importan

Qt Window incorrect size until user event

I'm creating a screen where users can add certain tiles to use in an editor, but when adding a tile the window does not correctly resize to fit the content. Except that when I drag the window or resize it even just a little then it snaps to the correct size immediately. And when just dragging the window it snaps to the correct size. I tried using resize(sizeHint()); which gave me an inc

直到用户事件,Qt窗口大小不正确

我正在创建一个屏幕,用户可以在编辑器中添加某些图块,但添加图块时,该窗口无法正确调整大小以适应内容。 除了当我拖动窗口或调整它的大小时,它会立即捕捉到正确的大小。 当只是拖动窗口时,它会捕捉到正确的大小。 我尝试使用resize(sizeHint()); 这给了我一个不正确的大小和以下错误,但在调整大小/拖动时仍然会发生对正确大小的捕捉。 QWindowsWindow::setGeometry: Unable to set geometry 299x329+991+536 on