Fixes #1535
This commit is contained in:
+1
-1
@@ -1500,5 +1500,5 @@ gtest_main.a : gtest-all.o gtest_main.o
|
||||
GTEST_TESTS_SRCS = $(shell find tests/ -type f -name '*.cpp')
|
||||
|
||||
gtests: $(BOARDSRC) $(CPPSRC) $(GTEST_TESTS_SRCS) targets/simu/simpgmspace.cpp *.h gtest_main.a
|
||||
g++ -std=gnu++0x $(CPPFLAGS) $(BOARDSRC) $(CPPSRC) $(GTEST_TESTS_SRCS) targets/simu/simpgmspace.cpp -I$(GTEST_DIR) ${INCFLAGS} -I$(GTEST_DIR)/include -o gtests -lpthread -MD -DSIMU -lQtCore -lQtGui gtest_main.a
|
||||
g++ -std=gnu++0x $(CPPFLAGS) $(BOARDSRC) $(CPPSRC) $(LUASRC) $(GTEST_TESTS_SRCS) targets/simu/simpgmspace.cpp -I$(GTEST_DIR) ${INCFLAGS} -I$(GTEST_DIR)/include -o gtests -lpthread -MD -DSIMU -lQtCore -lQtGui gtest_main.a -fexceptions
|
||||
|
||||
|
||||
@@ -34,10 +34,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtCore/QString>
|
||||
#include <math.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -34,11 +34,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QPainter>
|
||||
#include <math.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#define SWAP_DEFINED
|
||||
@@ -177,6 +173,7 @@ int main(int argc, char **argv)
|
||||
StartEepromThread(NULL);
|
||||
g_menuStackPtr = 0;
|
||||
g_menuStack[0] = menuMainView;
|
||||
LUA_RESET();
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
|
||||
Executable
+63
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Andre Bernet <bernet.andre@gmail.com>
|
||||
* - Andreas Weitl
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
|
||||
* - Cameron Weeks <th9xer@gmail.com>
|
||||
* - Erez Raviv
|
||||
* - Gabriel Birkus
|
||||
* - Jean-Pierre Parisy
|
||||
* - Karl Szmutny
|
||||
* - Michael Blandford
|
||||
* - Michal Hlavinka
|
||||
* - Pat Mackenzie
|
||||
* - Philip Moss
|
||||
* - Rob Thomson
|
||||
* - Romolo Manfredini <romolo.manfredini@gmail.com>
|
||||
* - Thomas Husterer
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#if defined(LUA)
|
||||
|
||||
#define SWAP_DEFINED
|
||||
#include "opentx.h"
|
||||
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
#include <lualib.h>
|
||||
|
||||
void luaExecStr(const char * str)
|
||||
{
|
||||
extern lua_State * L;
|
||||
luaL_dostring(L, str);
|
||||
}
|
||||
|
||||
TEST(Lua, testSetModelId)
|
||||
{
|
||||
luaExecStr("info = model.getInfo()");
|
||||
luaExecStr("info.id = 2");
|
||||
luaExecStr("model.setInfo(info)");
|
||||
EXPECT_EQ(g_model.header.modelId, 2);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -34,10 +34,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QPainter>
|
||||
#include <math.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -34,10 +34,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QPainter>
|
||||
#include <math.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user