Refactoring: moved unit tests to libraries for some libs (ut modularization)

This commit is contained in:
Matthias Koefferlein 2017-08-26 22:44:31 +02:00
parent be1b007f2f
commit 000917d2c9
547 changed files with 1013 additions and 712 deletions

View File

@ -1,42 +1,6 @@
DESTDIR = $$OUT_PWD/..
TARGET = klayout_ant
TEMPLATE = subdirs
SUBDIRS = ant unit_tests
include($$PWD/../klayout.pri)
include($$PWD/../lib.pri)
DEFINES += MAKE_ANT_LIBRARY
HEADERS = \
antConfig.h \
antConfigPage.h \
antObject.h \
antPlugin.h \
antPropertiesPage.h \
antService.h \
antTemplate.h \
antForceLink.h \
antCommon.h
FORMS = \
RulerConfigPage.ui \
RulerConfigPage2.ui \
RulerConfigPage3.ui \
RulerConfigPage4.ui \
RulerPropertiesPage.ui \
SOURCES = \
antConfig.cc \
antConfigPage.cc \
antObject.cc \
antPlugin.cc \
antPropertiesPage.cc \
antService.cc \
antTemplate.cc \
gsiDeclAnt.cc \
antForceLink.cc
INCLUDEPATH += ../tl ../gsi ../laybasic ../db
DEPENDPATH += ../tl ../gsi ../laybasic ../db
LIBS += -L$$DESTDIR -lklayout_tl -lklayout_gsi -lklayout_laybasic -lklayout_db
unit_tests.depends += ant

41
src/ant/ant/ant.pro Normal file
View File

@ -0,0 +1,41 @@
DESTDIR = $$OUT_PWD/../..
TARGET = klayout_ant
include($$PWD/../../lib.pri)
DEFINES += MAKE_ANT_LIBRARY
HEADERS = \
antConfig.h \
antConfigPage.h \
antObject.h \
antPlugin.h \
antPropertiesPage.h \
antService.h \
antTemplate.h \
antForceLink.h \
antCommon.h
FORMS = \
RulerConfigPage.ui \
RulerConfigPage2.ui \
RulerConfigPage3.ui \
RulerConfigPage4.ui \
RulerPropertiesPage.ui \
SOURCES = \
antConfig.cc \
antConfigPage.cc \
antObject.cc \
antPlugin.cc \
antPropertiesPage.cc \
antService.cc \
antTemplate.cc \
gsiDeclAnt.cc \
antForceLink.cc
INCLUDEPATH += $$TL_INC $$GSI_INC $$LAYBASIC_INC $$DB_INC
DEPENDPATH += $$TL_INC $$GSI_INC $$LAYBASIC_INC $$DB_INC
LIBS += -L$$DESTDIR -lklayout_tl -lklayout_gsi -lklayout_laybasic -lklayout_db

View File

@ -0,0 +1,50 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2017 Matthias Koefferlein
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "utHead.h"
#include "antObject.h"
#include "antTemplate.h"
TEST(1)
{
ant::Template tmp = ant::Template ("title", "fmt_x", "fmt_y", "fmt",
ant::Object::STY_arrow_both,
ant::Object::OL_diag_xy,
true,
lay::AC_Ortho,
"cat");
ant::Object a = ant::Object (db::DPoint (1.0, 2.0), db::DPoint (3.0, 4.0), 17, tmp);
EXPECT_EQ (a.fmt (), "fmt");
EXPECT_EQ (a.fmt_x (), "fmt_x");
EXPECT_EQ (a.fmt_y (), "fmt_y");
EXPECT_EQ (a.box ().to_string (), "(1,2;3,4)");
EXPECT_EQ (a.p1 ().to_string (), "1,2");
EXPECT_EQ (a.p2 ().to_string (), "3,4");
EXPECT_EQ (a.angle_constraint (), lay::AC_Ortho);
EXPECT_EQ (a.id (), 17);
EXPECT_EQ (a.snap (), true);
EXPECT_EQ (a.category (), "cat");
}

View File

@ -0,0 +1,16 @@
DESTDIR_UT = $$OUT_PWD/../..
DESTDIR = $$OUT_PWD/..
TARGET = ant_tests
include($$PWD/../../lib_ut.pri)
SOURCES = \
antBasicTests.cc \
INCLUDEPATH += $$ANT_INC $$TL_INC $$LAYBASIC_INC $$DB_INC $$GSI_INC $$UT_INC
DEPENDPATH += $$ANT_INC $$TL_INC $$LAYBASIC_INC $$DB_INC $$GSI_INC $$UT_INC
LIBS += -L$$DESTDIR_UT -lklayout_ant -lklayout_laybasic -lklayout_db -lklayout_tl -lklayout_gsi -lklayout_ut

