]> granicus.if.org Git - graphviz/log
graphviz
3 years agoagbindrec: realign parameter names in prototype with definition
Matthew Fernandez [Tue, 10 Aug 2021 01:43:47 +0000 (18:43 -0700)]
agbindrec: realign parameter names in prototype with definition

The C compiler does not care if these names mismatch, but it is less confusing
to be consistent. This change leaves the obj/arg_obj discrepancy alone under the
justification that "arg_obj" is not any more useful externally-facing and "obj"
internally would conflict with an already existing local.

3 years agoagbindrec: take a const char* instead of char* for record name
Matthew Fernandez [Tue, 10 Aug 2021 01:41:41 +0000 (18:41 -0700)]
agbindrec: take a const char* instead of char* for record name

This function does not modify its argument. No changelog entry because this is
already covered by the existing #634 one for the upcoming release.

3 years agoaggetrec: take a const char* instead of char* for record name
Matthew Fernandez [Tue, 10 Aug 2021 01:33:06 +0000 (18:33 -0700)]
aggetrec: take a const char* instead of char* for record name

This function does not modify its argument. No changelog entry because this is
already covered by the existing #634 one for the upcoming release.

3 years agoaggetrec: remove micro-optimization of string comparison
Matthew Fernandez [Tue, 10 Aug 2021 01:30:14 +0000 (18:30 -0700)]
aggetrec: remove micro-optimization of string comparison

This kind of trick is unnecessary on modern machines.

3 years agoMerge branch 'dont-wait-for-portable-source-for-cmake-jobs' into 'main'
Magnus Jacobsson [Thu, 12 Aug 2021 16:23:58 +0000 (16:23 +0000)]
Merge branch 'dont-wait-for-portable-source-for-cmake-jobs' into 'main'

Reduce latency in CI for CMake jobs + some related cleanup

See merge request graphviz/graphviz!2090

3 years agoMerge branch 'smattr/16235491-04e0-471e-a116-e92e994517ea' into 'main'
Matthew Fernandez [Thu, 12 Aug 2021 15:43:10 +0000 (15:43 +0000)]
Merge branch 'smattr/16235491-04e0-471e-a116-e92e994517ea' into 'main'

more steps towards removing sfio

See merge request graphviz/graphviz!2089

3 years agoremove the dependency on the portable-source job for autotools test jobs
Magnus Jacobsson [Mon, 9 Aug 2021 12:08:00 +0000 (14:08 +0200)]
remove the dependency on the portable-source job for autotools test jobs

This dependency is now obsolete and unnecessary although there is no
latency benefit by removing it.

3 years agoadd archiving of VERSION and COLLECTION to all build jobs
Magnus Jacobsson [Mon, 9 Aug 2021 12:03:40 +0000 (14:03 +0200)]
add archiving of VERSION and COLLECTION to all build jobs

An upcoming commit will remove the dependency to the portable-source
job for all test jobs, so it must be possible the retrieve these files
from the corresponding build job instead. Note that this is used only
for jobs using the portable source which have these files built into
them. Other jobs generate these files as needed.

3 years agoremove the dependency on the portable-source job for CMake test jobs
Magnus Jacobsson [Wed, 11 Aug 2021 18:21:39 +0000 (20:21 +0200)]
remove the dependency on the portable-source job for CMake test jobs

The dependency is unnecessary since both the VERSION and COLLECTION
files are now generated in the CMake test jobs. Note that there
probably is no latency benefit by removing it, since the
portable-source job normally is faster than the CMake builds jobs.

3 years agoadd generation of VERSION to all CMake test jobs
Magnus Jacobsson [Mon, 9 Aug 2021 12:03:40 +0000 (14:03 +0200)]
add generation of VERSION to all CMake test jobs

An upcoming commit will remove the dependency to the portable-source
job for all CMake test jobs, so this file instead needs to be
generated by these jobs. Note that the COLLECTION file is generated by
the CMake test jobs already before this commit.

3 years agoremove the dependency on the portable-source job for CMake build jobs
Magnus Jacobsson [Mon, 9 Aug 2021 11:05:58 +0000 (13:05 +0200)]
remove the dependency on the portable-source job for CMake build jobs

The dependency is now obsolete and this change reduces the latency for
the CMake jobs significantly by not having to wait for the
portable-source job.

