summaryrefslogtreecommitdiff
path: root/TAO/tests/Bug_1635_Regression
diff options
context:
space:
mode:
authorSimon McQueen <simon.mcqueen@gmail.com>2003-11-18 14:55:10 +0000
committerSimon McQueen <simon.mcqueen@gmail.com>2003-11-18 14:55:10 +0000
commitf3babfd74184b27b1fb63fdfe2cbc2bbd136d319 (patch)
tree5a3efe2343f5f09601d809aaca43c2eb4c1cf178 /TAO/tests/Bug_1635_Regression
parent7686ba2d5c1c5e888f6c36e3b594a05f50ab3b55 (diff)
downloadATCD-f3babfd74184b27b1fb63fdfe2cbc2bbd136d319.tar.gz
ChangeLogTag: Tue Nov 18 13:59:11 2003 Simon McQueen <sm@prismtechnologies.com>
Diffstat (limited to 'TAO/tests/Bug_1635_Regression')
-rw-r--r--TAO/tests/Bug_1635_Regression/Bug_1635_Client.dsp85
-rw-r--r--TAO/tests/Bug_1635_Regression/Bug_1635_Regression.dsw29
-rw-r--r--TAO/tests/Bug_1635_Regression/Bug_1635_Regression.mpc7
-rw-r--r--TAO/tests/Bug_1635_Regression/Makefile19
-rw-r--r--TAO/tests/Bug_1635_Regression/Makefile.Bug_1635_Client89
-rw-r--r--TAO/tests/Bug_1635_Regression/README7
-rw-r--r--TAO/tests/Bug_1635_Regression/client.cpp26
-rwxr-xr-xTAO/tests/Bug_1635_Regression/run_test.pl78
8 files changed, 340 insertions, 0 deletions
diff --git a/TAO/tests/Bug_1635_Regression/Bug_1635_Client.dsp b/TAO/tests/Bug_1635_Regression/Bug_1635_Client.dsp
new file mode 100644
index 00000000000..be8e948fdee
--- /dev/null
+++ b/TAO/tests/Bug_1635_Regression/Bug_1635_Client.dsp
@@ -0,0 +1,85 @@
+# Microsoft Developer Studio Project File - Name="Bug_1635_Client" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=Bug_1635_Client - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE run the tool that generated this project file and specify the
+!MESSAGE nmake output type. You can then use the following command:
+!MESSAGE
+!MESSAGE NMAKE /f "Bug_1635_Client.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "Bug_1635_Client.mak" CFG="Bug_1635_Client - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Bug_1635_Client - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Bug_1635_Client - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Bug_1635_Client - Win32 Release"
+
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release\Bug_1635_Client"
+# PROP Target_Dir ""
+# ADD CPP /nologo /O2 /W3 /GX /MD /GR /I "..\.." /I "..\..\tao" /I "..\..\.." /D NDEBUG /D WIN32 /D _CONSOLE /FD /c
+# SUBTRACT CPP /YX
+# ADD RSC /l 0x409 /d NDEBUG /i "..\.." /i "..\..\tao" /i "..\..\.."
+BSC32=bscmake.exe
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD LINK32 advapi32.lib user32.lib /INCREMENTAL:NO TAO.lib ACE.lib /libpath:"..\..\tao" /libpath:"..\..\..\ace" /libpath:"..\..\..\lib" /nologo /version:1.3.5 /subsystem:console /pdb:"Release\client.pdb" /machine:I386 /out:"Release\client.exe"
+
+!ELSEIF "$(CFG)" == "Bug_1635_Client - Win32 Debug"
+
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "."
+# PROP Intermediate_Dir "Debug\Bug_1635_Client"
+# PROP Target_Dir ""
+# ADD CPP /nologo /Ob0 /W3 /Gm /GX /Zi /MDd /GR /Gy /I "..\.." /I "..\..\tao" /I "..\..\.." /D _DEBUG /D WIN32 /D _CONSOLE /FD /c
+# SUBTRACT CPP /YX
+# ADD RSC /l 0x409 /d _DEBUG /i "..\.." /i "..\..\tao" /i "..\..\.."
+BSC32=bscmake.exe
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD LINK32 advapi32.lib user32.lib /INCREMENTAL:NO TAOd.lib ACEd.lib /libpath:"..\..\tao" /libpath:"..\..\..\ace" /libpath:"..\..\..\lib" /nologo /version:1.3.5 /subsystem:console /pdb:".\client.pdb" /debug /machine:I386 /out:".\client.exe"
+
+!ENDIF
+
+# Begin Target
+
+# Name "Bug_1635_Client - Win32 Release"
+# Name "Bug_1635_Client - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;cxx;c"
+# Begin Source File
+
+SOURCE=".\client.cpp"
+# End Source File
+# End Group
+# Begin Group "Documentation"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=".\README"
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/TAO/tests/Bug_1635_Regression/Bug_1635_Regression.dsw b/TAO/tests/Bug_1635_Regression/Bug_1635_Regression.dsw
new file mode 100644
index 00000000000..08fa1bbc38d
--- /dev/null
+++ b/TAO/tests/Bug_1635_Regression/Bug_1635_Regression.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "Bug_1635_Client"=Bug_1635_Client.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/TAO/tests/Bug_1635_Regression/Bug_1635_Regression.mpc b/TAO/tests/Bug_1635_Regression/Bug_1635_Regression.mpc
new file mode 100644
index 00000000000..1d29719a1b0
--- /dev/null
+++ b/TAO/tests/Bug_1635_Regression/Bug_1635_Regression.mpc
@@ -0,0 +1,7 @@
+project(Bug_1635_Client): client {
+ libpaths += $(TAO_ROOT)/tao $(ACE_ROOT)/ace
+ Source_Files {
+ client.cpp
+ }
+}
+
diff --git a/TAO/tests/Bug_1635_Regression/Makefile b/TAO/tests/Bug_1635_Regression/Makefile
new file mode 100644
index 00000000000..2055d8a7019
--- /dev/null
+++ b/TAO/tests/Bug_1635_Regression/Makefile
@@ -0,0 +1,19 @@
+#----------------------------------------------------------------------------
+# GNU ACE Workspace
+#
+# @file Makefile
+#
+# $Id$
+#
+# This file was automatically generated by MPC. Any changes made directly to
+# this file will be lost the next time it is generated.
+#
+#----------------------------------------------------------------------------
+
+TARGETS_NESTED = all debug profile optimize install deinstall clean realclean clobber depend rcs_info idl_stubs
+
+$(TARGETS_NESTED):
+ @$(MAKE) -f Makefile.Bug_1635_Client $(@);
+
+reverseclean:
+ @$(MAKE) -f Makefile.Bug_1635_Client realclean
diff --git a/TAO/tests/Bug_1635_Regression/Makefile.Bug_1635_Client b/TAO/tests/Bug_1635_Regression/Makefile.Bug_1635_Client
new file mode 100644
index 00000000000..cf509a529a5
--- /dev/null
+++ b/TAO/tests/Bug_1635_Regression/Makefile.Bug_1635_Client
@@ -0,0 +1,89 @@
+#----------------------------------------------------------------------------
+# GNU Makefile
+#
+# @file Makefile.Bug_1635_Client
+#
+# $Id$
+#
+# This file was automatically generated by MPC. Any changes made directly to
+# this file will be lost the next time it is generated.
+#
+#----------------------------------------------------------------------------
+MAKEFILE = Makefile.Bug_1635_Client
+DEPENDENCY_FILE = .depend.Makefile.Bug_1635_Client
+BIN_UNCHECKED = client
+
+ifndef TAO_ROOT
+ TAO_ROOT = $(ACE_ROOT)/TAO
+endif
+ifndef CIAO_ROOT
+ CIAO_ROOT = $(TAO_ROOT)/CIAO
+endif
+
+FILES = \
+ client
+
+#----------------------------------------------------------------------------
+# Include macros and targets
+#----------------------------------------------------------------------------
+LDLIBS = -lTAO -lACE
+include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
+## We don't need the ACELIB setting from wrapper_macros.GNU
+ACELIB =
+include $(TAO_ROOT)/rules.tao.GNU
+
+# To build multiple executables in the same directory on AIX, it works
+# best to have a template directory per project.
+# The compiler/linker isn't too smart about instantiating templates...
+ifdef TEMPINCDIR
+TEMPINCDIR := $(TEMPINCDIR)/Bug_1635_Client
+
+all: $(TEMPINCDIR)
+
+$(TEMPINCDIR):
+ @-test -d $(TEMPINCDIR) || mkdir -p $(TEMPINCDIR) $(ACE_NUL_STDERR)
+
+endif
+
+BIN = $(BIN_UNCHECKED)
+
+OBJS = $(addsuffix .o, $(notdir $(FILES)))
+SRC = $(addsuffix .cpp, $(FILES))
+
+include $(ACE_ROOT)/include/makeinclude/macros.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
+
+include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
+include $(TAO_ROOT)/taoconfig.mk
+
+CPPFLAGS += -I../.. -I../../tao -I../../..
+ifeq ($(static_libs),1)
+ ifneq ($(LIB),)
+ CPPFLAGS += -DTAO_AS_STATIC_LIBS -DACE_AS_STATIC_LIBS
+ endif
+endif
+
+
+LDFLAGS += -L../../tao -L../../../ace -L../../../lib
+
+#----------------------------------------------------------------------------
+# Local targets
+#----------------------------------------------------------------------------
+.:
+ -@mkdir -p "."
+
+
+ifndef kylix
+$(BIN): $(addprefix $(VDIR), $(OBJS))
+ $(LINK.cc) $(LDFLAGS) $(CC_OUTPUT_FLAG) $@ $^ $(VLDLIBS) $(POSTLINK)
+else
+$(BIN): $(addprefix $(VDIR), $(OBJS))
+ $(LINK.cc) $(LDFLAGS) $(CC_OUTPUT_FLAG) $(VLDLIBS) $(BORINITEXEOBJ) $(POSTLINK) $^, $@,,
+endif
+
+realclean: clean
+ifneq ($(GENERATED_DIRTY),)
+ -$(RM) -r $(GENERATED_DIRTY)
+endif
+
diff --git a/TAO/tests/Bug_1635_Regression/README b/TAO/tests/Bug_1635_Regression/README
new file mode 100644
index 00000000000..96331bc4cb6
--- /dev/null
+++ b/TAO/tests/Bug_1635_Regression/README
@@ -0,0 +1,7 @@
+This test provides regression for Bug 1635:
+"Enhancement - provide date and time stamping to the TAO log file"
+
+The fix allows the setting of a system property that results in a date and time stamp being applied to all ACE log messages.
+
+The client program merely initialises and destroys an ORB - enough activity to prompt the writing of debug messages. The run_test.pl checks the debug output produced for timestamps.
+
diff --git a/TAO/tests/Bug_1635_Regression/client.cpp b/TAO/tests/Bug_1635_Regression/client.cpp
new file mode 100644
index 00000000000..27a5795d1c1
--- /dev/null
+++ b/TAO/tests/Bug_1635_Regression/client.cpp
@@ -0,0 +1,26 @@
+//
+// $Id$
+//
+#include "tao/corba.h"
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "SERVER (%P): Caught exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/tests/Bug_1635_Regression/run_test.pl b/TAO/tests/Bug_1635_Regression/run_test.pl
new file mode 100755
index 00000000000..41231eb00e8
--- /dev/null
+++ b/TAO/tests/Bug_1635_Regression/run_test.pl
@@ -0,0 +1,78 @@
+
+# $Id$
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# -*- perl -*-
+
+use lib '../../../bin';
+use PerlACE::Run_Test;
+
+# The file we want TAO to write debug messages to
+$debug_file = PerlACE::LocalFile ("debug.log");
+unlink $debug_file;
+
+# The client process - simply initialises an ORB to create some minimal debug
+$CLIENT = new PerlACE::Process(PerlACE::LocalFile("client"));
+$CLIENT->Arguments("-ORBDebugLevel 10 -ORBLogFile $debug_file");
+
+sub run_client
+{
+ # Run the client
+ if ($CLIENT->SpawnWaitKill (30) != 0)
+ {
+ print STDERR "ERROR: Bug 1635 Regression failed. Client failed to run.\n";
+ $ENV {'TAO_LOG_TIMESTAMP'} = "";
+ exit 1;
+ }
+
+ # Open the log file, read a line, close, and delete it.
+ open (HANDLE, "$debug_file");
+ $_ = <HANDLE>;
+ close HANDLE;
+ unlink $debug_file;
+}
+
+# Run the client with no value for the environment variable
+$ENV {'ACE_LOG_TIMESTAMP'} = "";
+run_client;
+
+# Check result is as expected, i.e. starts like:
+# TAO (12...etc.
+if (!/^TAO \(/)
+{
+ print STDERR "ERROR: Bug 1635 Regression failed. Unexpected normal log format.\n";
+ $ENV {'ACE_LOG_TIMESTAMP'} = "";
+ exit 1;
+}
+
+# Try again with the 'TIME' logging property set
+$ENV {'ACE_LOG_TIMESTAMP'} = "TIME";
+run_client;
+
+# Check result is as expected, i.e. starts like:
+# 14:36:38.222000|TAO (12...etc.
+if (!/^\d{2}:\d{2}:\d{2}.\d{6}\|TAO \(/)
+{
+ print STDERR "ERROR: Bug 1635 Regression failed. Unexpected 'TIME' log format.\n";
+ $ENV {'ACE_LOG_TIMESTAMP'} = "";
+ exit 1;
+}
+
+# Try again with the 'DATE' logging property set
+$ENV {'ACE_LOG_TIMESTAMP'} = "DATE";
+run_client;
+
+# Check result is as expected, i.e. starts like:
+# Wed Feb 12 2003 14:36:38.222000|TAO (12...etc.
+if (!/^[A-Z][a-z]{2} [A-Z][a-z]{2} \d{2} \d{4} \d{2}:\d{2}:\d{2}.\d{6}\|TAO \(/)
+{
+ print STDERR "ERROR: Bug 1635 Regression failed. Unexpected 'DATE' log format.\n";
+ $ENV {'ACE_LOG_TIMESTAMP'} = "";
+ exit 1;
+}
+
+$ENV {'ACE_LOG_TIMESTAMP'} = "";
+exit 0;
+