View File

@ -2,7 +2,6 @@
DESTDIR = $$OUT_PWD/../../..
TARGET = klayout_bd
include($$PWD/../../../klayout.pri)
include($$PWD/../../../lib.pri)
DEFINES += MAKE_BD_LIBRARY
@ -31,7 +30,7 @@ HEADERS = \
RESOURCES = \
INCLUDEPATH += ../../../tl ../../../db ../../../gsi ../../../version
DEPENDPATH += ../../../tl ../../../db ../../../gsi ../../../version
INCLUDEPATH += $$TL_INC $$GSI_INC $$VERSION_INC $$DB_INC
DEPENDPATH += $$TL_INC $$GSI_INC $$VERSION_INC $$DB_INC
LIBS += -L$$DESTDIR -lklayout_tl -lklayout_db -lklayout_gsi

View File

@ -11,8 +11,8 @@ include($$PWD/../../app.pri)
# place - it's not part of the bd sources.
SOURCES = $$PWD/bd/main.cc
INCLUDEPATH += ../bd
DEPENDPATH += ../bd
INCLUDEPATH += $$BD_INC
DEPENDPATH += $$BD_INC
LIBS += -L$$DESTDIR -lklayout_bd -lklayout_db -lklayout_tl -lklayout_gsi
DEFINES += BD_TARGET=$$TARGET

View File

@ -16,7 +16,7 @@ SOURCES = \
bdStrmxorTests.cc \
INCLUDEPATH += ../src/bd ../../db ../../tl ../../gsi ../../laybasic ../../lay ../../ut
DEPENDPATH += ../src/bd ../../db ../../tl ../../gsi ../../laybasic ../../lay ../../ut
INCLUDEPATH += $$BD_INC $$DB_INC $$TL_INC $$GSI_INC $$LAYBASIC_INC $$LAY_INC $$UT_INC
DEPENDPATH += $$BD_INC $$DB_INC $$TL_INC $$GSI_INC $$LAYBASIC_INC $$LAY_INC $$UT_INC
LIBS += -L$$DESTDIR_UT -lklayout_bd -lklayout_db -lklayout_tl -lklayout_gsi -lklayout_laybasic -lklayout_lay -lklayout_ut

View File