3 years agodon't read the VERSION file for CMake builds in ci/build.sh
Magnus Jacobsson [Mon, 9 Aug 2021 11:26:32 +0000 (13:26 +0200)]
don't read the VERSION file for CMake builds in ci/build.sh

The CMake build system generates this file itself and nothing in this
script uses it for the CMake builds.

An upcoming commit will change the CI configuration to start the CMake
builds jobs directly without waiting for the portable-source job and
since that job produces the VERSION file, it will no longer be present
when the CMake builds jobs start.

3 years agoremove unnecessary casts of parameters to sfio extf functions
Matthew Fernandez [Sun, 8 Aug 2021 23:04:46 +0000 (16:04 -0700)]
remove unnecessary casts of parameters to sfio extf functions

These pointers implicitly coerce. Related to #1998.

3 years agoremove the first parameter of Sffmtext_f
Matthew Fernandez [Sun, 8 Aug 2021 22:58:25 +0000 (15:58 -0700)]
remove the first parameter of Sffmtext_f

Neither uses of the only field of this type, extf, were using this parameter.
Related to #1998.

3 years agorestructure "%.*s" handling to avoid sfio dynamic allocation in expr’s printf
Matthew Fernandez [Sun, 8 Aug 2021 22:36:27 +0000 (15:36 -0700)]
restructure "%.*s" handling to avoid sfio dynamic allocation in expr’s printf

Rather than using the temporary sfio buffer in this code, fmt->tmp, we can just
use the original string as-is as it does not need to be modified. Apart from
slightly accelerating this code, this makes yet more progress towards removing
fmt->tmp and sfio. Related to #1998.

3 years agoremove the use of an sfio temporary buffer in expr’s qualify
Matthew Fernandez [Sun, 8 Aug 2021 22:39:38 +0000 (15:39 -0700)]
remove the use of an sfio temporary buffer in expr’s qualify

We can simply use regular malloc for this short-lived allocation. Related to
#1998.

3 years agoremove fallback "%?%K" strftime format in expr’s printf
Matthew Fernandez [Sun, 8 Aug 2021 22:20:11 +0000 (15:20 -0700)]
remove fallback "%?%K" strftime format in expr’s printf

lib/expr’s printf implementation supports a "%t" format code to print a time. If
no format is provided for this, it would fallback to a default of "%?%K".

While working on #1998, one of my intermediate refactorings moved this string
literal into the actual call to strftime. At this point the compiler politely
interjected that neither "%?" nor "%K" are format strings understood by
strftime. So it seems this results in an invalid call to strftime.

To deal with this, we now throw an error when this function is called with no
format string instead of making an invalid strftime call.

3 years agoMerge branch 'add-svg-analyzer' into 'main'
Magnus Jacobsson [Thu, 12 Aug 2021 08:24:44 +0000 (08:24 +0000)]
Merge branch 'add-svg-analyzer' into 'main'

Add an SVG analyzer and use it in the C++ tests

See merge request graphviz/graphviz!2087

3 years agoadd a few first tests of the rendered SVG
Magnus Jacobsson [Thu, 8 Apr 2021 20:51:26 +0000 (22:51 +0200)]
add a few first tests of the rendered SVG

3 years agoadd a very basic SVG analyzer based on SVG++
Magnus Jacobsson [Thu, 8 Apr 2021 20:51:26 +0000 (22:51 +0200)]
add a very basic SVG analyzer based on SVG++

3 years agoadd the RapidXml library as a test dependency
Magnus Jacobsson [Mon, 9 Aug 2021 10:24:56 +0000 (12:24 +0200)]
add the RapidXml library as a test dependency

3 years agoadd the SVG++ library as a test dependency
Magnus Jacobsson [Mon, 5 Jul 2021 11:27:48 +0000 (13:27 +0200)]
add the SVG++ library as a test dependency

3 years agoadd the Boost library as a test dependency
Magnus Jacobsson [Mon, 9 Aug 2021 10:25:08 +0000 (12:25 +0200)]
add the Boost library as a test dependency

3 years agoMerge branch 'smattr/0d0a4b9b-fa49-4682-ba70-cfff5fb32a13' into 'main'
Matthew Fernandez [Tue, 10 Aug 2021 15:44:15 +0000 (15:44 +0000)]
Merge branch 'smattr/0d0a4b9b-fa49-4682-ba70-cfff5fb32a13' into 'main'

move pathexists.c

See merge request graphviz/graphviz!2085

