harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r497422 - in /harmony/enhanced/classlib/trunk/modules/portlib: ./ make/ src/test/ src/test/native/ src/test/native/hyerror/ src/test/native/hyerror/shared/ src/test/native/hyerror/unix/ src/test/native/hyerror/windows/ src/test/native/hytim...
Date Thu, 18 Jan 2007 13:03:49 GMT
Author: hindessm
Date: Thu Jan 18 05:03:47 2007
New Revision: 497422

URL: http://svn.apache.org/viewvc?view=rev&rev=497422
Log:
First attempt at some native portlib tests.

Added:
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/   (with props)
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/shared/   (with
props)
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/shared/hyerror.c
  (with props)
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/unix/
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/unix/makefile
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/windows/
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/windows/makefile
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/   (with props)
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/shared/   (with
props)
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/shared/hytime.c
  (with props)
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/unix/
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/unix/makefile
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/windows/
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/windows/makefile
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/   (with props)
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/shared/   (with props)
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/shared/init.c   (with
props)
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/unix/
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/unix/makefile
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/windows/
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/windows/makefile
Modified:
    harmony/enhanced/classlib/trunk/modules/portlib/build.xml
    harmony/enhanced/classlib/trunk/modules/portlib/make/hyproperties.xml

Modified: harmony/enhanced/classlib/trunk/modules/portlib/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/build.xml?view=diff&rev=497422&r1=497421&r2=497422
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/build.xml Thu Jan 18 05:03:47 2007
@@ -31,14 +31,20 @@
 
     <target name="build" /> <!-- depends="compile-java, copy-resources, build-jar"
-->
 
-    <target name="-test-module" >
-        <!--
-             This target exists to match the API of other module
-             build.xml files.  However, we should probably write some
-             (native) portlib tests to aid porting.
-          -->
+    <target name="test" depends="-test-module">
+        <fail message="Some tests failed">
+            <condition>
+                <or>
+                    <isset property="test.errors" />
+                </or>
+            </condition>
+        </fail>
     </target>
 
+    <target name="-test-module"
+            unless="is.windows"
+            depends="-compile-native-tests,-run-native-tests" />
+
     <target name="copy-native-includes">
         <copy todir="${hy.hdk}/include" overwrite="yes">
             <fileset dir="${hy.portlib.src.main.native}/include/shared">
@@ -124,4 +130,65 @@
             </fileset>
         </delete>
     </target>
+
+    <target name="-compile-native-tests" >
+        <make dir="${hy.portlib.src.test.native}/init/${hy.os.family}" />
+        <make dir="${hy.portlib.src.test.native}/hyerror/${hy.os.family}" />
+        <make dir="${hy.portlib.src.test.native}/hytime/${hy.os.family}" />
+    </target>
+
+    <target name="-run-native-tests" >
+        <mkdir dir="${hy.tests.reports}" />
+        <property environment="env"/>
+        <exec-native test="init" />
+        <exec-native test="hyerror" />
+        <exec-native test="hytime" />
+
+        <antcall target="touch-errors-file" />
+    </target>
+
+    <target name="touch-errors-file" if="test.errors">
+        <echo file="${hy.tests.reports}/test.errors"
+            append="true">portlib${line.separator}</echo>
+    </target>
+
+    <macrodef name="exec-native">
+        <attribute name="test" />
+        <sequential>
+            <property name="@{test}.name"
+                      value="native.portlib.@{test}" />
+            <exec executable="${hy.portlib.src.test.native}/@{test}/@{test}${exe.suffix}"
+                  failonerror="false"
+                  outputproperty="@{test}.output"
+                  resultproperty="@{test}.resultcode" >
+                <env key="PATH"
+                     path="${env.Path}:${env.PATH}:${hy.jdk}/jre/bin" />
+                <env key="Path"
+                     path="${env.Path}:${env.PATH}:${hy.jdk}/jre/bin" />
+                <env key="LD_LIBRARY_PATH"
+                     path="${env.LD_LIBRARY_PATH}:${hy.jdk}/jre/bin" />
+            </exec>
+            <condition property="@{test}.result" value="passed" else="FAILED">
+                <equals arg1="${@{test}.resultcode}" arg2="0" />
+            </condition>
+            <condition property="@{test}.errorcount" value="0" else="1">
+                <equals arg1="${@{test}.resultcode}" arg2="0" />
+            </condition>
+            <condition property="test.errors" value="1">
+                <not>
+                    <equals arg1="${@{test}.resultcode}" arg2="0" />
+                </not>
+            </condition>
+            <echo>@{test}: ${@{test}.result}${line.separator}</echo>
+            <echo file="${hy.tests.reports}/TEST-${@{test}.name}.xml"
+                 >&lt;?xml version='1.0' encoding='UTF-8' ?&gt;
+&lt;testsuite tests="1" errors='${@{test}.errorcount}' failures='0'
+    name='${@{test}.name}' time='0'&gt;
+  &lt;testcase classname='${@{test}.name}' name='${@{test}.name}'
+       time='0.0' /&gt;
+  &lt;system-out&gt;&lt;![CDATA[${@{test}.output}]]&gt;&lt;/system-out&gt;
+&lt;/testsuite&gt;${line.separator}</echo>
+        </sequential>
+    </macrodef>
+
 </project>

