summaryrefslogtreecommitdiff
path: root/ios
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2012-02-27 14:27:34 +0200
committerTor Lillqvist <tml@iki.fi>2012-02-27 14:29:59 +0200
commit26651585c02367011df196ec72a3d0bf84a60f27 (patch)
tree2a79b7691c387e0d237cb905b0c602fc33bbbf86 /ios
parentee0cb9d05d11c23421ec5ddddd7b268eb8c5e049 (diff)
Start of sc filters-test for iOS
Diffstat (limited to 'ios')
-rw-r--r--ios/qa/sc/Makefile28
-rw-r--r--ios/qa/sc/filters-test.m84
2 files changed, 112 insertions, 0 deletions
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 <tml@iki.fi> (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 <UIKit/UIKit.h>
+
+#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 <UIApplicationDelegate> {
+}
+@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: */
+