summaryrefslogtreecommitdiff
path: root/CIAO/bin
diff options
context:
space:
mode:
Diffstat (limited to 'CIAO/bin')
-rw-r--r--CIAO/bin/PerlCIAO/TestUtils.base3
-rw-r--r--CIAO/bin/PerlCIAO/TestUtils.pm323
-rw-r--r--CIAO/bin/PerlCIAO/TestUtils_Base.pm78
-rw-r--r--CIAO/bin/PerlCIAO/generate_container.pl126
-rw-r--r--CIAO/bin/PerlCIAO/perlciao.mpc9
-rwxr-xr-xCIAO/bin/generate_component_mpc.pl263
-rwxr-xr-xCIAO/bin/msvc_cidlc.pl151
-rwxr-xr-xCIAO/bin/replace_dummy_with_dummylabel.sh10
-rwxr-xr-xCIAO/bin/valgrind_nodedaemon.py87
9 files changed, 1050 insertions, 0 deletions
diff --git a/CIAO/bin/PerlCIAO/TestUtils.base b/CIAO/bin/PerlCIAO/TestUtils.base
new file mode 100644
index 00000000000..7e68a521d2f
--- /dev/null
+++ b/CIAO/bin/PerlCIAO/TestUtils.base
@@ -0,0 +1,3 @@
+processes
+files
+wd
diff --git a/CIAO/bin/PerlCIAO/TestUtils.pm b/CIAO/bin/PerlCIAO/TestUtils.pm
new file mode 100644
index 00000000000..6cb4ca22fe7
--- /dev/null
+++ b/CIAO/bin/PerlCIAO/TestUtils.pm
@@ -0,0 +1,323 @@
+
+#------------------------------------------------------------------------
+# class: TestUtils
+# Author: Stoyan Paunov
+#
+# Description: This is a class to help us write better and more manage-
+# able test utilities. Usually when creating a test in
+# CIAO it has to do with deploying a number of managers
+# and failure to deploy any process means failure of the
+# test. This test utility class takes care of the error
+# handling and clean-up and side of testing and allows
+# the test writer to concentrate on the core logic.
+# These are the main advantages of the TestUtils class:
+# --> Semi-Automatic error handling
+# --> Automatic process shutdown and clean-up
+# --> Semi-Automatic file (IOR) deletion
+# --> Location independent tests
+# --> Clean and concise code base
+# --> Manageable test utility suites
+#------------------------------------------------------------------------
+
+# class TestUtils
+sub new;
+sub DESTROY;
+sub cleanup;
+sub goto_dir;
+sub spawn;
+sub terminate;
+sub required_file;
+sub required_files;
+sub mark_file;
+sub mark_files;
+sub remove_file;
+sub remove_files;
+sub cleanup_files;
+sub cleanup_processes;
+
+package TestUtils;
+use PerlCIAO::TestUtils_Base;
+use strict;
+our @ISA = qw(TestUtils_Base); # inherits from TestUtils_Base
+
+use lib "$ENV{'ACE_ROOT'}/bin";
+use PerlACE::Run_Test;
+use Cwd;
+
+#------------------------------------------------------------------------
+# Constructor
+#------------------------------------------------------------------------
+sub new {
+ my $class = shift;
+
+ #call the constructor of the parent class, TestUtils_Base.
+ my $self = $class->SUPER::new();
+
+ $self->{_wd} = getcwd;
+
+ bless $self, $class;
+ return $self;
+}
+
+#------------------------------------------------------------------------
+# Destructor: performs clean-up
+#------------------------------------------------------------------------
+
+sub DESTROY {
+ my $self = shift;
+
+ #$self->cleanup (); check the CLEAN-UP description for explanation
+}
+
+#------------------------------------------------------------------------
+# Cleanup: This fuction kills the spawned processes and deletes the
+# marked files. Optionally, once the cleanup is done it will
+# cause the program to exit, iff an exit code is specified.
+#
+#
+# NOTE: You need to call the cleanup () although it is called
+# in the destructor because this class is a wrapper around
+# PerlACE::Run_Test which also keep some internal state
+# and tries to do some clean-up. However its destructor
+# is called before this one, and this results in some
+# errors.
+#------------------------------------------------------------------------
+
+sub cleanup {
+ my $self = shift;
+ my $exit_code = shift;
+
+ print "Performing clean-up ...\n";
+
+ $self->cleanup_files ();
+ $self->cleanup_processes ();
+
+ print "Cleanup = DONE\n";
+
+ chdir $self->wd ();
+
+ if (defined ($exit_code)) {
+ exit ($exit_code);
+ }
+}
+
+#------------------------------------------------------------------------
+# Goto_dir: This function allows you to change the current working
+# directory. Note that the class returns to the original
+# working directory upon exit.
+#------------------------------------------------------------------------
+
+#TODO: might want to push the dir to some stack
+sub goto_dir {
+ my $self = shift;
+ my $dir = shift;
+
+ if (! (chdir $dir)) {
+ print STDERR "Failed to change directory to: $dir";
+ $self->cleanup ();
+ }
+
+}
+
+#------------------------------------------------------------------------
+# Spawn: This function is used to spawn a process. It takes a descriptive
+# name under which it stores the process, the command line and the
+# arguments needed by the command. Optionally, you could specify
+# a timeout based on which the process would be spawned and if
+# it has not terminated after timeout seconds it will be killed.
+# If a failure occurs the function will perform clean-up and
+# terminate the program.
+#------------------------------------------------------------------------
+
+sub spawn {
+ my $self = shift;
+ my $name = shift;
+ my $cmd = shift;
+ my $args = shift;
+ my $timeout = shift;
+
+ if (!defined ($self->processes ())) {
+ $self->{_processes} = {};
+ }
+
+ my $process = new PerlACE::Process ($cmd, $args);
+
+ if (defined ($timeout)) {
+ if ((my $ret = $process->SpawnWaitKill ($timeout)) == -1) {
+ print STDERR "ERROR: Process $name returned $ret.\n";
+ $self->cleanup (1);
+ }
+ }
+ else {
+ if ($process->Spawn () == -1) {
+ $process->Kill ();
+ #just in case, lets add it to the process list
+ $self->processes->{$name} = $process;
+ print STDERR "ERROR: Failure to spawn $name.\n";
+ $self->cleanup (1);
+ }
+ }
+
+ $self->processes->{$name} = $process;
+ return $process;
+}
+
+#------------------------------------------------------------------------
+# Terminate: This function takes in the descriptive process name passed
+# to Spawn, looks up the process corresponding to it and
+# kills it.
+#------------------------------------------------------------------------
+
+sub terminate {
+ my $self = shift;
+ my $pname = shift;
+
+ $self->processes ()->{$pname}->Kill ();
+ $self->processes ()->{$pname}->TimedWait (1);
+
+ print STDERR "$pname teminated!\n";
+}
+
+#------------------------------------------------------------------------
+# Required_file: This function checks if a required file is present in
+# the current working directory. If the file is missing
+# it performs cleanup and causes the program to exit.
+#------------------------------------------------------------------------
+
+sub required_file {
+ my $self = shift;
+ my $file = shift;
+
+ if (PerlACE::waitforfile_timed
+ ($file, $PerlACE::wait_interval_for_process_creation) == -1) {
+
+ print STDERR
+ "ERROR: Required file $file could not be found.\n";
+
+ $self->cleanup (1);
+ }
+ return 1;
+}
+
+#------------------------------------------------------------------------
+# Required_filez: This function does the same as required_file above
+# except that it works on a reference (REF) to a list
+# of required files.
+#------------------------------------------------------------------------
+
+sub required_files {
+ my $self = shift;
+ my $files = shift;
+ my $pname = shift;
+
+ foreach my $file (@{$files}) {
+
+ if (PerlACE::waitforfile_timed
+ ($file, $PerlACE::wait_interval_for_process_creation) == -1) {
+
+ print STDERR
+ "ERROR: Required file $file could not be found.\n";
+
+ $self->cleanup (1);
+ }
+ }
+ return 1;
+}
+
+#------------------------------------------------------------------------
+# Mark_file: This function marks a file from the current working
+# directory for deletion. Once the file is marked it will be
+# deleted upon program termination. If the file cannot be
+# found, it is ignored.
+#------------------------------------------------------------------------
+
+sub mark_file {
+ my $self = shift;
+ my $file = shift;
+
+ if (!defined $self->files ()) {
+ $self->{_files} = [];
+ }
+
+ push @{$self->files ()}, $file;
+}
+
+#------------------------------------------------------------------------
+# Mark_filez: This function does the same as mark_file above except
+# that it works on a reference (REF) to an array/list of
+# required files.
+#------------------------------------------------------------------------
+
+sub mark_files {
+ my $self = shift;
+ my $files = shift;
+
+ if (!defined $self->files ()) {
+ $self->{_files} = [];
+ }
+
+ foreach my $file (@{$files}) {
+ push @{$self->files ()}, $file;
+ }
+}
+
+#------------------------------------------------------------------------
+# Remove_file: This fuction removes a file from the current working
+# directory. If the file is not there, it is ignored.
+#------------------------------------------------------------------------
+
+sub remove_file {
+ my $self = shift;
+ my $file = shift;
+
+ my $path = PerlACE::LocalFile ($file);
+ unlink $path;
+}
+
+#------------------------------------------------------------------------
+# Remove_filez: This fuction removes a list of file from the current
+# working directory. It takes a REF of a list of files
+# and ignores files which are not found.
+#------------------------------------------------------------------------
+
+sub remove_files {
+ my $self = shift;
+ my $files = shift;
+
+ foreach my $file (@{$files}) {
+ my $path = PerlACE::LocalFile ($file);
+ unlink $path;
+ }
+}
+
+#------------------------------------------------------------------------
+# Cleanup_files: clean us the files :)
+#------------------------------------------------------------------------
+
+sub cleanup_files {
+ my $self = shift;
+
+ if (defined ($self->files ())) {
+ foreach my $file (@{$self->files ()}) {
+ $self->remove_file ($file);
+ }
+ }
+}
+
+#------------------------------------------------------------------------
+# Cleanup_processes: clean us the processes :)
+#------------------------------------------------------------------------
+
+sub cleanup_processes {
+ my $self = shift;
+
+ if (defined ($self->processes ())) {
+ foreach my $pname ( keys %{$self->processes ()}) {
+ $self->terminate ($pname);
+ delete ($self->processes ()->{$pname});
+ }
+ }
+}
+
+#return value of the class
+1; \ No newline at end of file
diff --git a/CIAO/bin/PerlCIAO/TestUtils_Base.pm b/CIAO/bin/PerlCIAO/TestUtils_Base.pm
new file mode 100644
index 00000000000..be0726946c9
--- /dev/null
+++ b/CIAO/bin/PerlCIAO/TestUtils_Base.pm
@@ -0,0 +1,78 @@
+#File generated by C:\ACE_wrappers_devel\ACE_wrappers\TAO\CIAO\bin\PerlCIAO\generate_container.pl.
+#Input file: TestUtils.base.
+#Code generator author: Stoyan Paunov
+#
+
+#class TestUtils_Base
+package TestUtils_Base;
+use strict;
+
+#Class constructor :)
+sub new {
+ my ($class) = @_;
+
+ #Create a reference to an anonymous hash
+ my $self = {
+ _processes => undef,
+ _files => undef,
+ _wd => undef
+ };
+
+ #Bless the hash.
+ bless $self, $class;
+ return $self;
+}
+
+#accessor/mutator method for processes
+sub processes {
+ my ( $self, $processes ) = @_;
+
+ $self->{_processes} = $processes
+ if defined ($processes);
+
+ return $self->{_processes};
+}
+
+#accessor/mutator method for files
+sub files {
+ my ( $self, $files ) = @_;
+
+ $self->{_files} = $files
+ if defined ($files);
+
+ return $self->{_files};
+}
+
+#accessor/mutator method for wd
+sub wd {
+ my ( $self, $wd ) = @_;
+
+ $self->{_wd} = $wd
+ if defined ($wd);
+
+ return $self->{_wd};
+}
+
+#print method for the class
+sub print {
+ my ($self) = @_;
+
+ my $f;
+
+ $f = defined ($self->{_processes})
+ ? $self->{_processes} : "not defined";
+ printf ("processes: %s\n", $f);
+
+ $f = defined ($self->{_files})
+ ? $self->{_files} : "not defined";
+ printf ("files: %s\n", $f);
+
+ $f = defined ($self->{_wd})
+ ? $self->{_wd} : "not defined";
+ printf ("wd: %s\n", $f);
+
+}
+
+#class return value
+1;
+
diff --git a/CIAO/bin/PerlCIAO/generate_container.pl b/CIAO/bin/PerlCIAO/generate_container.pl
new file mode 100644
index 00000000000..c56c03ea300
--- /dev/null
+++ b/CIAO/bin/PerlCIAO/generate_container.pl
@@ -0,0 +1,126 @@
+#!/usr/bin/perl
+#
+# $Id$
+#
+# The above line is for compatibility /w Linux. Windows uses the .pl extension.
+# Author: Stoyan Paunov
+# Purpose: Generate a container class with mutator/accessor methods
+# The idea is to use this class as a base class in the
+# inheritance hierarchy. This way we can evolve the base
+# container independently from the rest of the code!
+#
+
+use strict;
+
+die "Usage: $0 <module name> <field description file>\n"
+ if not defined $ARGV[0];
+
+die "Usage: $0 <module name> <field description file>\n"
+ if not defined $ARGV[1];
+
+my $module_name = $ARGV[0];
+my $fields = $ARGV[1];
+
+open (FIELDS, $fields) or die "Failed opening $fields\n";
+
+my @fields = <FIELDS>;
+close FIELDS;
+
+my $field;
+
+print "\#File generated by $0.\n";
+print "\#Input file: $fields.\n";
+print "\#Code generator author: Stoyan Paunov\n\#\n\n";
+
+print "\#class $module_name\n";
+print "package $module_name;\n";
+print "use strict;\n\n";
+print "\#Class constructor :)\n";
+print "sub new {\n";
+print " my (\$class) = \@_;\n\n";
+print " \#Create a reference to an anonymous hash\n";
+print " my \$self = {\n";
+
+my $count = 0;
+my $end = $#fields;
+
+#generate initialization code
+foreach $field (@fields)
+{
+ if ($field =~ /^$/ ) # empty line
+ {
+ next;
+ }
+
+ chomp ($field);
+
+ if ($count == $end)
+ {
+ printf (" _\%-14s => undef\n", $field);
+ next;
+ }
+ printf (" _\%-14s => undef,\n", $field);
+
+
+ $count++
+}
+
+print " };\n\n";
+print " \#Bless the hash.\n";
+print " bless \$self, \$class;\n";
+print " return \$self;\n";
+print "}\n\n";
+
+#Code to generate the accessor and mutator
+
+foreach $field (@fields)
+{
+ if ($field =~ /^$/ ) # empty line
+ {
+ next;
+ }
+
+ chomp ($field);
+
+ print "\#accessor/mutator method for $field\n";
+ print "sub $field {\n";
+ print " my ( \$self, \$$field ) = \@_;\n\n";
+ print " \$self->{_$field} = \$$field\n";
+ print " if defined (\$$field);\n\n";
+ print " return \$self->{_$field};\n";
+ print "}\n\n";
+
+}
+
+
+print "\#print method for the class\n";
+print "sub print {\n";
+print " my (\$self) = \@_;\n\n";
+
+print " my \$f;\n\n";
+
+#Code to generate a print method which dumps the object state
+foreach $field (@fields)
+{
+ if ($field =~ /^$/ ) # empty line
+ {
+ next;
+ }
+
+ chomp ($field);
+ print " \$f = defined (\$self->{_$field}) \n";
+ print " ? \$self->{_$field} : \"not defined\";\n";
+ print " printf (\"$field: %s\\n\", \$f);\n\n";
+
+}
+
+
+
+print "}\n\n";
+
+print "\#class return value \n1;\n\n";
+
+
+
+
+
diff --git a/CIAO/bin/PerlCIAO/perlciao.mpc b/CIAO/bin/PerlCIAO/perlciao.mpc
new file mode 100644
index 00000000000..f596034eab3
--- /dev/null
+++ b/CIAO/bin/PerlCIAO/perlciao.mpc
@@ -0,0 +1,9 @@
+
+// $Id$
+
+project(PerlCIAO) : script {
+ Script_Files {
+ TestUtils.pm
+ TestUtils_Base.pm
+ }
+}
diff --git a/CIAO/bin/generate_component_mpc.pl b/CIAO/bin/generate_component_mpc.pl
new file mode 100755
index 00000000000..f4a6ec7246b
--- /dev/null
+++ b/CIAO/bin/generate_component_mpc.pl
@@ -0,0 +1,263 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# Create a MPC file content for a single component implementation.
+
+use Getopt::Std;
+
+##############################################################################
+# Grab the options
+
+$flags = join (" ", @ARGV);
+
+if (!getopts ('decnip:l:u:h') || $opt_h) {
+ print "generate_component_mpc.pl [-d] [-h] component_name\n";
+ print "\n";
+ print " -d Turn on debug mode\n";
+ print " -e Eventtype declaration in IDL\n";
+ print " -p Dependent component name\n";
+ print " -l Dependent component path\n";
+ print " -i Use an executor definition IDL file\n";
+ print " -n Suppress component make/project\n";
+ print " -c Create a client makefile\n";
+ print " -u Unique project name prefix (if not defined, name for -p flag will be used. \n";
+ print "\n";
+ print "generate_component_mpc creates and save a minimum mpc file\n";
+ print "called $com_name.mpc that is needed for a single component implementation\n";
+ exit (1);
+}
+
+if (defined $opt_d) {
+ print "Debugging Turned on\n";
+
+ if (defined $opt_f) {
+ print "Dependency to $opt_f\n";
+ }
+}
+
+if ($#ARGV < 0) {
+ print STDERR "No component_name specified, use -h for help\n";
+ exit (1);
+}
+
+$com_name = shift @ARGV;
+$UCOM_NAME = uc $com_name;
+
+##############################################################################
+# Prologue
+
+if (defined $opt_n) {
+ $svr_suffix = "_skel";
+}
+else {
+ $svr_suffix = "_svnt";
+}
+
+$USVR_SUFFIX = uc $svr_suffix;
+
+if (defined $opt_p) {
+ $stub_depend = "after += $opt_p".'_stub';
+ $svnt_depend = "$opt_p".'_skel';
+ $lib_depend = "$opt_p".'_stub '."$opt_p".'_skel';
+ $client_depend = "$com_name".'_stub '."$opt_p"."_stub";
+}
+else {
+ $client_depend = "$com_name".'_stub';
+}
+
+$unique_prefix = "";
+
+if (defined $opt_u) {
+ $unique_prefix = "$opt_u" . "_";
+}
+elsif (defined $opt_p) {
+ $unique_prefix = "$opt_p" . "_";
+}
+
+if (defined $opt_l) {
+ $lib_paths = "libpaths += $opt_l";
+}
+
+if (defined $opt_c) {
+ $client_def =
+'
+project ('."$unique_prefix"."$com_name".'_client) : ciao_client_dnc {
+ exename = client
+ after += '."$client_depend
+ $lib_paths".'
+
+ IDL_Files {
+ }
+
+ Source_Files {
+ client.cpp
+ }
+}
+';
+}
+
+if (defined $opt_i) {
+ $exec_impl_idl = "$com_name".'EI.idl';
+ $exec_impl_cpp = "$com_name".'EIC.cpp';
+ $exec_idlflags =
+'
+ idlflags += -SS -St \
+ -Wb,export_macro='."$UCOM_NAME".'_EXEC_Export \
+ -Wb,export_include='."$com_name".'_exec_export.h
+';
+}
+
+
+if (! defined $opt_n) {
+ $component_def =
+'
+project('."$unique_prefix"."$com_name".'_exec) : ciao_component_dnc {
+ after += '."$unique_prefix"."$com_name"."$svr_suffix".'
+ sharedname = '."$com_name".'_exec
+ libs += '."$com_name".'_stub '."$com_name"."$svr_suffix $lib_depend
+ $lib_paths $exec_idlflags".'
+ dynamicflags = '."$UCOM_NAME".'_EXEC_BUILD_DLL
+
+ IDL_Files {'."
+ $exec_impl_idl".'
+ }
+
+ Source_Files {'."
+ $exec_impl_cpp
+ $com_name".'_exec.cpp
+ }
+}
+';
+}
+
+$no_skel = "-SS";
+$no_anys = "-St";
+$no_tie = "idlflags -= -GT";
+
+if (defined $opt_e) {
+ $no_anys = "";
+
+ if (defined $opt_n) {
+ $no_tie = "";
+ }
+}
+
+$cli_idlflags ='
+ '."$no_tie".'
+ idlflags += '."$no_anys".' \
+ -Wb,stub_export_macro='."$UCOM_NAME".'_STUB_Export \
+ -Wb,stub_export_include='."$com_name".'_stub_export.h \
+ -Wb,skel_export_macro='."$UCOM_NAME"."$USVR_SUFFIX".'_Export \
+ -Wb,skel_export_include='."$com_name"."$svr_suffix".'_export.h
+';
+
+$cli_base = "ciao_client_dnc";
+$svr_base = "ciao_servant_dnc";
+
+if (defined $opt_n) {
+ $svr_idlflags = $cli_idlflags;
+ $svr_idl = "$com_name".'.idl';
+
+ $svr_src =
+'
+ '."$com_name".'S.cpp
+';
+
+ if (! defined $opt_e) {
+ $cli_base = "taolib_with_idl";
+ $svr_base = "portableserver";
+ }
+}
+else {
+ $svr_idlflags ='
+ '."$no_tie".'
+ idlflags += '."$no_anys"." $no_skel".' \
+ -Wb,export_macro='."$UCOM_NAME"."$USVR_SUFFIX".'_Export \
+ -Wb,export_include='."$com_name"."$svr_suffix".'_export.h
+';
+
+ $cidl_block =
+'
+ CIDL_Files {
+ '."$com_name".'.cidl
+ }
+';
+
+ $svr_idl = "$com_name".'E.idl';
+
+ $svr_src =
+'
+ '."$com_name".'EC.cpp
+ '."$com_name".'S.cpp
+ '."$com_name".'_svnt.cpp
+';
+}
+
+
+
+$mpc_template = '// $Id$
+// This file is generated with "'."generate_component_mpc.pl $flags".'"
+
+project('."$unique_prefix"."$com_name".'_stub): '."$cli_base".' {'."
+ $stub_depend".'
+ sharedname = '."$com_name".'_stub
+ '."$cli_idlflags".'
+ dynamicflags = '."$UCOM_NAME".'_STUB_BUILD_DLL
+
+ IDL_Files {
+ '."$com_name".'.idl
+ }
+
+ Source_Files {
+ '."$com_name".'C.cpp
+ }
+}
+
+project('."$unique_prefix"."$com_name"."$svr_suffix".') : '."$svr_base".' {
+ after += '."$svnt_depend "."$unique_prefix"."$com_name".'_stub
+ sharedname = '."$com_name"."$svr_suffix".'
+ libs += '."$com_name".'_stub'." $lib_depend
+ $lib_paths $svr_idlflags".'
+ dynamicflags = '."$UCOM_NAME"."$USVR_SUFFIX".'_BUILD_DLL
+ '."$cidl_block".'
+ IDL_Files {
+ '."$svr_idl".'
+ }
+
+ Source_Files {'."$svr_src".' }
+}
+'."$component_def
+
+$client_def
+";
+
+##############################################################################
+# Static Stuff
+
+##############################################################################
+# Print the stuff out
+
+
+# MPC files
+open (MPCFILE, ">", "$com_name".".mpc");
+print MPCFILE $mpc_template;
+
+$ACE_ROOT= "$ENV{'ACE_ROOT'}";
+
+print "The following commands have been executed:\n\n";
+
+$command = "generate_export_file.pl $UCOM_NAME".'_STUB > '."$com_name".'_stub_export.h';
+print "\t$command"."\n";
+system ("$ACE_ROOT".'/bin/'."$command");
+
+$command = "generate_export_file.pl $UCOM_NAME"."$USVR_SUFFIX".' > '."$com_name"."$svr_suffix".'_export.h';
+print "\t$command"."\n";
+system ("$ACE_ROOT".'/bin/'."$command");
+
+if (! defined $opt_n) {
+ $command = "generate_export_file.pl $UCOM_NAME".'_EXEC > '."$com_name".'_exec_export.h';
+ print "\t$command"."\n";
+ system ("$ACE_ROOT".'/bin/'."$command");
+}
diff --git a/CIAO/bin/msvc_cidlc.pl b/CIAO/bin/msvc_cidlc.pl
new file mode 100755
index 00000000000..3d7283b3385
--- /dev/null
+++ b/CIAO/bin/msvc_cidlc.pl
@@ -0,0 +1,151 @@
+# $Id$
+# Win32 auto_compile script.
+if (!$ENV{CIAO_ROOT}) {
+ $CIAO_ROOT = getcwd ()."TAO\CIAO\\";
+ warn "CIAO_ROOT not defined, defaulting to CIAO_ROOT=$CIAO_ROOT";
+}
+else {
+ $ACE_ROOT = $ENV{ACE_ROOT};
+ $CIAO_ROOT = $ENV{CIAO_ROOT};
+}
+
+use lib "$ENV{ACE_ROOT}/bin";
+
+use File::Find;
+use PerlACE::Run_Test;
+use Cwd;
+
+@directories = ();
+
+$debug = 0;
+$verbose = 0;
+$print_status = 0;
+$Ignore_errors = 0; # By default, bail out if an error occurs.
+$Build_All = 1;
+$Build_Cmd = "/BUILD";
+$use_custom_dir = 0;
+$useenv = '';
+$vc7 = 0;
+$Build_Debug = 1;
+
+# Build
+sub Build ($$)
+{
+ my ($project, $config) = @_;
+
+ if ($debug == 1) {
+ print "$project\n";
+ return 0;
+ }
+ else {
+ print "Auto_compiling $project : $config\n";
+
+ print "Building $project $config\n" if $verbose;
+
+ return system ("msdev.com $project /MAKE \"$config\" $Build_Cmd $useenv");
+ }
+}
+
+# Build
+sub Build_VC7 ($$)
+{
+ my ($project, $config) = @_;
+
+ if ($debug == 1) {
+ print "$project\n";
+ return 0;
+ }
+ else {
+ print "Auto_compiling $project : $config\n";
+
+ print "Building $project $config\n" if $verbose;
+
+ return system ("devenv.com $project $Build_Cmd $config $useenv");
+ }
+}
+
+
+
+sub Find_Sln (@)
+{
+ my (@dir) = @_;
+ @array = ();
+
+ sub wanted_sln {
+ $array[++$#array] =
+ $File::Find::name if ($File::Find::name =~ /\.sln$/i);
+ }
+
+ find (\&wanted_sln, @dir);
+
+ print "List of sln's \n" if ($verbose == 1);
+ return @array;
+}
+
+sub Build_All ()
+{
+ my @configurations = Find_Sln (@directories);
+
+ print STDERR "Building selected projects\n" if ($print_status == 1);
+ print "\nmsvc_cidlc: Building selected projects\n";
+
+ $count = 0;
+ foreach $c (@configurations) {
+ print STDERR "Configuration ".$count++." of ".$#configurations."\n" if ($print_status == 1);
+ if ($Build_Debug) {
+ $Status = Build_VC7 ($c, "debug");
+ return if $Status != 0 && !$Ignore_errors;
+ }
+ }
+ print STDERR "ERROR: No configurations have been build\n" if ($count == 0);
+}
+
+
+## Parse command line argument
+while ( $#ARGV >= 0 && $ARGV[0] =~ /^(-|\/)/ )
+{
+ if ($ARGV[0] =~ '-vc7') { # Use VC7 project and solution files.
+ print "Using VC7 files\n" if ( $verbose );
+ $vc7 = 1;
+ $proj_ext = '.vcproj';
+ }
+ elsif ($ARGV[0] =~ '-vc8') { # Use VC8 project and solution files.
+ print "Using VC8 files\n" if ( $verbose );
+ $vc7 = 1; # VC8 is like VC7
+ $proj_ext = '.vcproj';
+ }
+ elsif ($ARGV[0] =~ '-v') { # verbose mode
+ $verbose = 1;
+ }
+ elsif ($ARGV[0] =~ '-s') { # status messages
+ $print_status = 1;
+ }
+ elsif ($ARGV[0] =~ '-clean') { # Clean
+ print "Cleaning all\n" if ( $verbose );
+ $Build_Cmd = "/CLEAN";
+ }
+ elsif ($ARGV[0] =~ '-(\?|h)') { # Help information
+ print "Options\n";
+ print "-vc7 = Use MSVC 7 toolset\n";
+ print "-vc8 = Use MSVC 8 toolset\n";
+ print "-clean = Clean\n";
+ exit;
+ }
+ else {
+ warn "$0: unknown option $ARGV[0]\n";
+ die -1;
+ }
+ shift;
+}
+
+if ($#directories < 0) {
+ print "Using VC7 files\n" if ( $verbose );
+ push @directories, ("$CIAO_ROOT\\CIDLC");
+}
+
+print "msvc_cidlc: Begin\n";
+print STDERR "Beginning CIDLC Build\n" if ($print_status == 1);
+Build_All ();
+
+print "msvc_cidlc: End\n";
+print STDERR "End\n" if ($print_status == 1);
diff --git a/CIAO/bin/replace_dummy_with_dummylabel.sh b/CIAO/bin/replace_dummy_with_dummylabel.sh
new file mode 100755
index 00000000000..3f699576154
--- /dev/null
+++ b/CIAO/bin/replace_dummy_with_dummylabel.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+find . -name "*.mpc" > mpc_files
+for i in `cat mpc_files`
+do
+ sed -e 's/requires += dummy$/requires += dummy_label/g' $i > tmp
+ cat tmp > $i
+done
+
+rm -f mpc_files
+rm -f tmp
diff --git a/CIAO/bin/valgrind_nodedaemon.py b/CIAO/bin/valgrind_nodedaemon.py
new file mode 100755
index 00000000000..a0845864370
--- /dev/null
+++ b/CIAO/bin/valgrind_nodedaemon.py
@@ -0,0 +1,87 @@
+#!/usr/bin/python
+# $Id$
+#
+# Runs a NodeManager (optionally) under valgrind with the NodeApplication (optionally) under valgrind.
+
+from optparse import OptionParser
+from os import system
+from os import environ
+
+def parse_args ():
+
+ parser = OptionParser (usage="usage: valgrind_nodemanager [options] <port_number>")
+
+ parser.add_option ("-v", "--verbose", dest="verbose", action="store_true",
+ help="Output the command that is to be executed.",
+ default=False)
+ parser.add_option ("-l","--log", dest="log_file", action="store",
+ help="Log all output to a given file.",
+ default="")
+ parser.add_option ("-t", "--tool", dest="valgrind_tool", action="store",
+ help="Specify the valgrind tool to run",
+ default="memcheck")
+ parser.add_option ("--nm", dest="node_manager", action="store_true",
+ help="Run valgrind on the NodeManager",
+ default=False)
+ parser.add_option ("--na", dest="node_application", action="store_true",
+ help="Run valgrind on the NodeApplication",
+ default=False)
+ parser.add_option ("--valgrind_args", dest="valgrind_args", action="store",
+ help="Additional arguments to pass to valgrind",
+ default="")
+ parser.add_option ("-g", dest="gen_supp", action="store_true",
+ help="Generate suppression lines",
+ default=False)
+ parser.add_option ("-s", dest="supp_file", action="store",
+ help="Suppression file for Valgrind to use",
+ default="")
+ parser.add_option ("--lc", dest="leak_check", action="store_true",
+ help="Perform a full leak check",
+ default=False)
+
+ return parser.parse_args ()
+
+import os
+
+def main ():
+ (option, args) = parse_args ()
+
+ ciao_root = environ['CIAO_ROOT']
+
+ # Build the valgrind command
+ valgrind_command = "valgrind --tool=" + option.valgrind_tool + ' ' +\
+ option.valgrind_args + ' '
+
+ if option.gen_supp:
+ valgrind_command += "--gen-suppressions=all "
+
+ if option.supp_file != "":
+ valgrind_command += "--suppressions=\"" + options.supp_file + '" '
+
+ if option.leak_check:
+ valgrind_command += "--leak-check=full "
+
+ # Build the actual command
+ command = ""
+
+ if option.node_manager:
+ command += valgrind_command
+
+ command += ciao_root + "/DAnCE/NodeManager/NodeManager " +\
+ "-ORBEndpoint iiop://localhost:" + args[0] + ' '
+
+ if option.node_application:
+ command += "-d 60 -s\"" + valgrind_command
+ else:
+ command += " -s \""
+
+ command += ciao_root + "/DAnCE/NodeApplication/NodeApplication" + '"'
+
+ print command
+
+ system (command)
+
+if __name__ == "__main__":
+ main ()
+
+