]> granicus.if.org Git - graphviz/commitdiff
tests: define GVDLL to ensure correct storage-class attributes
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sat, 1 Jan 2022 18:15:21 +0000 (19:15 +0100)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sun, 9 Jan 2022 08:44:20 +0000 (09:44 +0100)
An upcoming commit will change the storage-class attributes to be
controlled by the GVDLL symbol in cgraph.h.

Without this change, errors like this would occur when building the
test examples:

demo.obj : error LNK2019: unresolved external symbol Agdirected referenced in function main

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

rtest/test_examples.py

index ac8bb9dad1552b9e393d86b8880795cd9f236062..5395d431aa7da0b9bfad183c7062b0c5d55a61af 100644 (file)
@@ -35,7 +35,12 @@ def test_compile_example(src):
   # run the example
   args = ["-Kneato"] if src in ["demo.c", "dot.c"] else []
 
-  ret, out, err = run_c(filepath, args, "graph {a -- b}", link=libs)
+  if platform.system() == "Windows":
+    cflags = ["-DGVDLL"]
+  else:
+    cflags = None
+
+  ret, out, err = run_c(filepath, args, "graph {a -- b}", cflags=cflags, link=libs)
 
   print(f"returncode: {ret} = 0x{ret:08x}")
   if ret != 0: