Kaydet (Commit) 68de1021 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Start on the iOS unit test app

Change-Id: Idef0b375d5c7d6d4542aee1f8abecaf9f834189c
Reviewed-on: https://gerrit.libreoffice.org/61058Reviewed-by: 's avatarTor Lillqvist <tml@collabora.com>
Tested-by: 's avatarTor Lillqvist <tml@collabora.com>
üst 7f7e890a
......@@ -21,8 +21,7 @@ IOSDIRS = $(IOSGEN) \
$(IOSRES)/program \
$(IOSRES)/share \
$(IOSRES)/config \
$(IOSRES)/filter \
$(WORKDIR)/ios
$(IOSRES)/filter
#- Top level -----------------------------------------------------------------
......@@ -41,13 +40,10 @@ $(IOSDIRS):
$(IOSGEN)/native-code.h: $(BUILDDIR)/config_host.mk \
$(SRCDIR)/ios/CustomTarget_iOS_setup.mk \
$(SRCDIR)/solenv/bin/native-code.py \
$(IOSGEN) $(WORKDIR)/ios \
$(IOSGEN) \
$(IOSDIRS)
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),EN2,2)
# Secure LibreOffice.c get build if there are changes
rm -rf $(WORKDIR)/ios/*
# generate native-code.h (used by LibreOffice.c)
$(SRCDIR)/solenv/bin/native-code.py \
-C -g core -g writer -g calc -g draw -g edit \
......@@ -111,7 +107,6 @@ $(IOSGEN)/native-code.h: $(BUILDDIR)/config_host.mk \
#- clean ios -----------------------------------------------------------------
$(call gb_CustomTarget_get_clean_target,ios/iOS_setup):
$(call gb_Output_announce,$(subst $(WORKDIR)/Clean/,,$@),$(false),ENV,2)
rm -rf $(IOSRES)/* $(IOSGEN)/native-code.h $(IOSGEN)/build
rm -rf $(WORKDIR)/ios
rm -rf $(IOSRES)/* $(IOSGEN)/native-code.h $(IOSGEN)
# vim: set noet sw=4 ts=4:
This diff is collapsed.
/* -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property(strong, nonatomic) UIWindow* window;
@end
/* -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#import "AppDelegate.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
/* -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <cassert>
#include <iostream>
#include <sal/config.h>
#include <cppuhelper/exc_hlp.hxx>
#include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
#include <com/sun/star/uno/Any.hxx>
#include <cppunit/CompilerOutputter.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/TestRunner.h>
#include <cppunit/TextTestProgressListener.h>
#import <LibreOfficeKit/LibreOfficeKit.hxx>
extern "C" {
#import <native-code.h>
}
#include <premac.h>
#import "ViewController.h"
#include <postmac.h>
@interface ViewController ()
@end
#define CPPUNIT_PLUGIN_EXPORTED_NAME CppuMisc
#include "../../../cppuhelper/qa/misc/test_misc.cxx"
#undef CPPUNIT_PLUGIN_EXPORTED_NAME
#define CPPUNIT_PLUGIN_EXPORTED_NAME CppuUnourl
#include "../../../cppuhelper/qa/unourl/cppu_unourl.cxx"
#define main tilebench_main
#include "../../../libreofficekit/qa/tilebench/tilebench.cxx"
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// First run some normal cppunit tests
CppUnit::TestResult result;
CppUnit::TextTestProgressListener logger;
result.addListener(&logger);
CppUnit::TestResultCollector collector;
result.addListener(&collector);
CppUnit::TestRunner runner;
runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
runner.run(result);
CppUnit::CompilerOutputter outputter(&collector, std::cerr);
outputter.write();
// Then some more specific stuff
tilebench_main(0, nullptr);
}
@end
/* -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
......@@ -286,12 +286,13 @@ static void testDialog( Document *pDocument, const char *uno_cmd )
int main( int argc, char* argv[] )
{
int arg;
int arg = 2;
origin = getTimeNow();
#ifndef IOS
// avoid X oddness etc.
unsetenv("DISPLAY");
origin = getTimeNow();
if( argc < 4 ||
( argc > 1 && ( !strcmp( argv[1], "--help" ) || !strcmp( argv[1], "-h" ) ) ) )
return help();
......@@ -302,7 +303,6 @@ int main( int argc, char* argv[] )
return 1;
}
arg = 2;
const char *doc_url = argv[arg++];
const char *mode = argv[arg++];
......@@ -325,10 +325,18 @@ int main( int argc, char* argv[] )
lok_preinit(argv[1], user_url.c_str());
aTimes.emplace_back();
}
const char *install_path = argv[1];
const char *user_profile = user_url.c_str();
#else
const char *install_path = nullptr;
const char *user_profile = nullptr;
const char *doc_url = strdup([[[[[NSBundle mainBundle] bundleURL] absoluteString] stringByAppendingString:@"/test.odt"] UTF8String]);
const char *mode = "--tile";
#endif
aTimes.emplace_back("initialization");
// coverity[tainted_string] - build time test tool
Office *pOffice = lok_cpp_init(argv[1], user_url.c_str());
Office *pOffice = lok_cpp_init(install_path, user_profile);
if (pOffice == nullptr)
{
fprintf(stderr, "Failed to initialize Office from %s\n", argv[1]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment