diff --git a/src/db/db/dbEdges.h b/src/db/db/dbEdges.h index 68fe606d2..17788cde3 100644 --- a/src/db/db/dbEdges.h +++ b/src/db/db/dbEdges.h @@ -229,8 +229,11 @@ private: * @brief ctor from a recursive shape iterator */ EdgesIterator (const db::RecursiveShapeIterator &iter, const db::ICplxTrans &trans) - : m_rec_iter (iter), m_iter_trans (trans) - { + : m_rec_iter (iter), m_iter_trans (trans), m_from (), m_to () + { + // NOTE: the following initialization appears to be required on some compilers + // (specifically MacOS/clang) to ensure the proper initialization of the iterators + m_from = m_to; set (); } diff --git a/src/db/unit_tests/dbCell.cc b/src/db/unit_tests/dbCell.cc index 4461dd7ae..d4f6c9658 100644 --- a/src/db/unit_tests/dbCell.cc +++ b/src/db/unit_tests/dbCell.cc @@ -570,13 +570,13 @@ TEST(2) } - c0.erase (i4); - EXPECT_EQ (c2s_unsorted(c0), "5[r0 *1 0,0]#2,3[r0 *1 0,0]#13"); - EXPECT_EQ (c0.cell_instances (), size_t (2)); c0.erase (i5); + EXPECT_EQ (c2s_unsorted(c0), "5[r0 *1 0,0]#2,1[r0 *1 0,0]#1"); + EXPECT_EQ (c0.cell_instances (), size_t (2)); + c0.erase (i4); EXPECT_EQ (c2s_unsorted(c0), "5[r0 *1 0,0]#2"); EXPECT_EQ (c0.cell_instances (), size_t (1)); - // not yet: EXPECT_EQ (c0.empty (), false); + // Not yet: EXPECT_EQ (c0.empty (), false); // note: double delete is not supported in non-editable mode if (db::default_editable_mode ()) { @@ -608,7 +608,7 @@ TEST(2) c0.erase (i3); EXPECT_EQ (c2s_unsorted(c0), ""); EXPECT_EQ (c0.cell_instances (), size_t (0)); - // not yet: EXPECT_EQ (c0.empty (), true); + // Not yet: EXPECT_EQ (c0.empty (), true); } TEST(3) diff --git a/src/gsi/gsi/gsiCallback.h b/src/gsi/gsi/gsiCallback.h index 21a78ab62..f173bf0e7 100644 --- a/src/gsi/gsi/gsiCallback.h +++ b/src/gsi/gsi/gsiCallback.h @@ -34,7 +34,7 @@ namespace gsi * * This class is specialized to implement the actual call process later. */ -struct Callee +struct GSI_PUBLIC Callee : public tl::Object { Callee () { } @@ -49,7 +49,7 @@ struct Callee * This object holds informations about the actual implementation of the callback * on the scripting client's side. */ -struct Callback +struct Callback { Callback () : id (-1), callee (0), argsize (0), retsize (0) diff --git a/src/gsi/gsi/gsiDeclBasic.h b/src/gsi/gsi/gsiDeclBasic.h index 7bafa8000..b77d46fda 100644 --- a/src/gsi/gsi/gsiDeclBasic.h +++ b/src/gsi/gsi/gsiDeclBasic.h @@ -37,7 +37,7 @@ namespace gsi /** * @brief Provides a basic implementation for a "boxed" plain value using a Variant as the basic type */ -class Value +class GSI_PUBLIC Value { public: /** diff --git a/src/lay/lay/laySystemPaths.cc b/src/lay/lay/laySystemPaths.cc index 6e458716c..2f5645c32 100644 --- a/src/lay/lay/laySystemPaths.cc +++ b/src/lay/lay/laySystemPaths.cc @@ -30,6 +30,9 @@ #ifdef _WIN32 # include +#elif __APPLE__ +# include +# include #else # include #endif @@ -79,6 +82,15 @@ get_inst_path_internal () return tl::to_string (fi.absolutePath ()); } +#elif __APPLE__ + + char buffer[PROC_PIDPATHINFO_MAXSIZE]; + int ret = proc_pidpath (getpid (), buffer, sizeof (buffer)); + if (ret > 0) { + // TODO: does this correctly translate paths? (MacOS uses UTF-8 encoding with D-like normalization) + return tl::to_string (QFileInfo (QString::fromUtf8 (buffer)).absolutePath ()); + } + #else QFileInfo proc_exe (tl::to_qstring (tl::sprintf ("/proc/%d/exe", getpid ()))); diff --git a/src/tl/tl/tlException.h b/src/tl/tl/tlException.h index 306af3c95..0b1baafc0 100644 --- a/src/tl/tl/tlException.h +++ b/src/tl/tl/tlException.h @@ -137,7 +137,7 @@ private: * @brief A "neutral" exception thrown to terminate some operation * This exception is not shown. */ -struct CancelException +struct TL_PUBLIC CancelException : public Exception { CancelException () @@ -148,7 +148,7 @@ struct CancelException /** * @brief A special "internal" exception class used by tl_assert */ -struct InternalException +struct TL_PUBLIC InternalException : public Exception { InternalException (const char *file, int line, const char *cond) diff --git a/src/unit_tests/unit_test_main.cc b/src/unit_tests/unit_test_main.cc index 1d0bc6b79..80d64c7b5 100644 --- a/src/unit_tests/unit_test_main.cc +++ b/src/unit_tests/unit_test_main.cc @@ -365,6 +365,10 @@ main_cont (int argc, char **argv) } + if (! tl::TestRegistrar::instance()) { + throw tl::Exception ("No test libraries found - make sure, the *.ut files are next to the ut_runner executable."); + } + // No side effects lay::set_klayout_path (std::vector ()); diff --git a/src/unit_tests/unit_tests.pro b/src/unit_tests/unit_tests.pro index 7e45e19fd..68df3dffc 100644 --- a/src/unit_tests/unit_tests.pro +++ b/src/unit_tests/unit_tests.pro @@ -6,6 +6,11 @@ include($$PWD/../with_all_libs.pri) TEMPLATE = app +# Don't build the ut_runner app as ordinary command line tool on MacOS +mac { + CONFIG -= app_bundle +} + TARGET = ut_runner SOURCES = \