Modified: harmony/enhanced/classlib/trunk/modules/portlib/make/hyproperties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/make/hyproperties.xml?view=diff&rev=497422&r1=497421&r2=497422
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/make/hyproperties.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/make/hyproperties.xml Thu Jan 18 05:03:47
2007
@@ -24,9 +24,10 @@
          <main>
             <java location="src/main/java" />
             <native location="src/main/native" />
-        	<resources location="src/main/resources" />
+            <resources location="src/main/resources" />
          </main>
          <test location="src/test">
+            <native location="src/test/native" />
             <resources location="src/test/resources" />
          </test>
          <natives location="src/natives" />

Propchange: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jan 18 05:03:47 2007
@@ -0,0 +1 @@
+hyerror

Propchange: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/shared/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jan 18 05:03:47 2007
@@ -0,0 +1 @@
+*.obj

Added: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/shared/hyerror.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/shared/hyerror.c?view=auto&rev=497422
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/shared/hyerror.c
(added)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/shared/hyerror.c
Thu Jan 18 05:03:47 2007
@@ -0,0 +1,88 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include "hycomp.h"
+#include "hyport.h"
+#include <stdlib.h>
+#include <string.h>
+
+#include <stdio.h>
+#define ERROR_STRING "Argh!"
+
+int main (int argc, char **argv, char **envp)
+{
+  HyPortLibrary hyportLibrary;
+  HyPortLibraryVersion portLibraryVersion;
+  I_32 num;
+  const char *err;
+
+  printf("hyerror:\n");
+
+  HYPORT_SET_VERSION (&portLibraryVersion, HYPORT_CAPABILITY_MASK);
+  if (0 != hyport_init_library (&hyportLibrary, &portLibraryVersion,
+                                sizeof (HyPortLibrary)))
+  {
+    fprintf(stderr, "portlib init failed\n");
+    return 1;
+  }
+
+  printf("  portlib initialized\n");
+
+  err = hyportLibrary.error_last_error_message(&hyportLibrary);
+  printf("  err = %s\n", err);
+  if (strncmp(err, "", sizeof("")) != 0) {
+    fprintf(stderr,
+            "hyerror_last_error_message was not empty but \"%s\"\n", err);
+    return 1;
+  }
+
+  hyportLibrary.error_set_last_error(&hyportLibrary,
+                                     2, HYPORT_ERROR_NOTFOUND);
+  num = hyportLibrary.error_last_error_number(&hyportLibrary);
+  err = hyportLibrary.error_last_error_message(&hyportLibrary);
+  printf("  num = %d, err = %s\n", num, err);
+
+  if (num != HYPORT_ERROR_NOTFOUND) {
+    fprintf(stderr, "hyerror_last_error_number was %d not %d\n",
+            num, HYPORT_ERROR_NOTFOUND);
+    return 1;
+  }
+
+  if (strncmp(err, "", sizeof("")) == 0) {
+    fprintf(stderr, "hyerror_last_error_message was empty\n");
+    return 1;
+  }
+
+  hyportLibrary.error_set_last_error_with_message(&hyportLibrary,
+                                                  HYPORT_ERROR_NOTFOUND,
+                                                  ERROR_STRING);
+  err = hyportLibrary.error_last_error_message(&hyportLibrary);
+  printf("  err = %s\n", err);
+
+  if (strncmp(err, ERROR_STRING, sizeof(ERROR_STRING)) != 0) {
+    fprintf(stderr, "hyerror_last_error_message was %s not %s\n", err,
+            ERROR_STRING);
+    return 1;
+  }
+  
+  if (0 != hyportLibrary.port_shutdown_library (&hyportLibrary)) {
+    fprintf(stderr, "portlib shutdown failed\n");
+    return 1;
+  }
+  printf("  portlib shutdown\n");
+
+  return 0;
+}