3 years agoremove now-unused pathexists.c
Matthew Fernandez [Wed, 4 Aug 2021 04:23:13 +0000 (21:23 -0700)]
remove now-unused pathexists.c

The caching done by this function is no longer necessary. All usages of it have
been refactored to use standard library functionality which does caching at the
operating system level.

3 years agopathpath: replace PATH_REGULAR pathexists call with a stat.
Matthew Fernandez [Wed, 4 Aug 2021 04:15:51 +0000 (21:15 -0700)]
pathpath: replace PATH_REGULAR pathexists call with a stat.

This effectively inlines and simplifies the call to pathexists that previously
existed. The caching pathexists does is no longer relevant. An improved version
of this is provided by a modern operating system’s buffer cache.

3 years agopathpath: replace PATH_EXECUTE pathexists call with X_OK access call
Matthew Fernandez [Wed, 4 Aug 2021 04:09:34 +0000 (21:09 -0700)]
pathpath: replace PATH_EXECUTE pathexists call with X_OK access call

This is equivalent and relies solely on standard library functionality. This
effectively inlines and simplifies the call to pathexists that previously
existed. The caching pathexists does is no longer relevant. An improved version
of this is provided by a modern operating system’s buffer cache.

3 years agopathpath: remove 'a' parameter
Matthew Fernandez [Wed, 4 Aug 2021 04:00:42 +0000 (21:00 -0700)]
pathpath: remove 'a' parameter

This function is only ever called with a=="". There is probably more
simplification possible within pathpath, but the logic is convoluted. Better to
unwind this mess in a separate commit.

3 years agopathpath: remove mode parameter
Matthew Fernandez [Wed, 4 Aug 2021 03:54:14 +0000 (20:54 -0700)]
pathpath: remove mode parameter

This function is only ever called with PATH_REGULAR.

3 years agoMerge branch 'fix-ctest' into 'main'
Magnus Jacobsson [Tue, 10 Aug 2021 04:50:28 +0000 (04:50 +0000)]
Merge branch 'fix-ctest' into 'main'

fix a broken C++ test case and the reason that the failure was undetected in CI

See merge request graphviz/graphviz!2091

3 years agofix multiple layout test case using rvalue refs
Magnus Jacobsson [Mon, 9 Aug 2021 17:41:35 +0000 (19:41 +0200)]
fix multiple layout test case using rvalue refs

The first layout of a graph must be destroyed before a second layout
is created.

This failure went undetected in CI since no test programs ran, which
in turn was caused by not archiving the test programs or the
CTestTestfile.cmake files in the preceding build job.

The error message was:

-------------------------------------------------------------------------------
Multiple layouts of the same graph can use different contexts passed as rvalue
refs
-------------------------------------------------------------------------------
../tests/test_GVLayout_construction.cpp:139
...............................................................................

../tests/test_GVLayout_construction.cpp:139: FAILED:
due to unexpected exception with message:
  Previous layout not yet destroyed

3 years agofix CTestTestfile.cmake files not archived
Magnus Jacobsson [Mon, 9 Aug 2021 17:25:09 +0000 (19:25 +0200)]
fix CTestTestfile.cmake files not archived

No CTestTestfile.cmake files were archived in the build job that
created them, which had the effect that the suceeding test job
silently did not find any ctest tests.

3 years agofix C++ test programs not archived
Magnus Jacobsson [Mon, 9 Aug 2021 17:25:09 +0000 (19:25 +0200)]
fix C++ test programs not archived

No C++ test programs were archived in the build job that built them,
which had the effect that the suceeding test job silently did not run
any.

3 years agoMerge branch 'smattr/248235f2-06a2-400f-adad-66d935359f86' into 'main'
Matthew Fernandez [Sun, 8 Aug 2021 18:30:50 +0000 (18:30 +0000)]
Merge branch 'smattr/248235f2-06a2-400f-adad-66d935359f86' into 'main'

more compiler warning squashing

See merge request graphviz/graphviz!2084

3 years agopathgetlink: use a ssize_t locally, squashing -Wsign-conversion warnings
Matthew Fernandez [Wed, 4 Aug 2021 03:31:38 +0000 (20:31 -0700)]
pathgetlink: use a ssize_t locally, squashing -Wsign-conversion warnings

The type of the local used now matches the return type of readlink. This avoids
several compiler warnings. pathgetlink.c now builds warning-free on Linux.

