mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-10 23:22:33 +02: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:
+2
-2
@@ -69,8 +69,8 @@ unix {
|
|||||||
CONFIG += warn_on debug
|
CONFIG += warn_on debug
|
||||||
QMAKE_CFLAGS_DEBUG += -Wno-unused-parameter
|
QMAKE_CFLAGS_DEBUG += -Wno-unused-parameter
|
||||||
QMAKE_CFLAGS_RELEASE += -Wno-unused-parameter
|
QMAKE_CFLAGS_RELEASE += -Wno-unused-parameter
|
||||||
QMAKE_CXXFLAGS_DEBUG += -Wno-unused-parameter @CXXFLAGS@
|
QMAKE_CXXFLAGS_DEBUG += -Wno-unused-parameter
|
||||||
QMAKE_CXXFLAGS_RELEASE += -Wno-unused-parameter @CXXFLAGS@
|
QMAKE_CXXFLAGS_RELEASE += -Wno-unused-parameter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -394,13 +394,17 @@ bool interfaceProperties::isEligibleForCluster(Interface *intf)
|
|||||||
list<FWObject*> subinterfaces = intf->getByType(Interface::TYPENAME);
|
list<FWObject*> subinterfaces = intf->getByType(Interface::TYPENAME);
|
||||||
string interface_type = intf->getOptionsObject()->getStr("type");
|
string interface_type = intf->getOptionsObject()->getStr("type");
|
||||||
|
|
||||||
if (intf->isBridgePort()) return false;
|
if (intf->isBridgePort())
|
||||||
//if (intf->isLoopback()) return false;
|
return false;
|
||||||
|
|
||||||
if (interface_type.empty()) interface_type = "ethernet";
|
if (interface_type.empty())
|
||||||
if (interface_type == "8021q") return true;
|
interface_type = "ethernet";
|
||||||
if (interface_type == "bridge") return true;
|
if (interface_type == "8021q")
|
||||||
if (interface_type == "bonding") return true;
|
return true;
|
||||||
|
if (interface_type == "bridge")
|
||||||
|
return true;
|
||||||
|
if (interface_type == "bonding")
|
||||||
|
return true;
|
||||||
|
|
||||||
if (interface_type == "ethernet")
|
if (interface_type == "ethernet")
|
||||||
{
|
{
|
||||||
@@ -417,7 +421,8 @@ bool interfaceProperties::isEligibleForCluster(Interface *intf)
|
|||||||
Interface *iface = Interface::cast(*i);
|
Interface *iface = Interface::cast(*i);
|
||||||
assert(iface);
|
assert(iface);
|
||||||
Interface *parent_iface = Interface::cast(iface->getParent());
|
Interface *parent_iface = Interface::cast(iface->getParent());
|
||||||
if (parent_iface == NULL) continue;
|
if (parent_iface == NULL)
|
||||||
|
continue;
|
||||||
if (parent_iface->getOptionsObject()->getStr("type") == "bonding" &&
|
if (parent_iface->getOptionsObject()->getStr("type") == "bonding" &&
|
||||||
iface->getName() == intf->getName())
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -436,7 +442,8 @@ void interfaceProperties::guessSubInterfaceTypeAndAttributes(Interface *intf)
|
|||||||
{
|
{
|
||||||
Interface *parent_intf = Interface::cast(intf->getParent());
|
Interface *parent_intf = Interface::cast(intf->getParent());
|
||||||
|
|
||||||
if (parent_intf == NULL) return;
|
if (parent_intf == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
FWObject *f = intf->getParentHost();
|
FWObject *f = intf->getParentHost();
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
Author: Roman Bovsunivkiy a2k0001@gmail.com
|
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
|
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
|
License. You may redistribute and/or modify this program under the terms
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "interfaceProperties.h"
|
#include "interfacePropertiesTest.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
Author: Roman Bovsunivkiy a2k0001@gmail.com
|
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
|
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
|
License. You may redistribute and/or modify this program under the terms
|
||||||
+5
-2
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
Author: Roman Bovsunivkiy a2k0001@gmail.com
|
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
|
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
|
License. You may redistribute and/or modify this program under the terms
|
||||||
@@ -25,9 +25,12 @@
|
|||||||
|
|
||||||
#include <cppunit/ui/text/TestRunner.h>
|
#include <cppunit/ui/text/TestRunner.h>
|
||||||
#include <cppunit/CompilerOutputter.h>
|
#include <cppunit/CompilerOutputter.h>
|
||||||
#include "interfaceProperties.h"
|
#include "interfacePropertiesTest.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
int build_num = 0;
|
||||||
|
std::string respath;
|
||||||
|
|
||||||
int main( int, char** )
|
int main( int, char** )
|
||||||
{
|
{
|
||||||
CppUnit::TextUi::TestRunner runner;
|
CppUnit::TextUi::TestRunner runner;
|
||||||
@@ -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
|
|
||||||
Reference in New Issue
Block a user