Author: mturk Date: Tue Aug 11 16:17:21 2009 New Revision: 803181 URL: http://svn.apache.org/viewvc?rev=803181&view=rev Log: Add simple native testsuite
Added: commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c (with props) Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.in commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.in URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.in?rev=803181&r1=803180&r2=803181&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/Makefile.in (original) +++ commons/sandbox/runtime/trunk/src/main/native/Makefile.in Tue Aug 11 16:17:21 2009 @@ -57,6 +57,7 @@ STATICLIB=lib$(NAME)$(LIB) SHAREDLIB=lib$(NAME)$(SO) SSLMODLIB=lib$(NAME)ssl$(SO) +TESTSUITE=testsuite$(EXE) SRCDIR=$(TOPDIR) PWDDIR=$(PWD) @@ -214,10 +215,16 @@ $(SSLMODLIB): $(SHAREDLIB) $(OPENSSL_OBJS) $(CC) $(SHFLAGS) $(OPENSSL_OBJS) $(LDFLAGS) $(SSLFLAGS) -L. -l$(NAME) -o $@ +$(TESTSUITE): $(STATICLIB) $(SHAREDLIB) @modules@ $(SRCDIR)/test/testsuite.$(OBJ) + $(CC) -Wl,-rpath -Wl,. $(SRCDIR)/test/testsuite.$(OBJ) $(LDFLAGS) -L. -l$(NAME) -o $@ + +test: $(TESTSUITE) + clean: for i in $(SRCDIR) $(ARCH_DIRS) ; do rm -f $$i/*.$(OBJ) ; done rm -f *$(SO) rm -f *$(LIB) + rm -f $(TESTSUITE) distclean: clean rm -f $(TOPDIR)/Makefile Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in?rev=803181&r1=803180&r2=803181&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in (original) +++ commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in Tue Aug 11 16:17:21 2009 @@ -64,6 +64,7 @@ SHAREDLIB=$(LIBNAME)$(SO) SSLMODLIB=$(SSLNAME)$(SO) +TESTSUITE=testsuite$(EXE) COMMON_OBJS=\ $(SRCDIR)/shared/buildmark.$(OBJ) \ @@ -166,6 +167,17 @@ mt -nologo -manifest $...@.manifest -outputresource:$@;2 @copy /Y $@ $(SSLSO) +$(TESTSUITE): $(SHAREDLIB) @modules@ $(SRCDIR)/test/testsuite.$(OBJ) + $(LINK) $(SHFLAGS) $(LDFLAGS) /SUBSYSTEM:CONSOLE libpath:"." $(LIBNAME).lib /pdb:$(TESTSUITE).pdb /out:$@ @<< + $(SRCDIR)/test/testsuite.$(OBJ) +<< + IF EXIST $...@.manifest \ + mt -nologo -manifest $...@.manifest -outputresource:$@;2 + + +test: $(TESTSUITE) + + clean: -...@del /Q $(SRCDIR)\shared\*.$(OBJ) 2>NUL -...@del /Q $(SRCDIR)\test\*.$(OBJ) 2>NUL @@ -178,6 +190,7 @@ -...@del /Q *.pdb 2>NUL -...@del /Q *.exp 2>NUL -...@del /Q *.res 2>NUL + -...@del /Q *.exe 2>NUL distclean: clean -...@del /Q $(TOPDIR)\Makefile 2>NUL Added: commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c?rev=803181&view=auto ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c (added) +++ commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c Tue Aug 11 16:17:21 2009 @@ -0,0 +1,61 @@ +/* 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. + */ + +#undef ACR_DECLARE_EXPORT + +#include "acr.h" +#include "acr_private.h" +#include "acr_arch.h" +#define ACR_WANT_MEMPROTECT +#include "acr_error.h" +#include "acr_string.h" +#include "acr_memory.h" +#include "acr_tables.h" +#include "acr_vm.h" +#include "acr_clazz.h" +#include "acr_pointer.h" +#include "acr_descriptor.h" +#include "acr_file.h" +#include "acr_xdr.h" +#include "acr_shm.h" +#include "acr_crypto.h" +#include "acr_version.h" + +#if defined (WIN32) +#include <io.h> +#include <sys/stat.h> +#define random rand +#define srandom srand +#endif + +#if !defined(WIN32) +extern mode_t acr_default_umask; +extern mode_t acr_default_perms; +#endif + + + + +int main(int argc, const char *const argv[]) +{ + fprintf(stdout, + "Running Apache Commons Runtime %s (%s version) test suite.\n", + ACR_VERSION_STRING, ACR_GetLibraryBuilt()); + fflush(stdout); + + return 0; +} + Propchange: commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c ------------------------------------------------------------------------------ svn:eol-style = native