3 years agopathgetlink: return a size_t and SIZE_MAX for an error value
Matthew Fernandez [Wed, 4 Aug 2021 03:23:45 +0000 (20:23 -0700)]
pathgetlink: return a size_t and SIZE_MAX for an error value

This will permit some upcoming changes to remove some compiler warnings.

3 years agopathcanon: avoid reusing `dots` variable for unrelated values
Matthew Fernandez [Wed, 4 Aug 2021 03:10:07 +0000 (20:10 -0700)]
pathcanon: avoid reusing `dots` variable for unrelated values

This branch reuses the `dots` variable, previously used for counting the number
of periods in the path, for storing the result of symlink resolution. This is
unnecessary (`dots` is immediately overwritten with the value 4 after this), and
is getting in the way of cleaning up some compiler warnings in this area.

3 years agopathgetlink: accept a size_t size to avoid -Wsign-conversion warnings
Matthew Fernandez [Wed, 4 Aug 2021 02:56:53 +0000 (19:56 -0700)]
pathgetlink: accept a size_t size to avoid -Wsign-conversion warnings

3 years agoremove unnecessary #include
Matthew Fernandez [Wed, 4 Aug 2021 02:56:18 +0000 (19:56 -0700)]
remove unnecessary #include

It is unnecessary to include stddef.h when stdlib.h is included.

3 years agosquash -Wmissing-prototypes warnings for pathgetlink
Matthew Fernandez [Wed, 4 Aug 2021 02:53:21 +0000 (19:53 -0700)]
squash -Wmissing-prototypes warnings for pathgetlink

3 years agoremove unnecessary ifdef sun guard
Matthew Fernandez [Wed, 4 Aug 2021 02:49:04 +0000 (19:49 -0700)]
remove unnecessary ifdef sun guard

Graphviz is compiled with C99, where string.h is always available and safe to
include.

3 years agoremove UNIV_MAX-guarded code
Matthew Fernandez [Wed, 4 Aug 2021 02:46:59 +0000 (19:46 -0700)]
remove UNIV_MAX-guarded code

Nothing in the build systems define this.

3 years agosquash -Wundef warnings for _DEBUG_MATCH
Matthew Fernandez [Wed, 4 Aug 2021 02:43:29 +0000 (19:43 -0700)]
squash -Wundef warnings for _DEBUG_MATCH

3 years agoMerge branch 'add-GVLayout-construction-overloads-using-rvalue-refs' into 'main'
Magnus Jacobsson [Sun, 8 Aug 2021 04:56:31 +0000 (04:56 +0000)]
Merge branch 'add-GVLayout-construction-overloads-using-rvalue-refs' into 'main'

Add GVLayout construction overloads to the C++ API

See merge request graphviz/graphviz!2086

3 years agoadd test of multiple GVLayout constructions of the same graph using different context...
Magnus Jacobsson [Wed, 7 Jul 2021 13:56:05 +0000 (15:56 +0200)]
add test of multiple GVLayout constructions of the same graph using different contexts passed as rvalue refs

3 years agoadd GVLayout construction overload, passing the context as an rvalue ref
Magnus Jacobsson [Wed, 7 Jul 2021 13:55:08 +0000 (15:55 +0200)]
add GVLayout construction overload, passing the context as an rvalue ref

3 years agoadd test of multiple GVLayout constructions of different graphs passed as rvalue...
Magnus Jacobsson [Wed, 7 Jul 2021 13:36:51 +0000 (15:36 +0200)]
add test of multiple GVLayout constructions of different graphs passed as rvalue refs using the same context

3 years agoadd GVLayout construction overload, passing the graph as an rvalue ref
Magnus Jacobsson [Wed, 7 Jul 2021 13:35:52 +0000 (15:35 +0200)]
add GVLayout construction overload, passing the graph as an rvalue ref

3 years agoadd test of GVLayout construction overload, passing the context and the graph as...
Magnus Jacobsson [Wed, 7 Jul 2021 12:17:43 +0000 (14:17 +0200)]
add test of GVLayout construction overload, passing the context and the graph as rvalue refs

3 years agoadd GVLayout constructor overload, passing the context and the graph as rvalue refs
Magnus Jacobsson [Wed, 7 Jul 2021 12:17:43 +0000 (14:17 +0200)]
add GVLayout constructor overload, passing the context and the graph as rvalue refs

3 years agoMerge branch 'add-cpp-api' into 'main'
Magnus Jacobsson [Sat, 7 Aug 2021 06:49:46 +0000 (06:49 +0000)]
Merge branch 'add-cpp-api' into 'main'

