## [Unreleased (3.0.1)]
+### Changed
+
+- the `mingle` binary is now included in the CMake build
+
### Fixed
- `agcanon`, `agcanonStr`, and `agwrite` now return error values on memory
import pytest
sys.path.append(os.path.join(os.path.dirname(__file__), "../rtest"))
-from gvtest import dot, is_cmake #pylint: disable=C0413
+from gvtest import dot, is_cmake, is_mingw #pylint: disable=C0413
def _freedesktop_os_release() -> Dict[str, str]:
"""
"""
return _freedesktop_os_release().get("ID") == "centos"
+def is_win64() -> bool:
+ """
+ is the Graphviz under test targeting the x64 Windows API?
+ """
+ if platform.system() != "Windows":
+ return False
+ if os.getenv("project_platform") != "x64":
+ return False
+ return True
+
@pytest.mark.parametrize("binary", [
"acyclic",
"bcomps",
"gvmap.sh",
"gxl2dot",
"lneato",
- "mingle",
"prune",
"smyrna",
"vimdot",
# FIXME: Remove skip when
# https://gitlab.com/graphviz/graphviz/-/issues/1835 is fixed
- if os_id == "ubuntu" and binary == "mingle":
+ if os_id == "ubuntu" and binary == "mingle" and not is_cmake():
check_that_tool_does_not_exist(binary, os_id)
pytest.skip(f"mingle is not built for {os_id} (#1835)")
check_that_tool_does_not_exist(binary, os_id)
pytest.skip(f"{binary} is not built with autotools on macOS (#1854)")
+ if binary == "mingle" and is_cmake() and (is_win64() or is_mingw()):
+ check_that_tool_does_not_exist(binary, os_id)
+ pytest.skip(f"{binary} is not built on some Windows due to lacking libANN")
+
assert shutil.which(binary) is not None
def check_that_tool_does_not_exist(tool, os_id):
add_subdirectory(dot)
add_subdirectory(gvpr)
+add_subdirectory(mingle)
add_subdirectory(tools)
--- /dev/null
+if(with_sfdp AND ANN_FOUND)
+
+ add_executable(mingle
+ minglemain.cpp
+ )
+
+ target_include_directories(mingle
+ PRIVATE
+ ${GRAPHVIZ_LIB_DIR}
+ ${GRAPHVIZ_LIB_DIR}/cdt
+ ${GRAPHVIZ_LIB_DIR}/cgraph
+ ${GRAPHVIZ_LIB_DIR}/common
+ ${GETOPT_INCLUDE_DIRS}
+ )
+
+ target_link_libraries(mingle
+ cdt
+ cgraph
+ common
+ ingraphs
+ libmingle
+ neatogen
+ rbtree
+ sfdpgen
+ sparse
+ ${ANN_LIBRARIES}
+ )
+ if(NOT HAVE_GETOPT_H)
+ target_link_libraries(mingle ${GETOPT_LINK_LIBRARIES})
+ endif()
+
+ install(
+ TARGETS mingle
+ RUNTIME DESTINATION ${BINARY_INSTALL_DIR}
+ LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR}
+ ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR}
+ )
+
+ if(GZIP)
+ add_custom_target(man-mingle ALL DEPENDS mingle.1.gz
+ COMMENT "mingle man page")
+ add_custom_command(
+ OUTPUT mingle.1.gz
+ COMMAND ${GZIP} -9 --no-name --to-stdout mingle.1
+ >"${CMAKE_CURRENT_BINARY_DIR}/mingle.1.gz"
+ MAIN_DEPENDENCY mingle.1
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMENT "compress mingle man page")
+ install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/mingle.1.gz
+ DESTINATION ${MAN_INSTALL_DIR}/man1)
+ else()
+ install(
+ FILES mingle.1
+ DESTINATION ${MAN_INSTALL_DIR}/man1
+ )
+ endif()
+
+endif()
import re
import shutil
import subprocess
+import sys
import pytest
+sys.path.append(os.path.dirname(__file__))
+from gvtest import is_cmake #pylint: disable=C0413
+
@pytest.mark.parametrize("tool", [
"acyclic",
"bcomps",
environ_copy = os.environ.copy()
environ_copy.pop("DISPLAY", None)
+ # FIXME: mingle triggers ODR violations
+ if tool == "mingle":
+ if "ASAN_OPTIONS" in environ_copy:
+ environ_copy["ASAN_OPTIONS"] += ":detect_odr_violation=0"
+ else:
+ environ_copy["ASAN_OPTIONS"] = "detect_odr_violation=0"
+
# Test usage
with subprocess.Popen([tool, "-?"], env=environ_copy,
stdin=subprocess.DEVNULL, stdout=subprocess.PIPE,
output, _ = p.communicate()
ret = p.returncode
+ # FIXME: mingle built with CMake on Windows crashes
+ if tool == "mingle" and is_cmake() and platform.system() == "Windows":
+ assert ret != 0, "mingle on Windows with CMake fixed?"
+ return
+
assert ret == 0, f"`{tool} -?` failed. Output was: {output}"
assert re.match("usage", output, flags=re.IGNORECASE) is not None, \