Propchange: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/shared/hyerror.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/unix/makefile?view=auto&rev=497422
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/unix/makefile
(added)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/unix/makefile
Thu Jan 18 05:03:47 2007
@@ -0,0 +1,27 @@
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+#
+# Makefile for 'hyerror'
+#
+
+include $(HY_HDK)/build/make/defines.mk
+
+BUILDFILES = $(SHAREDSUB)hyerror.o
+MDLLIBFILES = $(LIBPATH)libhycommon.a $(DLLPATH)libhyprt.so \
+	$(DLLPATH)libhythr.so $(DLLPATH)libhysig.so
+EXENAME = ../hyerror
+
+include $(HY_HDK)/build/make/rules.mk

Added: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/windows/makefile?view=auto&rev=497422
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/windows/makefile
(added)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyerror/windows/makefile
Thu Jan 18 05:03:47 2007
@@ -0,0 +1,30 @@
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+#
+# Makefile for module 'hyerror.exe'
+#
+
+!include <$(HY_HDK)\build\make\defines.mak>
+
+EXENAME=../hyerror.exe
+HYCFLAGS = $(HYCFLAGS) /I$(SHAREDSUB)
+
+BUILDFILES = $(SHAREDSUB)hyerror.obj
+MDLLIBFILES = $(LIBPATH)hycommon.lib $(LIBPATH)hyprt.lib $(LIBPATH)hythr.lib 
+EXEFLAGS=$(conlflags) -subsystem:console
+EXEDLLFILES=$(conlibsdll)
+
+!include <$(HY_HDK)\build\make\rules.mak>

Propchange: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jan 18 05:03:47 2007
@@ -0,0 +1 @@
+hytime

Propchange: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/shared/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jan 18 05:03:47 2007
@@ -0,0 +1 @@
+*.obj

Added: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/shared/hytime.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/shared/hytime.c?view=auto&rev=497422
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/shared/hytime.c
(added)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/shared/hytime.c
Thu Jan 18 05:03:47 2007
@@ -0,0 +1,80 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "hycomp.h"
+#include "hyport.h"
+#include "hythread.h"
+
+int main (int argc, char **argv, char **envp)
+{
+  HyPortLibrary hyportLibrary;
+  HyPortLibraryVersion portLibraryVersion;
+  UDATA msec, usec;
+  I_64 millis;
+  U_64 hires, hires2, freq, delta;
+
+  printf("hytime:\n");
+
+  HYPORT_SET_VERSION (&portLibraryVersion, HYPORT_CAPABILITY_MASK);
+  if (0 != hyport_init_library (&hyportLibrary, &portLibraryVersion,
+                                sizeof (HyPortLibrary)))
+  {
+    fprintf(stderr, "portlib init failed\n");
+    return 1;
+  }
+
+  printf("  portlib initialized\n");
+
+  msec = hyportLibrary.time_msec_clock(&hyportLibrary);
+  printf("msec = %u\n", msec);
+
+  usec = hyportLibrary.time_usec_clock(&hyportLibrary);
+  printf("usec = %u\n", usec);
+
+  millis = hyportLibrary.time_current_time_millis(&hyportLibrary);
+  printf("millis = %lld\n", millis);
+
+  hires = hyportLibrary.time_hires_clock(&hyportLibrary);
+  printf("hires = %llu\n", hires);
+  freq = hyportLibrary.time_hires_frequency(&hyportLibrary);
+  printf("freq = %llu\n", freq);
+
+  hythread_sleep(1000);
+
+  hires2 = hyportLibrary.time_hires_clock(&hyportLibrary);
+  printf("hires2 = %llu\n", hires2);
+
+  delta = hyportLibrary.time_hires_delta(&hyportLibrary,
+                                         hires, hires2,
+                                         HYPORT_TIME_DELTA_IN_MICROSECONDS);
+  printf("delta = %llu\n", delta);
+  
+  if (delta <= 0) {
+    fprintf(stderr, "hires_clock did not increment after 1s sleep\n");
+    return 1;
+  }
+  
+  if (0 != hyportLibrary.port_shutdown_library (&hyportLibrary)) {
+    fprintf(stderr, "portlib shutdown failed\n");
+    return 1;
+  }
+  printf("  portlib shutdown\n");
+
+  return 0;
+}