Add a very basic C++ API

Closes #2001

See merge request graphviz/graphviz!2058

3 years agoadd test of throwing exception when trying to create a layout on a graph when one...
Magnus Jacobsson [Wed, 4 Aug 2021 16:25:02 +0000 (18:25 +0200)]
add test of throwing exception when trying to create a layout on a graph when one already exists

3 years agothrow exception if trying to create a layout on a graph when one already exists
Magnus Jacobsson [Wed, 4 Aug 2021 16:21:53 +0000 (18:21 +0200)]
throw exception if trying to create a layout on a graph when one already exists

Before this, the first layout was silently replaced by the second,
which may not be what the caller would expect.

3 years agodestroy first layout before creating second in multiple layouts test
Magnus Jacobsson [Wed, 4 Aug 2021 16:20:14 +0000 (18:20 +0200)]
destroy first layout before creating second in multiple layouts test

An upcoming commit in this series will change the implementation to
throw an exception if the previous layout has not been destroyed when
a second layout is created.

3 years agoadd a gvLayoutDone function to the gvc lib
Magnus Jacobsson [Wed, 4 Aug 2021 16:18:04 +0000 (18:18 +0200)]
add a gvLayoutDone function to the gvc lib

An upcoming commit in the series need to perform this check from
C++. Using the LAYOUT_DONE macro directly would give the warning
below. It would be possible to change the underlying C functions to
take a const char * instead, but exposing this new function seems
better than using a macro in C++ anyway.

The warning that would have been the result otherwise:

In file included from /home/magjac/graphviz/lib/gvc++/GVContext.h:5,
                 from /home/magjac/graphviz/lib/gvc++/GVLayout.cpp:6:
/home/magjac/graphviz/lib/gvc++/GVLayout.cpp: In constructor ‘GVC::GVLayout::GVLayout(const std::shared_ptr<GVC::GVContext>&, const std::shared_ptr<CGraph::AGraph>&, const string&)’:
/home/magjac/graphviz/lib/gvc/gvc.h:38:38: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
   38 | #define LAYOUT_DONE(g) (agbindrec(g, "Agraphinfo_t", 0, TRUE) && GD_drawing(g))
      |                                      ^~~~~~~~~~~~~~
/home/magjac/graphviz/lib/gvc++/GVLayout.cpp:18:9: note: in expansion of macro ‘LAYOUT_DONE’
   18 |     if (LAYOUT_DONE(g->c_struct())) {}
      |         ^~~~~~~~~~~

3 years agoadd a CHANGELOG entry for the new C++ API
Magnus Jacobsson [Sun, 4 Jul 2021 07:34:53 +0000 (09:34 +0200)]
add a CHANGELOG entry for the new C++ API

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agostep minor release version
Magnus Jacobsson [Sun, 4 Jul 2021 07:35:02 +0000 (09:35 +0200)]
step minor release version

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd test of GVLayout render throwing an exception for unknown formats
Magnus Jacobsson [Mon, 5 Apr 2021 19:10:51 +0000 (21:10 +0200)]
add test of GVLayout render throwing an exception for unknown formats

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd test of GVLayout render creating a GVRenderData object
Magnus Jacobsson [Mon, 5 Apr 2021 19:10:51 +0000 (21:10 +0200)]
add test of GVLayout render creating a GVRenderData object

GVRenderData destroy is also implicitly tested since we would detect
potential memory leaks with ASan.

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd render method to GVLayout that returns a GVRenderData object
Magnus Jacobsson [Tue, 6 Jul 2021 20:13:07 +0000 (22:13 +0200)]
add render method to GVLayout that returns a GVRenderData object

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd a GVRenderData class
Magnus Jacobsson [Thu, 15 Jul 2021 12:37:33 +0000 (14:37 +0200)]
add a GVRenderData class

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd test of multiple GVLayout constructions of the same graph using different contexts
Magnus Jacobsson [Wed, 7 Jul 2021 13:56:05 +0000 (15:56 +0200)]
add test of multiple GVLayout constructions of the same graph using different contexts

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd test of multiple GVLayout constructions of different graphs using the same context
Magnus Jacobsson [Wed, 7 Jul 2021 13:08:36 +0000 (15:08 +0200)]
add test of multiple GVLayout constructions of different graphs using the same context

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd test of GVLayout move construction
Magnus Jacobsson [Sat, 17 Jul 2021 09:18:41 +0000 (11:18 +0200)]
add test of GVLayout move construction

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd test of GVLayout move assignment
Magnus Jacobsson [Thu, 8 Jul 2021 19:36:11 +0000 (21:36 +0200)]
add test of GVLayout move assignment

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd test of GVLayout construction throwing an exception when layout fails
Magnus Jacobsson [Sun, 4 Apr 2021 13:58:29 +0000 (15:58 +0200)]
add test of GVLayout construction throwing an exception when layout fails

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd test of GVLayout construction using built-in plugins
Magnus Jacobsson [Fri, 16 Jul 2021 05:46:18 +0000 (07:46 +0200)]
add test of GVLayout construction using built-in plugins

