diff options
Diffstat (limited to 'clients/test')
| -rw-r--r-- | clients/test/Makefile | 38 | ||||
| -rwxr-xr-x | clients/test/run.sh | 10 | ||||
| -rw-r--r-- | clients/test/test.cpp | 41 |
3 files changed, 89 insertions, 0 deletions
diff --git a/clients/test/Makefile b/clients/test/Makefile new file mode 100644 index 0000000..7ceb0f0 --- /dev/null +++ b/clients/test/Makefile @@ -0,0 +1,38 @@ +CC := $(CROSS_COMPILE)gcc +CXX := $(CROSS_COMPILE)g++ +LD := $(CROSS_COMPILE)g++ + +DISTRIO_BASE = ../../ + +DISTRIO_MANAGER := $(DISTRIO_BASE)manager/lib +DISTRIO_IO := $(DISTRIO_BASE)io/lib +DISTRIO_COMMON := $(DISTRIO_BASE)common + +LDFLAGS += -L$(DISTRIO_COMMON) -ldistrio_common \ + -L$(DISTRIO_IO) -ldistrio_io \ + -L$(DISTRIO_MANAGER) -ldistrio_manager \ + -lrt -lACE -lTAO -lTAO_AnyTypeCode -lTAO_CosNaming -lTAO_PortableServer +CFLAGS += -g -fPIC -I$(DISTRIO_COMMON) -I$(DISTRIO_IO) -I$(DISTRIO_MANAGER) +CXXFLAGS += $(CFLAGS) + +DESTDIR := /usr + +COMPONENT = distrio_test +EXEC = $(COMPONENT) +OBJ = test.o + +all: $(OBJ) + $(LD) $(LDFLAGS) -o $(EXEC) $(OBJ) + +clean: + rm -f *.o + rm -f $(EXEC) + +install: all + cp -a $(EXEC) $(DESTDIR)/bin + +uninstall: + rm -f $(DESTDIR)/bin/$(EXEC) + +idl: + /bin/true diff --git a/clients/test/run.sh b/clients/test/run.sh new file mode 100755 index 0000000..05a8234 --- /dev/null +++ b/clients/test/run.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# +# startup script for distrio test +# +# author: Manuel Traut <manut@mecka.net> + +LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../../io/lib:../../common:../../manager/lib \ + ./distrio_test \ + -ORBInitRef NameService=corbaloc:iiop:localhost:12345/NameService \ + $@ diff --git a/clients/test/test.cpp b/clients/test/test.cpp new file mode 100644 index 0000000..5758d55 --- /dev/null +++ b/clients/test/test.cpp @@ -0,0 +1,41 @@ +#include <distrio_helper.h> +#include <distrio_error.h> + +#include <distrio_io.h> + +#include <iostream> + +ACE_TMAIN (int argc, ACE_TCHAR *argv[]) +{ + int ret = 0; + Distrio::Device_list_var devs; + Distrio::Device *dev; + Distrio::Dev_function_list_var funcs; + ::CORBA::String_var name; + + if (init_corba (argc, argv)) + return -EINVAL; + + if (run_orb ()) + return -EINVAL; + + get_device_list (&devs); + if (lookup_device ("simple_dev", devs, &dev)) { + std::cerr << "unable to get requested device" << std::endl; + goto out; + } + + /* TODO: do sth */ + dev->functions(funcs.out ()); + + for (unsigned int i = 0; i < funcs->length (); i++) + { + std::cout << funcs[i].description << std::endl; + } + + join_orb (); + +out: + free (dev); + return ret; +} |