@ -1,238 +1,6 @@
DESTDIR = $$OUT_PWD/..
TARGET = klayout_db
TEMPLATE = subdirs
SUBDIRS = db unit_tests
include($$PWD/../klayout.pri)
include($$PWD/../lib.pri)
DEFINES += MAKE_DB_LIBRARY
SOURCES = \
dbArray.cc \
dbBox.cc \
dbBoxConvert.cc \
dbBoxScanner.cc \
dbCommonReader.cc \
dbCell.cc \
dbCellGraphUtils.cc \
dbCellHullGenerator.cc \
dbCellInst.cc \
dbCellMapping.cc \
dbCIF.cc \
dbCIFReader.cc \
dbCIFWriter.cc \
dbClipboard.cc \
dbClipboardData.cc \
dbClip.cc \
dbDXF.cc \
dbDXFReader.cc \
dbDXFWriter.cc \
dbEdge.cc \
dbEdgePair.cc \
dbEdgePairRelations.cc \
dbEdgePairs.cc \
dbEdgeProcessor.cc \
dbEdges.cc \
dbFillTool.cc \
dbForceLinkStreams.cc \
dbFuzzyCellMapping.cc \
dbGDS2.cc \
dbGDS2ReaderBase.cc \
dbGDS2Reader.cc \
dbGDS2WriterBase.cc \
dbGDS2Writer.cc \
dbGlyphs.cc \
dbHershey.cc \
dbInstances.cc \
dbInstElement.cc \
dbLayerMapping.cc \
dbLayerProperties.cc \
dbLayout.cc \
dbLayoutContextHandler.cc \
dbLayoutDiff.cc \
dbLayoutQuery.cc \
dbLayoutStateModel.cc \
dbLayoutUtils.cc \
dbLibrary.cc \
dbLibraryManager.cc \
dbLibraryProxy.cc \
dbLoadLayoutOptions.cc \
dbManager.cc \
dbMatrix.cc \
dbMemStatistics.cc \
dbOASIS.cc \
dbOASISReader.cc \
dbOASISWriter.cc \
dbObject.cc \
dbPath.cc \
dbPCellDeclaration.cc \
dbPCellHeader.cc \
dbPCellVariant.cc \
dbPoint.cc \
dbPolygon.cc \
dbPolygonTools.cc \
dbPolygonGenerators.cc \
dbPropertiesRepository.cc \
dbReader.cc \
dbRecursiveShapeIterator.cc \
dbRegion.cc \
dbSaveLayoutOptions.cc \
dbShape.cc \
dbShapes2.cc \
dbShapes3.cc \
dbShapes.cc \
dbShapeIterator.cc \
dbShapeProcessor.cc \
dbStatic.cc \
dbStream.cc \
dbStreamLayers.cc \
dbText.cc \
dbTextWriter.cc \
dbTilingProcessor.cc \
dbTrans.cc \
dbUserObject.cc \
dbVector.cc \
dbWriter.cc \
dbWriterTools.cc \
contrib/dbGDS2Converter.cc \
contrib/dbGDS2Text.cc \
contrib/dbGDS2TextReader.cc \
contrib/dbGDS2TextWriter.cc \
gsiDeclDbBox.cc \
gsiDeclDbCell.cc \
gsiDeclDbCellMapping.cc \
gsiDeclDbEdge.cc \
gsiDeclDbEdgePair.cc \
gsiDeclDbEdgePairs.cc \
gsiDeclDbEdgeProcessor.cc \
gsiDeclDbEdges.cc \
gsiDeclDbInstElement.cc \
gsiDeclDbLayerMapping.cc \
gsiDeclDbLayout.cc \
gsiDeclDbLayoutUtils.cc \
gsiDeclDbLayoutQuery.cc \
gsiDeclDbLibrary.cc \
gsiDeclDbManager.cc \
gsiDeclDbMatrix.cc \
gsiDeclDbPath.cc \
gsiDeclDbPoint.cc \
gsiDeclDbPolygon.cc \
gsiDeclDbReader.cc \
gsiDeclDbRecursiveShapeIterator.cc \
gsiDeclDbRegion.cc \
gsiDeclDbShape.cc \
gsiDeclDbShapeProcessor.cc \
gsiDeclDbShapes.cc \
gsiDeclDbText.cc \
gsiDeclDbTilingProcessor.cc \
gsiDeclDbTrans.cc \
gsiDeclDbVector.cc \
gsiDeclDbLayoutDiff.cc \
gsiDeclDbGlyphs.cc \
HEADERS = \
dbArray.h \
dbBoxConvert.h \
dbBox.h \
dbBoxScanner.h \
dbBoxTree.h \
dbCellGraphUtils.h \
dbCell.h \
dbCellHullGenerator.h \
dbCellInst.h \
dbCellMapping.h \
dbCIF.h \
dbCIFReader.h \
dbCIFWriter.h \
dbClipboardData.h \
dbClipboard.h \
dbClip.h \
dbDXF.h \
dbDXFReader.h \
dbDXFWriter.h \
dbEdge.h \
dbEdgePair.h \
dbEdgePairRelations.h \
dbEdgePairs.h \
dbEdgeProcessor.h \
dbEdges.h \
dbEdgesToContours.h \
dbFillTool.h \
dbFuzzyCellMapping.h \
dbGDS2.h \
dbGDS2ReaderBase.h \
dbGDS2Reader.h \
dbGDS2WriterBase.h \
dbGDS2Writer.h \
dbHash.h \
dbHersheyFont.h \
dbHershey.h \
dbInstances.h \
dbInstElement.h \
dbLayer.h \
dbLayerMapping.h \
dbLayerProperties.h \
dbLayoutDiff.h \
dbLayout.h \
dbLayoutQuery.h \
dbLayoutStateModel.h \
dbLayoutUtils.h \
dbLibrary.h \
dbLibraryManager.h \
dbLibraryProxy.h \
dbLoadLayoutOptions.h \
dbManager.h \
dbMatrix.h \
dbMemStatistics.h \
dbMetaInfo.h \
dbOASIS.h \
dbOASISReader.h \
dbOASISWriter.h \
dbObject.h \
dbObjectTag.h \
dbObjectWithProperties.h \
dbPath.h \
dbPCellDeclaration.h \
dbPCellHeader.h \
dbPCellVariant.h \
dbPoint.h \
dbPolygon.h \
dbPolygonTools.h \
dbPolygonGenerators.h \
dbPropertiesRepository.h \
dbReader.h \
dbRecursiveShapeIterator.h \
dbRegion.h \
dbSaveLayoutOptions.h \
dbShape.h \
dbShapeRepository.h \
dbShapes2.h \
dbShapeProcessor.h \
dbShapes.h \
dbStatic.h \
dbStream.h \
dbStreamLayers.h \
dbText.h \
dbTextWriter.h \
dbTilingProcessor.h \
dbTrans.h \
dbTypes.h \
dbUserObject.h \
dbVector.h \
dbWriter.h \
dbWriterTools.h \
contrib/dbGDS2Converter.h \
contrib/dbGDS2Text.h \
contrib/dbGDS2TextReader.h \
contrib/dbGDS2TextWriter.h \
dbCommonReader.h \
dbGlyphs.h \
dbCommon.h
RESOURCES = \
dbResources.qrc
INCLUDEPATH += $$TL_INC $$GSI_INC
DEPENDPATH += $$TL_INC $$GSI_INC
LIBS += -L$$DESTDIR -lklayout_tl -lklayout_gsi
unit_tests.depends += db