GVLayout destroy is also implicitly tested since we would detect
potential memory leaks with ASan.

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd test of GVLayout construction using on-demand loaded plugins
Magnus Jacobsson [Sun, 4 Apr 2021 13:58:29 +0000 (15:58 +0200)]
add test of GVLayout construction using on-demand loaded plugins

Test construction of a GVLayout object from shared pointers to AGraph
and GVContext objects, performing a layout of AGraph using GVContext.

GVLayout destroy is also implicitly tested since we would detect
potential memory leaks with ASan.

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd a GVLayout class with construction from AGraph and GVContext objects
Magnus Jacobsson [Sun, 4 Apr 2021 13:58:29 +0000 (15:58 +0200)]
add a GVLayout class with construction from AGraph and GVContext objects

The GVLayout class is an RAII-class that performs a layout using
shared pointers to AGraph and GVContext objects. It participates in
the handling of the lifetime of those objects, since it needs them to
free the layout when the GVLayout object is destroyed. It currently
supports construction with built-in plugins, move construction and
move assignment, but not copy construction or copy assignment since
the AGraph and GVContext objects do not support that.

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd test of GVContext move assignment
Magnus Jacobsson [Sat, 17 Jul 2021 09:04:20 +0000 (11:04 +0200)]
add test of GVContext move assignment

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd test of GVContext move construction
Magnus Jacobsson [Sat, 17 Jul 2021 09:04:09 +0000 (11:04 +0200)]
add test of GVContext move construction

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd test of GVContext construction without built-in plugins
Magnus Jacobsson [Sat, 3 Apr 2021 22:10:58 +0000 (00:10 +0200)]
add test of GVContext construction without built-in plugins

Destroy is also implicitly tested since we would detect potential
memory leaks with ASan.

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoconfigure the dot layout plugin for use pre-installation
Magnus Jacobsson [Mon, 5 Jul 2021 13:26:02 +0000 (15:26 +0200)]
configure the dot layout plugin for use pre-installation

When running ctest, the Graphviz shared libraries are used from the
locations where they reside directly after being created, i.e., before
they are copied to the installation directory by cpack. Since the
pre-configuring of the Graphviz plugins that cpack does is done on the
installed plugins, the pre-install plugins need to be configured
separately.

We use GVBINDIR for this. It tells Graphviz both where to find plugins
and where to read and write the plugin configuration file,
config6. Unfortunately this means that we can only use one plugin
since the others are in separate directories and Graphviz currently
supports only one path in GVBINDIR. We choose to configure the dot
layout plugin which is good for now.

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoarchive the just-built dot program in the Ubuntu 21.04 ctest CI job
Magnus Jacobsson [Mon, 5 Jul 2021 13:24:47 +0000 (15:24 +0200)]
archive the just-built dot program in the Ubuntu 21.04 ctest CI job

In an upcoming commit in this series, the dot program will be used by
the ctest CI jobs to configure plugins for pre-install tests without
built-in plugins. This extra archiving is needed since these tests use
the dot program from the location where it resides directly after
being created, i.e., before it is copied to the installation directory
by cpack.

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd test of GVContext construction with built-in plugins
Magnus Jacobsson [Sat, 3 Apr 2021 22:10:58 +0000 (00:10 +0200)]
add test of GVContext construction with built-in plugins

Destroy is also implicitly tested since we would detect potential
memory leaks with ASan.

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd a new gvc++ library with a very basic GVContext C++ class
Magnus Jacobsson [Sat, 3 Apr 2021 22:10:58 +0000 (00:10 +0200)]
add a new gvc++ library with a very basic GVContext C++ class