Propchange: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/shared/hytime.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/unix/makefile?view=auto&rev=497422
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/unix/makefile (added)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/unix/makefile Thu
Jan 18 05:03:47 2007
@@ -0,0 +1,27 @@
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+#
+# Makefile for 'hytime'
+#
+
+include $(HY_HDK)/build/make/defines.mk
+
+BUILDFILES = $(SHAREDSUB)hytime.o
+MDLLIBFILES = $(LIBPATH)libhycommon.a $(DLLPATH)libhyprt.so \
+	$(DLLPATH)libhythr.so $(DLLPATH)libhysig.so
+EXENAME = ../hytime
+
+include $(HY_HDK)/build/make/rules.mk

Added: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/windows/makefile?view=auto&rev=497422
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/windows/makefile
(added)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/windows/makefile
Thu Jan 18 05:03:47 2007
@@ -0,0 +1,30 @@
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+#
+# Makefile for module 'hytime.exe'
+#
+
+!include <$(HY_HDK)\build\make\defines.mak>
+
+EXENAME=../hytime.exe
+HYCFLAGS = $(HYCFLAGS) /I$(SHAREDSUB)
+
+BUILDFILES = $(SHAREDSUB)hytime.obj
+MDLLIBFILES = $(LIBPATH)hycommon.lib $(LIBPATH)hyprt.lib $(LIBPATH)hythr.lib 
+EXEFLAGS=$(conlflags) -subsystem:console
+EXEDLLFILES=$(conlibsdll)
+
+!include <$(HY_HDK)\build\make\rules.mak>

Propchange: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jan 18 05:03:47 2007
@@ -0,0 +1 @@
+init

Propchange: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/shared/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jan 18 05:03:47 2007
@@ -0,0 +1 @@
+*.obj

Added: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/shared/init.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/shared/init.c?view=auto&rev=497422
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/shared/init.c (added)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/shared/init.c Thu
Jan 18 05:03:47 2007
@@ -0,0 +1,47 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#include "hycomp.h"
+#include "hyport.h"
+#include <stdlib.h>
+
+#include <stdio.h>
+
+int main (int argc, char **argv, char **envp)
+{
+  HyPortLibrary hyportLibrary;
+  HyPortLibraryVersion portLibraryVersion;
+
+  printf("init:\n");
+
+  HYPORT_SET_VERSION (&portLibraryVersion, HYPORT_CAPABILITY_MASK);
+  if (0 != hyport_init_library (&hyportLibrary, &portLibraryVersion,
+                                sizeof (HyPortLibrary)))
+  {
+    fprintf(stderr, "portlib init failed\n");
+    return 1;
+  }
+
+  printf("  portlib initialized\n");
+  
+  if (0 != hyportLibrary.port_shutdown_library (&hyportLibrary)) {
+    fprintf(stderr, "portlib shutdown failed\n");
+    return 1;
+  }
+  printf("  portlib shutdown\n");
+
+  return 0;
+}

Propchange: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/shared/init.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/unix/makefile?view=auto&rev=497422
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/unix/makefile (added)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/unix/makefile Thu
Jan 18 05:03:47 2007
@@ -0,0 +1,27 @@
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+#
+# Makefile for 'init'
+#
+
+include $(HY_HDK)/build/make/defines.mk
+
+BUILDFILES = $(SHAREDSUB)init.o
+MDLLIBFILES = $(LIBPATH)libhycommon.a $(DLLPATH)libhyprt.so \
+	$(DLLPATH)libhythr.so $(DLLPATH)libhysig.so
+EXENAME = ../init
+
+include $(HY_HDK)/build/make/rules.mk

Added: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/windows/makefile?view=auto&rev=497422
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/windows/makefile
(added)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/init/windows/makefile
Thu Jan 18 05:03:47 2007
@@ -0,0 +1,30 @@
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+#
+# Makefile for module 'init.exe'
+#
+
+!include <$(HY_HDK)\build\make\defines.mak>
+
+EXENAME=../init.exe
+HYCFLAGS = $(HYCFLAGS) /I$(SHAREDSUB)
+
+BUILDFILES = $(SHAREDSUB)init.obj
+MDLLIBFILES = $(LIBPATH)hycommon.lib $(LIBPATH)hyprt.lib $(LIBPATH)hythr.lib 
+EXEFLAGS=$(conlflags) -subsystem:console
+EXEDLLFILES=$(conlibsdll)
+
+!include <$(HY_HDK)\build\make\rules.mak>



Mime
View raw message