Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 68111 | Differences between
and this patch

Collapse All | Expand All

(-)CommonBaseEvent/UnitTest/scripts/UT_CBE_Darwin.sh (+225 lines)
Added Link Here
1
#!/bin/sh
2
#
3
# File: UT_CBE_DarwinPPC.sh
4
#--------------------------------------------------------------------------
5
# This script is used for running Common Base Event native implementation
6
# unit/regression tests and the Sample.
7
#
8
# Usage: UT_CBE_DarwinPPC.sh [options]
9
# Options: 
10
#       -l  full path to the location of the library file libcbe.so; if not 
11
#           specified, the DYLD_LIBRARY_PATH and currently directory will be 
12
#           used as searching path
13
#       -a  full path to the locatin of the executables; if not specified, 
14
#           environment variable PATH and current directory will be used 
15
#           as the searching path
16
#       -o  output file name; if not specified, the default file name
17
#           'cbenative.uttest.out' will be used
18
#       -i  input file name for Sample; if not specified, the default file 
19
#           name sample.xml will be used
20
#       -s  output file name for Sample serialize; if not specified, the 
21
#           default file name serialized.xml will be used
22
#       -d  output file name for Sample deserialize; if not specified, the
23
#           default file name deserialized.xml will be used
24
#----------------------------------------------------------------------------
25
26
USAGE="Usage: $0 [-l] [library path] [-a] [application path] [-o] [output filename] [-i] [sample input filename] [-s] [sample serialize output filename] [-d] [sample deserialize output filename]";
27
28
LIB_FILE="libcbe.dylib"
29
LIB_FILE_EXIST="false"
30
31
32
#----------------------------------------------------------------------------
33
# Parse command line options
34
#----------------------------------------------------------------------------
35
36
while getopts l:a:o:i:s:d: OPTION ; do
37
    case "$OPTION" in
38
        l) CBE_LIB_PATH="$OPTARG" ;;
39
        a) APP_PATH="$OPTARG" ;;
40
        o) OUTFILE="$OPTARG" ;;
41
        i) INFILE="$OPTARG" ;;
42
        s) SERIALIZE_FILE="$OPTARG" ;;
43
        d) DESERIALIZE_FILE="$OPTARG" ;;
44
       \?) echo "$USAGE" ;
45
           exit 1
46
           ;;
47
    esac
48
done
49
50
#----------------------------------------------------------------------------
51
# Setup library path
52
#----------------------------------------------------------------------------
53
  
54
if [ -n "$CBE_LIB_PATH" -a -d "$CBE_LIB_PATH" ] ;              
55
then 
56
    DYLD_LIBRARY_PATH="$CBE_LIB_PATH:$DYLD_LIBRARY_PATH" ; 
57
else
58
    DYLD_LIBRARY_PATH=".:$DYLD_LIBRARY_PATH" ;                     
59
fi
60
61
62
#----------------------------------------------------------------------------
63
# Setup unit/regression tests executable path
64
#----------------------------------------------------------------------------
65
66
if [ -n "$APP_PATH" -a -d "$APP_PATH" ] ;              
67
then 
68
    PATH="$APP_PATH:$PATH" ; 
69
else
70
    APP_PATH=.
71
    PATH="$APP_PATH:$PATH" ;                     
72
fi
73
74
75
#----------------------------------------------------------------------------
76
# Setup output file
77
# 
78
# The default output file name is cbenative.uttest.out; if a file with this
79
# name already exists, it will be renamed by attaching the timestamp to it
80
#----------------------------------------------------------------------------
81
 
82
if [ -z "$OUTFILE" ] ;              
83
then 
84
    OUTFILE=cbenative.uttest.out 
85
fi
86
87
if [ -f "$OUTFILE" ] ;
88
then
89
    mv "$OUTFILE" $OUTFILE.`date "+%Y%m%d.%H%M%S"` ;
90
fi
91
92
export PATH
93
export DYLD_LIBRARY_PATH
94
95
#----------------------------------------------------------------------------
96
# Check for existence of library file
97
#----------------------------------------------------------------------------
98
99
OFS=${IFS}
100
101
IFS=:
102
103
for p in $DYLD_LIBRARY_PATH
104
do
105
   if [ -f $p/$LIB_FILE ]
106
   then
107
      LIB_FILE_EXIST="true" ; 
108
      break ;
109
    fi 
110
done
111
112
113
if [ "$LIB_FILE_EXIST" = "false" ]
114
then
115
    echo "Library file $LIB_FILE not found."
116
    exit 1 ;
117
fi
118
119
120
#---------------------------------------------------------------------------
121
# Check existence of test applications and run tests
122
#---------------------------------------------------------------------------
123
echo
124
echo "Working directory is: `pwd`" ;
125
echo "Output file is: $OUTFILE" ;
126
echo
127
128
echo "Start Common Base Event Testing" >> $OUTFILE
129
130
APP_EXISTS=false;
131
132
133
IFS=${OFS}
134
135
APPLICATIONS="UTAssociatedEvent
136
              UTAssociationEngine
137
              UTComponentIdentification
138
              UTContextDataElement
139
              UTTemplateContentHandler
140
              UTEventFactory
141
              UTExtendedDataElement
142
              UTMsgDataElement
143
              UTSituation
144
              UTSituationType
145
              UTXMLUtility
146
              UTCommonBaseEvent
147
              UTEventFormatter"
148
149
150
for i in $APPLICATIONS
151
do
152
    IFS=: ;
153
    for s in $PATH
154
    do
155
        if [ -x $s/$i ]
156
        then
157
            APP_EXISTS=true;
158
            APP=$s/$i ;
159
            break ;
160
        fi
161
    done
162
    
163
    if [ "$APP_EXISTS" = "true" ]
164
    then 
165
        echo  "Run $i:" ;
166
        $APP > tmp.out
167
        more tmp.out | grep Total
168
        more tmp.out >> $OUTFILE         
169
        APP_EXISTS=false;
170
    else
171
        echo "File $i not found or not executable." ;
172
    fi
173
done
174
175
rm tmp.out
176
177
178
179
#--------------------------------------------------------------
180
# Run Sample
181
#--------------------------------------------------------------
182
183
if [ -z "$INFILE" ]
184
then
185
    INFILE=sample.xml
186
fi
187
188
if [ ! -f "$INFILE" ]
189
then
190
    echo Sample input file $INFILE not found.
191
    exit 1 ;
192
fi
193
194
if [ -z "$SERIALIZE_FILE" ]
195
then
196
    SERIALIZE_FILE=serialized.xml
197
fi
198
199
if [ -z "$DESERIALIZE_FILE" ]
200
then
201
    DESERIALIZE_FILE=deserialized.xml
202
fi
203
204
SAMPLE_EXISTS=false
205
206
for s in $PATH
207
do
208
    if [ -x $s/Sample ]
209
    then
210
        SAMPLE_EXISTS=true ;
211
    fi
212
done
213
214
if [ "$SAMPLE_EXISTS" = "true" ]
215
then
216
    echo "Run Sample:" ;
217
    Sample -i $INFILE -os $SERIALIZE_FILE -od $DESERIALIZE_FILE | grep Total
218
else
219
    echo "File Sample not found or not executable." ;
220
fi
221
222
IFS=${OFS}
223
224
echo
225
echo "Done" ;
(-)CommonBaseEvent/cImpl/CommonBaseEvent.h (-2 / +1 lines)
Lines 67-74 Link Here
67
67
68
#include <stdlib.h>
68
#include <stdlib.h>
69
69
70
70
#if ! defined __APPLE__ && ! defined MVS && ! defined __OS400__
71
#if ! defined MVS && ! defined __OS400__
72
#include <malloc.h>
71
#include <malloc.h>
73
#endif
72
#endif
74
73
(-)CommonBaseEvent/include.common (+7 lines)
Lines 44-49 Link Here
44
	DYNAMIC_EXT_LIB = so
44
	DYNAMIC_EXT_LIB = so
45
	STATIC_EXT_LIB = a
45
	STATIC_EXT_LIB = a
46
endif
46
endif
47
ifeq ($(UNAME), Darwin)
48
	BUILD_PLATFORM = darwin
49
	JDK_PLATFORM = darwin
50
	# DYNAMIC_EXT_LIB = so
51
	DYNAMIC_EXT_LIB = dylib
52
	STATIC_EXT_LIB = a
53
endif
47
ifeq ($(UNAME), OS/390)
54
ifeq ($(UNAME), OS/390)
48
	BUILD_PLATFORM = os390
55
	BUILD_PLATFORM = os390
49
	JDK_PLATFORM = os390
56
	JDK_PLATFORM = os390
(-)CommonBaseEvent/include.darwin (+57 lines)
Added Link Here
1
#
2
# Global include for Darwin/PowerPC
3
#
4
CC = gcc 
5
CXX = g++
6
LINK = $(CC)
7
LINKCPP = $(CXX)
8
SHLIB_FLAG = -dynamiclib
9
CXX_AR=$(AR) cr
10
STLIB_FLAG =  -Xlinker -Bstatic 
11
12
#
13
# Suppress association of suffix .c with suffix .y by stating new order of evaluation of suffixes
14
#
15
.SUFFIXES:
16
.SUFFIXES: .h .hpp .cpp .c .o
17
18
#
19
# Make
20
#
21
MAKE = make
22
23
#
24
# C flags
25
#
26
CFLAGS = -Os
27
CFLAGSEXE = $(CFLAGS)
28
29
#
30
# C++ flags
31
#
32
CXXFLAGS = $(CFLAGS)
33
34
#
35
# Linkedit flags
36
#
37
LINKFLAGS = -L$(SRC_IDIR)/packaging
38
DLLLINKFLAGS = $(SHLIB_FLAG) $(LINKFLAGS) 
39
EXELINKFLAGS = $(LINKFLAGS) -lcbe
40
41
#
42
# Defines
43
#
44
DEFINES = -DSQLUNIX -DENW -DREENTRANT -D_REENTRANT
45
46
#
47
# Link flags
48
#
49
CBE_FLAGS = $(DLLLINKFLAGS)
50
51
ifdef STATIC_LINKING
52
    SAMPLE_STATIC_FLAGS = $(STLIB_FLAG)
53
    SAMPLE_STATIC_LIBS =
54
    SAMPLE_STATIC_STDLIB = -nostdlib -lstdc++ -lgcc -lgcc_eh
55
endif  # 
56
57
SAMPLE_FLAGS = $(CFLAGSEXE) $(EXELINKFLAGS) $(DEP_LINKFLAGS)

Return to bug 68111