From 922c8bae7cdac5d4a5fc5806852ebd349116749b Mon Sep 17 00:00:00 2001 From: Roman Bovsunivskiy Date: Sat, 19 Dec 2009 17:19:38 +0000 Subject: [PATCH] Fixed #931 again. Some work on make tests target --- fwbuilder3.pro | 4 ++ src/gui/ObjectManipulator.cpp | 4 +- src/gui/unit_tests/ImporterTest/main.cpp | 4 +- src/gui/unit_tests/unit_tests.pro | 56 +++--------------------- 4 files changed, 14 insertions(+), 54 deletions(-) diff --git a/fwbuilder3.pro b/fwbuilder3.pro index 7c617b100..130acb5e8 100644 --- a/fwbuilder3.pro +++ b/fwbuilder3.pro @@ -5,3 +5,7 @@ TEMPLATE = subdirs SUBDIRS = src doc +tests.commands = cd src && cd compiler_lib && cd unit_tests && qmake && make run; \ + cd .. && cd .. && cd gui && unit_tests && qmake && make run + +QMAKE_EXTRA_TARGETS += tests diff --git a/src/gui/ObjectManipulator.cpp b/src/gui/ObjectManipulator.cpp index b7c5e6994..0e949bdbf 100644 --- a/src/gui/ObjectManipulator.cpp +++ b/src/gui/ObjectManipulator.cpp @@ -709,8 +709,8 @@ void ObjectManipulator::contextMenuRequested(const QPoint &pos) } } } else canCreateCluster = false; - if (canCreateCluster) - popup_menu->addAction( tr("New cluster from selected firewalls"), this, SLOT( newClusterFromSelected() ) ); + //if (canCreateCluster) + popup_menu->addAction( tr("New cluster from selected firewalls"), this, SLOT( newClusterFromSelected() ) )->setEnabled(canCreateCluster); popup_menu->addSeparator(); popup_menu->addAction( tr("Compile"), this, SLOT( compile())); popup_menu->addAction( tr("Install"), this, SLOT( install())); diff --git a/src/gui/unit_tests/ImporterTest/main.cpp b/src/gui/unit_tests/ImporterTest/main.cpp index 9a0bc7c52..de4f0e5d3 100644 --- a/src/gui/unit_tests/ImporterTest/main.cpp +++ b/src/gui/unit_tests/ImporterTest/main.cpp @@ -34,9 +34,9 @@ int fwbdebug = 0; //QString user_name; -int main( int, char** ) +int main( int, char** args) { - init(); + init(args); CppUnit::TextUi::TestRunner runner; runner.addTest( ImporterTest::suite() ); runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(), diff --git a/src/gui/unit_tests/unit_tests.pro b/src/gui/unit_tests/unit_tests.pro index 0834541a8..8e6a8092b 100644 --- a/src/gui/unit_tests/unit_tests.pro +++ b/src/gui/unit_tests/unit_tests.pro @@ -1,51 +1,7 @@ -TEMPLATE = app -LANGUAGE = C++ - -QMAKE_CXX = g++ - -HEADERS += ../../../config.h \ - ../RCS.h \ - #../utils.h \ - ../global.h - -SOURCES += unit_tests.cpp \ - #../utils.cpp \ - ../RCS.cpp - - -# -include(../../../qmake.inc) -# -exists(../qmake.inc) { - include( ../qmake.inc) -} - - -INCLUDEPATH += .. -INCLUDEPATH += ../../../ - -# -# -# -# -TARGET = unit_tests -# - -#unix { -# !macx { -# # } -#} - -CONFIG -= release -CONFIG += debug -OBJECTS_DIR = . -QMAKE_CXXFLAGS += -g -fprofile-arcs -ftest-coverage -O0 $$CPPUNIT_CFLAGS -QMAKE_CLEAN = *.gc?? - -QMAKE_COPY = ../../install.sh -m 0755 -s - -run.commands = echo "Running tests..." && ${TARGET} && \ - echo "Running gcov..." && gcov ${SOURCES} >/dev/null 2>/dev/null && echo "OK" || echo "FAILED" -run.depends = all - +run.commands = echo "Running tests..." && \ + cd FWBTree && qmake && make run; cd ..; \ + cd ImporterTest && qmake && make run; cd ..; \ + cd RCS && qmake && make run; cd ..; \ + cd UsageResolverTest && qmake && make run; cd ..; + QMAKE_EXTRA_TARGETS += run