237
src/db/db/db.pro Normal file
View File

@ -0,0 +1,237 @@
DESTDIR = $$OUT_PWD/../..
TARGET = klayout_db
include($$PWD/../../lib.pri)
DEFINES += MAKE_DB_LIBRARY
SOURCES = \
dbArray.cc \
dbBox.cc \
dbBoxConvert.cc \
dbBoxScanner.cc \
dbCommonReader.cc \
dbCell.cc \
dbCellGraphUtils.cc \
dbCellHullGenerator.cc \
dbCellInst.cc \
dbCellMapping.cc \
dbCIF.cc \
dbCIFReader.cc \
dbCIFWriter.cc \
dbClipboard.cc \
dbClipboardData.cc \
dbClip.cc \
dbDXF.cc \
dbDXFReader.cc \
dbDXFWriter.cc \
dbEdge.cc \
dbEdgePair.cc \
dbEdgePairRelations.cc \
dbEdgePairs.cc \
dbEdgeProcessor.cc \
dbEdges.cc \
dbFillTool.cc \
dbForceLinkStreams.cc \
dbFuzzyCellMapping.cc \
dbGDS2.cc \
dbGDS2ReaderBase.cc \
dbGDS2Reader.cc \
dbGDS2WriterBase.cc \
dbGDS2Writer.cc \
dbGlyphs.cc \
dbHershey.cc \
dbInstances.cc \
dbInstElement.cc \
dbLayerMapping.cc \
dbLayerProperties.cc \
dbLayout.cc \
dbLayoutContextHandler.cc \
dbLayoutDiff.cc \
dbLayoutQuery.cc \
dbLayoutStateModel.cc \
dbLayoutUtils.cc \
dbLibrary.cc \
dbLibraryManager.cc \
dbLibraryProxy.cc \
dbLoadLayoutOptions.cc \
dbManager.cc \
dbMatrix.cc \
dbMemStatistics.cc \
dbOASIS.cc \
dbOASISReader.cc \
dbOASISWriter.cc \
dbObject.cc \
dbPath.cc \
dbPCellDeclaration.cc \
dbPCellHeader.cc \
dbPCellVariant.cc \
dbPoint.cc \
dbPolygon.cc \
dbPolygonTools.cc \
dbPolygonGenerators.cc \
dbPropertiesRepository.cc \
dbReader.cc \
dbRecursiveShapeIterator.cc \
dbRegion.cc \
dbSaveLayoutOptions.cc \
dbShape.cc \
dbShapes2.cc \
dbShapes3.cc \
dbShapes.cc \
dbShapeIterator.cc \
dbShapeProcessor.cc \
dbStatic.cc \
dbStream.cc \
dbStreamLayers.cc \
dbText.cc \
dbTextWriter.cc \
dbTilingProcessor.cc \
dbTrans.cc \
dbUserObject.cc \
dbVector.cc \
dbWriter.cc \
dbWriterTools.cc \
contrib/dbGDS2Converter.cc \
contrib/dbGDS2Text.cc \
contrib/dbGDS2TextReader.cc \
contrib/dbGDS2TextWriter.cc \
gsiDeclDbBox.cc \
gsiDeclDbCell.cc \
gsiDeclDbCellMapping.cc \
gsiDeclDbEdge.cc \
gsiDeclDbEdgePair.cc \
gsiDeclDbEdgePairs.cc \
gsiDeclDbEdgeProcessor.cc \
gsiDeclDbEdges.cc \
gsiDeclDbInstElement.cc \
gsiDeclDbLayerMapping.cc \
gsiDeclDbLayout.cc \
gsiDeclDbLayoutUtils.cc \
gsiDeclDbLayoutQuery.cc \
gsiDeclDbLibrary.cc \
gsiDeclDbManager.cc \
gsiDeclDbMatrix.cc \
gsiDeclDbPath.cc \
gsiDeclDbPoint.cc \
gsiDeclDbPolygon.cc \
gsiDeclDbReader.cc \
gsiDeclDbRecursiveShapeIterator.cc \
gsiDeclDbRegion.cc \
gsiDeclDbShape.cc \
gsiDeclDbShapeProcessor.cc \
gsiDeclDbShapes.cc \
gsiDeclDbText.cc \
gsiDeclDbTilingProcessor.cc \
gsiDeclDbTrans.cc \
gsiDeclDbVector.cc \
gsiDeclDbLayoutDiff.cc \
gsiDeclDbGlyphs.cc \
HEADERS = \
dbArray.h \
dbBoxConvert.h \
dbBox.h \
dbBoxScanner.h \
dbBoxTree.h \
dbCellGraphUtils.h \
dbCell.h \
dbCellHullGenerator.h \
dbCellInst.h \
dbCellMapping.h \
dbCIF.h \
dbCIFReader.h \
dbCIFWriter.h \
dbClipboardData.h \
dbClipboard.h \
dbClip.h \
dbDXF.h \
dbDXFReader.h \
dbDXFWriter.h \
dbEdge.h \
dbEdgePair.h \
dbEdgePairRelations.h \
dbEdgePairs.h \
dbEdgeProcessor.h \
dbEdges.h \
dbEdgesToContours.h \
dbFillTool.h \
dbFuzzyCellMapping.h \
dbGDS2.h \
dbGDS2ReaderBase.h \
dbGDS2Reader.h \
dbGDS2WriterBase.h \
dbGDS2Writer.h \
dbHash.h \
dbHersheyFont.h \
dbHershey.h \
dbInstances.h \
dbInstElement.h \
dbLayer.h \
dbLayerMapping.h \
dbLayerProperties.h \
dbLayoutDiff.h \
dbLayout.h \
dbLayoutQuery.h \
dbLayoutStateModel.h \
dbLayoutUtils.h \
dbLibrary.h \
dbLibraryManager.h \
dbLibraryProxy.h \
dbLoadLayoutOptions.h \
dbManager.h \
dbMatrix.h \
dbMemStatistics.h \
dbMetaInfo.h \
dbOASIS.h \
dbOASISReader.h \
dbOASISWriter.h \
dbObject.h \
dbObjectTag.h \
dbObjectWithProperties.h \
dbPath.h \
dbPCellDeclaration.h \
dbPCellHeader.h \
dbPCellVariant.h \
dbPoint.h \
dbPolygon.h \
dbPolygonTools.h \
dbPolygonGenerators.h \
dbPropertiesRepository.h \
dbReader.h \
dbRecursiveShapeIterator.h \
dbRegion.h \
dbSaveLayoutOptions.h \
dbShape.h \
dbShapeRepository.h \
dbShapes2.h \
dbShapeProcessor.h \
dbShapes.h \
dbStatic.h \
dbStream.h \
dbStreamLayers.h \
dbText.h \
dbTextWriter.h \
dbTilingProcessor.h \
dbTrans.h \
dbTypes.h \
dbUserObject.h \
dbVector.h \
dbWriter.h \
dbWriterTools.h \
contrib/dbGDS2Converter.h \
contrib/dbGDS2Text.h \
contrib/dbGDS2TextReader.h \
contrib/dbGDS2TextWriter.h \
dbCommonReader.h \
dbGlyphs.h \
dbCommon.h
RESOURCES = \
dbResources.qrc
INCLUDEPATH += $$TL_INC $$GSI_INC
DEPENDPATH += $$TL_INC $$GSI_INC
LIBS += -L$$DESTDIR -lklayout_tl -lklayout_gsi

Some files were not shown because too many files have changed in this diff Show More