From e47422e60ac97aed2ec8e1253d42c9e42c0e0543 Mon Sep 17 00:00:00 2001 From: ellson Date: Fri, 22 Jul 2005 03:52:13 +0000 Subject: [PATCH] playing with c# test case --- tclpkg/gv/Makefile.am | 8 ++++---- tclpkg/gv/test.cs | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 tclpkg/gv/test.cs diff --git a/tclpkg/gv/Makefile.am b/tclpkg/gv/Makefile.am index b8fab5723..6207f0fcf 100644 --- a/tclpkg/gv/Makefile.am +++ b/tclpkg/gv/Makefile.am @@ -17,7 +17,7 @@ libgv_csharp_la_SOURCES = gv.cpp gv.i libgv_csharp_la_DEPENDENCIES = gv.lo gv_csharp.lo libgv_csharp_la_LIBADD = gv_csharp.lo $(BASELIBS) @CSHARP_LIBS@ gv_csharp.cpp $(CSHARP_hdr): gv.i - $(SWIG) -c++ -csharp -o gv_csharp.cpp gv.i + $(SWIG) -c++ -csharp -namespace Gv -o gv_csharp.cpp gv.i GUILE_hdr = libgv_guile_la_SOURCES = gv.cpp gv.i @@ -151,10 +151,10 @@ test: $(TESTS) .PHONY: test_csharp test_csharp: libgv_csharp.la -(mkdir -p test_csharp; cd test_csharp; \ - ln -fs ../.libs/libgv_csharp.so libgv.so; \ + ln -fs ../.libs/libgv_csharp.so gv.so; \ ln -fs ../*.dot ../*.cs .; \ - $(CSHARP) *.cs; \ - LD_LIBRARY_PATH=. $(CSHARP) test) + $(CSHARP) *.cs -out:test.exe; \ + $(CSHARP) test.exe) .PHONY: test_guile test_guile: libgv_guile.la diff --git a/tclpkg/gv/test.cs b/tclpkg/gv/test.cs new file mode 100644 index 000000000..bf36e128b --- /dev/null +++ b/tclpkg/gv/test.cs @@ -0,0 +1,35 @@ +// test.cs + +public class test { + static void Main() { + SWIGTYPE_p_Agraph_t g, sg; + SWIGTYPE_p_Agnode_t n, m; + SWIGTYPE_p_Agedge_t e; + + g = gv.digraph("G"); + System.Console.WriteLine(gv.set(g,"aaa","xxx")); + System.Console.WriteLine(gv.set(g,"aaa")); + sg = gv.graph(g,"SG"); + n = gv.node(g,"hello"); + System.Console.WriteLine(gv.set(n,"label")); + System.Console.WriteLine(gv.set(n,"aaa","xxx")); + System.Console.WriteLine(gv.set(n,"aaa")); + m = gv.node(g,"world"); + System.Console.WriteLine(gv.set(m,"aaa")); + e = gv.edge(n,m); + System.Console.WriteLine(gv.set(e,"aaa","xxx")); + System.Console.WriteLine(gv.set(e,"aaa")); + gv.rm(e); + gv.rm(n); + gv.rm(m); + gv.rm(g); + + g = gv.stringgraph("digraph G {a->b}"); + gv.rm(g); + + g = gv.readgraph("hello.dot"); + gv.layout(g,"dot"); + gv.writegraph(g,"hello.png","png"); + gv.rm(g); + } +} -- 2.40.0