From 26651585c02367011df196ec72a3d0bf84a60f27 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 27 Feb 2012 14:27:34 +0200 Subject: Start of sc filters-test for iOS --- ios/qa/sc/Makefile | 28 ++++++++++++++++ ios/qa/sc/filters-test.m | 84 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 ios/qa/sc/Makefile create mode 100644 ios/qa/sc/filters-test.m (limited to 'ios') diff --git a/ios/qa/sc/Makefile b/ios/qa/sc/Makefile new file mode 100644 index 000000000000..1580ebfd5372 --- /dev/null +++ b/ios/qa/sc/Makefile @@ -0,0 +1,28 @@ +include ../../../config_host.mk + +# Stuff lifted from solenv/gbuild/platform/IOS_ARM_GCC.mk + +gb_OBJC_OBJCXX_COMMON_FLAGS := -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 +gb_OBJCFLAGS := -x objective-c $(gb_OBJC_OBJCXX_COMMON_FLAGS) +gb_OBJCXXFLAGS := -x objective-c++ $(gb_OBJC_OBJCXX_COMMON_FLAGS) + +gb_Library__FRAMEWORKS := \ + Foundation \ + CoreFoundation \ + CoreGraphics \ + UIKit \ + +APP=lo-qa-sc-filters-test +APPDIR=$(APP).app + +SRCS = filters-test.m + +CFLAGS = $(SOLARINC) + +LIBS = -Wl,$(OUTDIR)/bin/cppunit/cppunittester.a -Wl,$(WORKDIR)/LinkTarget/CppunitTest/libtest_sc_filters_test.a -Wl,$(OUTDIR)/lib/unoexceptionprotector.a $(SOLARLIB) -lavmedialo -lbasegfxlo -lcomphelpgcc3 -leditenglo -lfwelo -lfwilo -lfwklo -li18nisolang1gcc3 -li18npaperlo -licuuc -ljpeg -llnglo -lsalcpprt -lsfxlo -lsvllo -lsvtlo -lutllo -lvcllo -lsaxlo -lsclo -lsotlo -ltest -ltklo -ltllo -lucbhelper4gcc3 -lxolo -lcppunit -lunotest -luno_cppuhelpergcc3 -luno_cppu -luno_salhelpergcc3 -luno_sal -lsal_textenc $(addprefix -framework , $(gb_Library__FRAMEWORKS)) -lobjc + +all: $(APPDIR)/$(APP) + +$(APPDIR)/$(APP): $(SRCS) + mkdir -p $(APPDIR) + $(CXX) -o $@ $(CFLAGS) $(gb_OBJCXXFLAGS) $(SRCS) $(LIBS) diff --git a/ios/qa/sc/filters-test.m b/ios/qa/sc/filters-test.m new file mode 100644 index 000000000000..5621f34a7618 --- /dev/null +++ b/ios/qa/sc/filters-test.m @@ -0,0 +1,84 @@ +/* -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2011 Tor Lillqvist (initial developer) + * Copyright (C) 2011 SUSE Linux http://suse.com (initial developer's employer) + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#import + +#include "cppunit/extensions/TestFactoryRegistry.h" +#include "cppunit/plugin/TestPlugIn.h" +//#include "cppunit/plugin/PlugInManager.h" + +extern "C" { + extern CppUnitTestPlugIn *cppunitTestPlugIn(void); + extern int lo_main(int argc, char **argv); +} + +int +main(int argc, char ** argv) +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + int retVal = UIApplicationMain (argc, argv, @"UIApplication", @"loAppDelegate"); + [pool release]; + return retVal; +} + +@interface loAppDelegate : NSObject { +} +@property (nonatomic, retain) UIWindow *window; +@end + +@implementation loAppDelegate + +@synthesize window=_window; + +- (BOOL)application: (UIApplication *) application +didFinishLaunchingWithOptions: (NSDictionary *) launchOptions +{ + (void) application; + (void) launchOptions; + + UIWindow *uiw = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + uiw.backgroundColor = [UIColor redColor]; + self.window = uiw; + [uiw release]; + + CppUnitTestPlugIn *iface = cppunitTestPlugIn(); + iface->initialize(&CppUnit::TestFactoryRegistry::getRegistry(), CppUnit::PlugInParameters()); + + // Temporarily until we actualy get this to link, then + // add actual args needed by cppunittester + lo_main(0, NULL); + + [self.window makeKeyAndVisible]; + return YES; +} + +@end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ + -- cgit