The GVContext class is an RAII-class that handles the lifetime of the
underlying GVC_t C data structure. It currently supports construction
with or without built-in plugins, move construction and move
assignment, but not copy construction or copy assignment since the
underlying C data structure cannot be easily copied. It also supports
retrieving a non-owning pointer to the underlying GVC_t.

The new gvc++ library is optional and can be enabled with the CMake
option "with_cxx_api".

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd test of Agraph move assignment
Magnus Jacobsson [Fri, 16 Jul 2021 04:32:03 +0000 (06:32 +0200)]
add test of Agraph move assignment

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd test of Agraph move construction
Magnus Jacobsson [Fri, 16 Jul 2021 04:31:37 +0000 (06:31 +0200)]
add test of Agraph move construction

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd test of Agraph construction throwing an exception for empty DOT source
Magnus Jacobsson [Fri, 16 Jul 2021 04:30:50 +0000 (06:30 +0200)]
add test of Agraph construction throwing an exception for empty DOT source

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd test of Agraph construction throwing an exception for illegal DOT source
Magnus Jacobsson [Fri, 16 Jul 2021 04:28:45 +0000 (06:28 +0200)]
add test of Agraph construction throwing an exception for illegal DOT source

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd test of Agraph construction from DOT source
Magnus Jacobsson [Sat, 3 Apr 2021 22:24:40 +0000 (00:24 +0200)]
add test of Agraph construction from DOT source

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoenable building the C++ API in CI in Windows CMake builds
Magnus Jacobsson [Sat, 10 Jul 2021 14:09:42 +0000 (16:09 +0200)]
enable building the C++ API in CI in Windows CMake builds

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoenable building the C++ API in CI in macOS CMake builds
Magnus Jacobsson [Sat, 10 Jul 2021 14:09:14 +0000 (16:09 +0200)]
enable building the C++ API in CI in macOS CMake builds

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoenable building the C++ API in CI in Ubuntu 21.04 CMake builds
Magnus Jacobsson [Mon, 5 Jul 2021 11:59:36 +0000 (13:59 +0200)]
enable building the C++ API in CI in Ubuntu 21.04 CMake builds

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agoadd a new cgraph++ library with a very basic AGraph C++ class
Magnus Jacobsson [Sat, 3 Apr 2021 22:24:40 +0000 (00:24 +0200)]
add a new cgraph++ library with a very basic AGraph C++ class

The AGraph class is an RAII-class that handles the lifetime of the
underlying Agraph_t C data structure. It currently supports
construction from DOT source, move construction and move assignment,
but not copy construction or copy assignment since the underlying C
data structure cannot be easily copied. It also supports retrieving a
non-owning pointer to the underlying Agraph_t.

The new C++ API is optional and can be enabled with the CMake option
"with_cxx_api".

Towards https://gitlab.com/graphviz/graphviz/-/issues/2001.

3 years agorun ctest before installing packages in CI
Magnus Jacobsson [Thu, 22 Jul 2021 20:04:25 +0000 (22:04 +0200)]
run ctest before installing packages in CI

This ensures that ctest can only use libraries, headers and
executables from the locations where they are built, i.e., before they
are copied to the intallation directory by cpack. This change should
have no impact, but is made to avoid doubt of which files are used in
ctest.

3 years agoadd JUnit test reports from C++ tests to artifacts
Magnus Jacobsson [Sat, 3 Jul 2021 19:33:38 +0000 (21:33 +0200)]
add JUnit test reports from C++ tests to artifacts

This commit should really have been part of
https://gitlab.com/graphviz/graphviz/-/merge_requests/2035, but it was
accidentally left out.

3 years ago[nfc] add dependency to the gvc library for all tests
Magnus Jacobsson [Thu, 15 Jul 2021 16:29:50 +0000 (18:29 +0200)]
[nfc] add dependency to the gvc library for all tests

The tests directly use gvc so this is correct, although it worked even
before this change since gvc was available through other libraries.

3 years agoMerge branch 'lefty-build-cleanup' into 'main'
Matthew Fernandez [Fri, 6 Aug 2021 02:20:09 +0000 (02:20 +0000)]
Merge branch 'lefty-build-cleanup' into 'main'

Simplify `lefty` building

See merge request graphviz/graphviz!2082

3 years agochangelog entry about improved Xaw/Xmu detection
Matthew Fernandez [Fri, 6 Aug 2021 01:50:23 +0000 (18:50 -0700)]
changelog entry about improved Xaw/Xmu detection

3 years agoSimplify `lefty` building
David Seifert [Sat, 31 Jul 2021 20:39:32 +0000 (22:39 +0200)]
Simplify `lefty` building

3 years agoMerge branch 'smattr/ebf3cf31-f820-4853-8bf1-b23127e213fd' into 'main'
Matthew Fernandez [Wed, 4 Aug 2021 03:31:53 +0000 (03:31 +0000)]
Merge branch 'smattr/ebf3cf31-f820-4853-8bf1-b23127e213fd' into 'main'

more sfprintf removal

See merge request graphviz/graphviz!2071

3 years agoexcast: avoid sfprintf in integer-to-string
Matthew Fernandez [Sat, 24 Jul 2021 03:15:53 +0000 (20:15 -0700)]
excast: avoid sfprintf in integer-to-string

Instead of constructing a string in the `tmp` buffer and then eventually
allocating vmalloc space to copy this into, we can simply compute the number of
bytes in advance, allocate vmalloc space, and then directly emit the output into
the vmalloc buffer. Related to #1873, #1998.

3 years agoexcast: avoid sfprintf in float-to-string
Matthew Fernandez [Sat, 24 Jul 2021 03:13:24 +0000 (20:13 -0700)]
excast: avoid sfprintf in float-to-string

Instead of constructing a string in the `tmp` buffer and then eventually
allocating vmalloc space to copy this into, we can simply compute the number of
bytes in advance, allocate vmalloc space, and then directly emit the output into
the vmalloc buffer. Related to #1873, #1998.

3 years agoexstringOf: avoid sfprintf in integer-to-string
Matthew Fernandez [Sat, 24 Jul 2021 03:00:23 +0000 (20:00 -0700)]
exstringOf: avoid sfprintf in integer-to-string

Instead of constructing a string in the `tmp` buffer and then eventually
allocating vmalloc space to copy this into, we can simply compute the number of
bytes in advance, allocate vmalloc space, and then directly emit the output into
the vmalloc buffer. Related to #1873, #1998.

3 years agoexstringOf: avoid sfprintf in float-to-string
Matthew Fernandez [Sat, 24 Jul 2021 02:31:46 +0000 (19:31 -0700)]
exstringOf: avoid sfprintf in float-to-string

Instead of constructing a string in the `tmp` buffer and then eventually
allocating vmalloc space to copy this into, we can simply compute the number of
bytes in advance, allocate vmalloc space, and then directly emit the output into
the vmalloc buffer. Related to #1873, #1998.

3 years agoeval: avoid sfprintf in integer-to-string dynamic
Matthew Fernandez [Sat, 24 Jul 2021 02:26:37 +0000 (19:26 -0700)]
eval: avoid sfprintf in integer-to-string dynamic

Instead of constructing a string in the `tmp` buffer and then eventually
allocating vmalloc space to copy this into, we can simply compute the number of
bytes in advance, allocate vmalloc space, and then directly emit the output into
the vmalloc buffer. Related to #1873, #1998.

3 years agoeval: avoid sfprintf in integer-to-string static
Matthew Fernandez [Sat, 24 Jul 2021 02:24:48 +0000 (19:24 -0700)]
eval: avoid sfprintf in integer-to-string static

Instead of constructing a string in the `tmp` buffer and then eventually
allocating vmalloc space to copy this into, we can simply compute the number of
bytes in advance, allocate vmalloc space, and then directly emit the output into
the vmalloc buffer. Related to #1873, #1998.

3 years agoeval: avoid sfprintf in float-to-string dynamic
Matthew Fernandez [Sat, 24 Jul 2021 02:13:45 +0000 (19:13 -0700)]
eval: avoid sfprintf in float-to-string dynamic

Instead of constructing a string in the `tmp` buffer and then eventually
allocating vmalloc space to copy this into, we can simply compute the number of
bytes in advance, allocate vmalloc space, and then directly emit the output into
the vmalloc buffer. Related to #1873, #1998.

3 years agoeval: avoid sfprintf in float-to-string static
Matthew Fernandez [Sat, 24 Jul 2021 02:10:40 +0000 (19:10 -0700)]
eval: avoid sfprintf in float-to-string static

Instead of constructing a string in the `tmp` buffer and then eventually
allocating vmalloc space to copy this into, we can simply compute the number of
bytes in advance, allocate vmalloc space, and then directly emit the output into
the vmalloc buffer. Related to #1873, #1998.