Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -1,6 +1,6 @@ -SUBDIRS = src +SUBDIRS = src tests DISTCLEAN = ObjSQLite3.oc \ aclocal.m4 \ autom4te.cache \ buildsys.mk \ config.h \ @@ -8,10 +8,12 @@ config.status \ extra.mk include buildsys.mk include extra.mk + +tests: src install-extra: i=ObjSQLite3.oc; \ packagesdir="${DESTDIR}$$(${OBJFW_CONFIG} --packages-dir)"; \ ${INSTALL_STATUS}; \ Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -51,10 +51,11 @@ AC_ARG_ENABLE(static, AS_HELP_STRING([--enable-static], [build static library])) AS_IF([test x"$enable_static" = x"yes" -o x"$enable_shared" = x"no"], [ AC_SUBST(OBJSQLITE3_STATIC_LIB, "libobjsqlite3.a") AC_SUBST(EXCEPTIONS_A, "exceptions.a") AC_SUBST(EXCEPTIONS_EXCEPTIONS_A, "exceptions/exceptions.a") + AC_SUBST(LIBOBJSQLITE3_DEP, "../src/libobjsqlite3.a") ]) AC_ARG_WITH(sqlite3, AS_HELP_STRING([--with-sqlite3=PREFIX], [build with SQLite3 in the specified prefix])) AS_IF([test x"$with_sqlite3" != x"no" -a x"$with_sqlite3" != x""], [ Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -1,11 +1,14 @@ OBJSQLITE3_SHARED_LIB = @OBJSQLITE3_SHARED_LIB@ OBJSQLITE3_STATIC_LIB = @OBJSQLITE3_STATIC_LIB@ OBJSQLITE3_FRAMEWORK = @OBJSQLITE3_FRAMEWORK@ +OBJSQLITE3_LIB_MAJOR = 0 +OBJSQLITE3_LIB_MINOR = 0 EXCEPTIONS_A = @EXCEPTIONS_A@ EXCEPTIONS_EXCEPTIONS_A = @EXCEPTIONS_EXCEPTIONS_A@ EXCEPTIONS_EXCEPTIONS_LIB_A = @EXCEPTIONS_EXCEPTIONS_LIB_A@ EXCEPTIONS_LIB_A = @EXCEPTIONS_LIB_A@ +LIBOBJSQLITE3_DEP = @LIBOBJSQLITE3_DEP@ OBJFW_CONFIG = @OBJFW_CONFIG@ OBJFW_FRAMEWORK_LIBS = @OBJFW_FRAMEWORK_LIBS@ OBJFW_LIBS = @OBJFW_LIBS@ ADDED tests/Makefile Index: tests/Makefile ================================================================== --- /dev/null +++ tests/Makefile @@ -0,0 +1,45 @@ +PROG_NOINST = tests${PROG_SUFFIX} +SRCS = Tests.m + +include ../buildsys.mk +include ../extra.mk + +post-all: ${RUN_TESTS} + +.PHONY: run +run: + rm -f libobjsqlite3.so.${OBJSQLITE3_LIB_MAJOR} + rm -f libobjsqlite3.so.${OBJSQLITE3_LIB_MAJOR_MINOR} + rm -f objsqlite3.dll libobjsqlite3.${OBJSQLITE3_LIB_MAJOR}.dylib + if test -f ../src/libobjsqlite3.so; then \ + ${LN_S} ../src/libobjsqlite3.so \ + libobjsqlite3.so.${OBJSQLITE3_LIB_MAJOR}; \ + ${LN_S} ../src/libobjsqlite3.so \ + libobjsqlite3.so.${OBJSQLITE3_LIB_MAJOR_MINOR}; \ + elif test -f ../src/libobjsqlite3.so.${OBJSQLITE3_LIB_MAJOR_MINOR}; \ + then \ + ${LN_S} ../src/libobjsqlite3.so.${OBJSQLITE3_LIB_MAJOR_MINOR} \ + libobjsqlite3.so.${OBJSQLITE3_LIB_MAJOR_MINOR}; \ + fi + if test -f ../src/objsqlite3.dll; then \ + ${LN_S} ../src/objsqlite3.dll objsqlite3.dll; \ + fi + if test -f ../src/libobjsqlite3.dylib; then \ + ${LN_S} ../src/libobjsqlite3.dylib \ + libobjsqlite3.${OBJSQLITE3_LIB_MAJOR}.dylib; \ + fi + LD_LIBRARY_PATH=.$${LD_LIBRARY_PATH+:}$$LD_LIBRARY_PATH \ + DYLD_FRAMEWORK_PATH=../src:../src/runtime$${DYLD_FRAMEWORK_PATH+:}$$DYLD_FRAMEWORK_PATH \ + DYLD_LIBRARY_PATH=.$${DYLD_LIBRARY_PATH+:}$$DYLD_LIBRARY_PATH \ + LIBRARY_PATH=.$${LIBRARY_PATH+:}$$LIBRARY_PATH \ + ${WRAPPER} ./${PROG_NOINST}; EXIT=$$?; \ + rm -f libobjsqlite3.so.${OBJSQLITE3_LIB_MAJOR}; \ + rm -f objsqlite3.so.${OBJSQLITE3_LIB_MAJOR_MINOR} objsqlite3.dll; \ + rm -f libobjsqlite3.${OBJSQLITE3_LIB_MAJOR}.dylib; \ + exit $$EXIT + +${PROG_NOINST}: ${LIBOBJSQLITE3_DEP} + +CPPFLAGS += -I../src +LIBS := ${OBJFW_LIBS} ${LIBS} +LD = ${OBJC} ADDED tests/Tests.m Index: tests/Tests.m ================================================================== --- /dev/null +++ tests/Tests.m @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2020, Jonathan Schleifer + * + * https://fossil.nil.im/objsqlite3 + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice is present in all copies. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + + +#import + +#import "SL3Connection.h" + +@interface Tests: OFObject +@end + +OF_APPLICATION_DELEGATE(Tests) + +@implementation Tests +- (void)applicationDidFinishLaunching +{ + [OFApplication terminate]; +} +@end