testing crash

This commit is contained in:
2018-11-30 14:27:11 +01:00
parent d0919862da
commit 829e8c0b62
12 changed files with 40 additions and 4 deletions

View File

@@ -24,6 +24,10 @@ std::mutex task_mutex;
{
NSSharingService *airdrop_service;
}
- (void)hockeyapp_crash
{
[[[BITHockeyManager sharedHockeyManager] crashManager] generateTestCrash];
}
- (void)async_lock
{
CGLLockContext([glctx CGLContextObj]);

View File

@@ -26,4 +26,5 @@
- (std::string)pick_file:(NSArray<NSString*>*)types;
- (std::string)pick_dir;
- (void)share_file:(NSString*)file_path;
- (void)hockeyapp_crash;
@end

View File

@@ -16,6 +16,6 @@
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options;
- (float)sonarpen_pressure;
- (void)hockeyapp_crash;
@end

View File

@@ -27,6 +27,11 @@
return true;
}
- (void)hockeyapp_crash
{
[[[BITHockeyManager sharedHockeyManager] crashManager] generateTestCrash];
}
- (float)sonarpen_pressure
{
return [sonarpen_driver isPenAttached] ? [sonarpen_driver pressure] : 1.f;
@@ -56,7 +61,7 @@
[[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"c2dccca196294ecca8fd5d58af2738cf"];
// Do some additional configuration if needed here
[[BITHockeyManager sharedHockeyManager] startManager];
[[BITHockeyManager sharedHockeyManager].authenticator authenticateInstallation];
//[[BITHockeyManager sharedHockeyManager].authenticator authenticateInstallation];
// sonarpen_driver = [[WTSonarPenDriver alloc] initWithApplication:application];
// [sonarpen_driver start];
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(penStatusChanged) name:WTSonarPenDriverStateChangedNotification object:nil];

View File

@@ -27,4 +27,5 @@
- (void)pick_photo:(std::function<void(std::string)>) callback;
- (void)registerForKeyboardNotifications;
- (void)unregisterForKeyboardNotifications;
- (void)crash;
@end

View File

@@ -42,6 +42,11 @@ NSThread* lock_thread;
std::recursive_mutex lock_mutex;
@implementation GameViewController
- (void)crash
{
AppDelegate* app = (AppDelegate*)[[UIApplication sharedApplication] delegate];
[app hockeyapp_crash];
}
- (void)async_lock
{
lock_mutex.lock();

View File

@@ -964,6 +964,10 @@ Here's a list of what's available in this release.
<icon icon="bug" width="20"/>
<text id="menu-label" text="What's new?" margin="0 0 0 5" font-face="arial" font-size="11"/>
</button-custom>
<button-custom id="about-crash" height="40" align="center" color=".2" pad="0 0 0 10" dir="row">
<icon icon="bug" width="20"/>
<text id="menu-label" text="Induce crash" margin="0 0 0 5" font-face="arial" font-size="11"/>
</button-custom>
</popup-menu>
</layout>

View File

@@ -7,7 +7,7 @@ import re, subprocess, sys
branch = check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]).rstrip().decode("utf-8")
shorthash = check_output(["git", "log", "--pretty=format:%h", "-n 1"]).rstrip().decode("utf-8")
revcount = int(check_output(["git", "rev-list", "--count", "HEAD"]))
tag = check_output(["git", "describe", "--tags", "--abbrev=0"]).rstrip().decode("utf-8")
tag = check_output(["git", "describe", "--tags", "--abbrev=0"]).rstrip().decode("utf-8").split('-',1)[0]
config = sys.argv[2].lower()
version = "%s.%d (%s-%s-%s)" % (tag, revcount, shorthash, branch, config)

View File

@@ -7,7 +7,7 @@ import re, subprocess, sys
branch = check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]).rstrip().decode("utf-8")
shorthash = check_output(["git", "log", "--pretty=format:%h", "-n 1"]).rstrip().decode("utf-8")
revcount = int(check_output(["git", "rev-list", "--count", "HEAD"]))
tag = check_output(["git", "describe", "--tags", "--abbrev=0"]).rstrip().decode("utf-8")
tag = check_output(["git", "describe", "--tags", "--abbrev=0"]).rstrip().decode("utf-8").split('-',1)[0]
config = sys.argv[1].lower()
version = "%s.%d (%s-%s-%s)" % (tag, revcount, shorthash, branch, config)

View File

@@ -197,6 +197,7 @@ public:
int res_from_index(int i);
int res_to_index(int res);
std::string res_to_string(int res);
void crash_test();
void cmd_convert(std::string pano_path, std::string out_path);
};

View File

@@ -9,6 +9,15 @@ std::string win32_open_file(const char* filter);
std::string win32_open_dir();
#endif
void App::crash_test()
{
#ifdef __IOS__
[ios_view crash];
#elif __OSX__
[osx_view hockeyapp_crash];
#elif __ANDROID__
#endif
}
void App::tick(float dt)
{

View File

@@ -601,6 +601,12 @@ void App::init_menu_about()
popup->destroy();
};
}
if (auto b = popup->find<NodeButtonCustom>("about-crash"))
b->on_click = [this](Node*) {
LOG("crashing");
App::I.crash_test();
};
};
}
}