mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-20 02:07:23 +01:00
refs #687 moved unit tests for compiler_lib to src/compiler_lib/unit_tests directory; compiling tests with gcov to get automated coverage estimates
This commit is contained in:
parent
628209f02f
commit
a8e42bf5cd
@ -69,8 +69,8 @@ unix {
|
||||
CONFIG += warn_on debug
|
||||
QMAKE_CFLAGS_DEBUG += -Wno-unused-parameter
|
||||
QMAKE_CFLAGS_RELEASE += -Wno-unused-parameter
|
||||
QMAKE_CXXFLAGS_DEBUG += -Wno-unused-parameter @CXXFLAGS@
|
||||
QMAKE_CXXFLAGS_RELEASE += -Wno-unused-parameter @CXXFLAGS@
|
||||
QMAKE_CXXFLAGS_DEBUG += -Wno-unused-parameter
|
||||
QMAKE_CXXFLAGS_RELEASE += -Wno-unused-parameter
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -394,13 +394,17 @@ bool interfaceProperties::isEligibleForCluster(Interface *intf)
|
||||
list<FWObject*> subinterfaces = intf->getByType(Interface::TYPENAME);
|
||||
string interface_type = intf->getOptionsObject()->getStr("type");
|
||||
|
||||
if (intf->isBridgePort()) return false;
|
||||
//if (intf->isLoopback()) return false;
|
||||
if (intf->isBridgePort())
|
||||
return false;
|
||||
|
||||
if (interface_type.empty()) interface_type = "ethernet";
|
||||
if (interface_type == "8021q") return true;
|
||||
if (interface_type == "bridge") return true;
|
||||
if (interface_type == "bonding") return true;
|
||||
if (interface_type.empty())
|
||||
interface_type = "ethernet";
|
||||
if (interface_type == "8021q")
|
||||
return true;
|
||||
if (interface_type == "bridge")
|
||||
return true;
|
||||
if (interface_type == "bonding")
|
||||
return true;
|
||||
|
||||
if (interface_type == "ethernet")
|
||||
{
|
||||
@ -417,7 +421,8 @@ bool interfaceProperties::isEligibleForCluster(Interface *intf)
|
||||
Interface *iface = Interface::cast(*i);
|
||||
assert(iface);
|
||||
Interface *parent_iface = Interface::cast(iface->getParent());
|
||||
if (parent_iface == NULL) continue;
|
||||
if (parent_iface == NULL)
|
||||
continue;
|
||||
if (parent_iface->getOptionsObject()->getStr("type") == "bonding" &&
|
||||
iface->getName() == intf->getName())
|
||||
{
|
||||
@ -427,7 +432,8 @@ bool interfaceProperties::isEligibleForCluster(Interface *intf)
|
||||
|
||||
}
|
||||
|
||||
if (subinterfaces.size() > 0) return false;
|
||||
if (subinterfaces.size() > 0)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -436,7 +442,8 @@ void interfaceProperties::guessSubInterfaceTypeAndAttributes(Interface *intf)
|
||||
{
|
||||
Interface *parent_intf = Interface::cast(intf->getParent());
|
||||
|
||||
if (parent_intf == NULL) return;
|
||||
if (parent_intf == NULL)
|
||||
return;
|
||||
|
||||
FWObject *f = intf->getParentHost();
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
Author: Roman Bovsunivkiy a2k0001@gmail.com
|
||||
|
||||
$Id$
|
||||
$Id: interfaceProperties.cpp 2043 2009-12-06 01:10:10Z a2k $
|
||||
|
||||
This program is free software which we release under the GNU General Public
|
||||
License. You may redistribute and/or modify this program under the terms
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
*/
|
||||
|
||||
#include "interfaceProperties.h"
|
||||
#include "interfacePropertiesTest.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
Author: Roman Bovsunivkiy a2k0001@gmail.com
|
||||
|
||||
$Id$
|
||||
$Id: interfaceProperties.h 2043 2009-12-06 01:10:10Z a2k $
|
||||
|
||||
This program is free software which we release under the GNU General Public
|
||||
License. You may redistribute and/or modify this program under the terms
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
Author: Roman Bovsunivkiy a2k0001@gmail.com
|
||||
|
||||
$Id$
|
||||
$Id: main.cpp 2039 2009-12-05 20:16:44Z a2k $
|
||||
|
||||
This program is free software which we release under the GNU General Public
|
||||
License. You may redistribute and/or modify this program under the terms
|
||||
@ -25,9 +25,12 @@
|
||||
|
||||
#include <cppunit/ui/text/TestRunner.h>
|
||||
#include <cppunit/CompilerOutputter.h>
|
||||
#include "interfaceProperties.h"
|
||||
#include "interfacePropertiesTest.h"
|
||||
#include <string>
|
||||
|
||||
int build_num = 0;
|
||||
std::string respath;
|
||||
|
||||
int main( int, char** )
|
||||
{
|
||||
CppUnit::TextUi::TestRunner runner;
|
||||
42
src/compiler_lib/unit_tests/tests_main.pro
Normal file
42
src/compiler_lib/unit_tests/tests_main.pro
Normal file
@ -0,0 +1,42 @@
|
||||
|
||||
include(../../../qmake.inc)
|
||||
|
||||
# exists(../../qmake.inc):include( ../../qmake.inc)
|
||||
|
||||
TEMPLATE = app
|
||||
TARGET =
|
||||
DEPENDPATH += .
|
||||
|
||||
SOURCES = ../CompilerDriver.cpp \
|
||||
../CompilerDriver_compile.cpp \
|
||||
../CompilerDriver_generators.cpp \
|
||||
../Configlet.cpp \
|
||||
../interfaceProperties.cpp \
|
||||
../linux24Interfaces.cpp \
|
||||
../bsdInterfaces.cpp \
|
||||
../iosInterfaces.cpp \
|
||||
../pixInterfaces.cpp \
|
||||
../interfacePropertiesObjectFactory.cpp
|
||||
|
||||
HEADERS = ../../../config.h \
|
||||
../CompilerDriver.h \
|
||||
../Configlet.h \
|
||||
../interfaceProperties.h \
|
||||
../linux24Interfaces.h \
|
||||
../bsdInterfaces.h \
|
||||
../iosInterfaces.h \
|
||||
../pixInterfaces.h \
|
||||
../interfacePropertiesObjectFactory.h
|
||||
|
||||
# Actual tests
|
||||
HEADERS += interfacePropertiesTest.h
|
||||
SOURCES += tests_main.cpp interfacePropertiesTest.cpp
|
||||
|
||||
CONFIG -= release
|
||||
CONFIG += debug
|
||||
OBJECTS_DIR = .
|
||||
QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage -O0
|
||||
QMAKE_CLEAN = *.gc??
|
||||
|
||||
LIBS += $$LIBS_FWCOMPILER $$LIBS_FWBUILDER
|
||||
LIBS += -lgcov -lcppunit
|
||||
@ -1,40 +0,0 @@
|
||||
# #####################################################################
|
||||
# Automatically generated by qmake (2.01a) Sat Dec 5 20:04:56 2009
|
||||
# #####################################################################
|
||||
include(../../../../qmake.inc)
|
||||
|
||||
# exists(../../qmake.inc):include( ../../qmake.inc)
|
||||
TEMPLATE = app
|
||||
TARGET =
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += ../../../iptlib \
|
||||
../../../pflib \
|
||||
../../../cisco_lib/ \
|
||||
../../../compiler_lib/
|
||||
DEPENDPATH = ../../../iptlib \
|
||||
../../../pflib \
|
||||
../../../cisco_lib/ \
|
||||
../../../compiler_lib
|
||||
win32:LIBS += ../../../iptlib/release/iptlib.lib \
|
||||
../../../pflib/release/fwbpf.lib \
|
||||
../../../cisco_lib/release/fwbcisco.lib \
|
||||
../../../compiler_lib/release/compilerdriver.lib
|
||||
!win32:LIBS += ../../../iptlib/libiptlib.a \
|
||||
../../../pflib/libfwbpf.a \
|
||||
../../../cisco_lib/libfwbcisco.a \
|
||||
../../../compiler_lib/libcompilerdriver.a
|
||||
win32:PRE_TARGETDEPS = ../../../iptlib/release/iptlib.lib \
|
||||
../../../pflib/release/fwbpf.lib \
|
||||
../../../cisco_lib/release/fwbcisco.lib \
|
||||
../../../compiler_lib/release/compilerdriver.lib
|
||||
!win32:PRE_TARGETDEPS = ../../../iptlib/libiptlib.a \
|
||||
../../../pflib/libfwbpf.a \
|
||||
../../../cisco_lib/libfwbcisco.a \
|
||||
../../../compiler_lib/libcompilerdriver.a
|
||||
QMAKE_LFLAGS += -lcppunit \
|
||||
-lfwbuilder
|
||||
|
||||
# Input
|
||||
HEADERS += interfaceProperties.h
|
||||
SOURCES += main.cpp \
|
||||
interfaceProperties.cpp
|
||||
Loading…
x
Reference in New Issue
Block a user