Tests are starting to run in iOS simulator

This commit is contained in:
Aaron Culliney 2016-06-26 17:30:58 -07:00
parent 3b6b568fc2
commit 7af88b3568
9 changed files with 1588 additions and 29 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,77 @@
<?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>en</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array/>
<key>CFBundleTypeName</key>
<string>Dsk Images</string>
<key>LSItemContentTypes</key>
<array>
<string>com.apple2ios.dskinfo</string>
</array>
</dict>
</array>
<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>0.9.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIFileSharingEnabled</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>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeDescription</key>
<string>dsk</string>
<key>UTTypeIdentifier</key>
<string>com.apple2ios.dskinfo</string>
<key>UTTypeSize64IconFile</key>
<string>floppy</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>dsk</string>
</dict>
</dict>
</array>
</dict>
</plist>

View File

@ -0,0 +1,77 @@
<?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>en</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array/>
<key>CFBundleTypeName</key>
<string>Dsk Images</string>
<key>LSItemContentTypes</key>
<array>
<string>com.apple2ios.dskinfo</string>
</array>
</dict>
</array>
<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>0.9.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIFileSharingEnabled</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>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeDescription</key>
<string>dsk</string>
<key>UTTypeIdentifier</key>
<string>com.apple2ios.dskinfo</string>
<key>UTTypeSize64IconFile</key>
<string>floppy</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>dsk</string>
</dict>
</dict>
</array>
</dict>
</plist>

View File

@ -0,0 +1,77 @@
<?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>en</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array/>
<key>CFBundleTypeName</key>
<string>Dsk Images</string>
<key>LSItemContentTypes</key>
<array>
<string>com.apple2ios.dskinfo</string>
</array>
</dict>
</array>
<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>0.9.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIFileSharingEnabled</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>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeDescription</key>
<string>dsk</string>
<key>UTTypeIdentifier</key>
<string>com.apple2ios.dskinfo</string>
<key>UTTypeSize64IconFile</key>
<string>floppy</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>dsk</string>
</dict>
</dict>
</array>
</dict>
</plist>

View File

@ -0,0 +1,77 @@
<?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>en</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array/>
<key>CFBundleTypeName</key>
<string>Dsk Images</string>
<key>LSItemContentTypes</key>
<array>
<string>com.apple2ios.dskinfo</string>
</array>
</dict>
</array>
<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>0.9.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIFileSharingEnabled</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>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeDescription</key>
<string>dsk</string>
<key>UTTypeIdentifier</key>
<string>com.apple2ios.dskinfo</string>
<key>UTTypeSize64IconFile</key>
<string>floppy</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>dsk</string>
</dict>
</dict>
</array>
</dict>
</plist>

View File

@ -81,6 +81,40 @@
glBindFramebuffer(GL_FRAMEBUFFER, _defaultFBOName);
#if TESTING
char *local_argv[] = {
"-f",
NULL
};
int local_argc = 0;
for (char **p = &local_argv[0]; *p != NULL; p++) {
++local_argc;
}
# if TEST_CPU
// Currently this test is the only one that blocks current thread and runs as a black screen
extern int test_cpu(int, char *[]);
test_cpu(local_argc, local_argv);
# elif TEST_VM
extern int test_vm(int, char *[]);
test_vm(local_argc, local_argv);
# elif TEST_DISPLAY
extern int test_display(int, char *[]);
test_display(local_argc, local_argv);
# elif TEST_DISK
extern int test_disk(int, char *[]);
test_disk(local_argc, local_argv);
# elif TEST_PREFS
extern void test_prefs(int, char *[]);
test_prefs(local_argc, local_argv);
# elif TEST_TRACE
extern void test_trace(int, char *[]);
test_trace(local_argc, local_argv);
# else
# error "OOPS, no testsuite specified"
# endif
#endif
// start emulator from paused state
cpu_pause();
emulator_start();

View File

@ -82,7 +82,7 @@ src/font.c: src/font.txt genfont
src/rom.c: genrom
./genrom src/rom/apple_IIe.rom src/rom/slot6.rom > $@
src/x86/glue.S: src/disk.c src/vm.c src/display.c src/vm.c src/cpu-supp.c @AUDIO_GLUE_C@
src/x86/glue.S: src/cpu-supp.c src/disk.c src/display.c src/vm.c @AUDIO_GLUE_C@
./src/x86/genglue $^ > $@
###############################################################################

View File

@ -754,9 +754,6 @@ const char *disk6_eject(int drive) {
ERRLOG("Error close()ing file %s", disk6.disk[drive].file_name);
}
#ifdef __APPLE__
# warning FIXME TODO : can we not inflate/deflate disk images within the iOS port? Maybe this is just a permission thing?
#else
// foo.dsk -> foo.dsk.gz
pthread_mutex_lock(&unlink_mutex);
err = zlib_deflate(disk6.disk[drive].file_name, is_nib(disk6.disk[drive].file_name) ? NIB_SIZE : DSK_SIZE);
@ -766,7 +763,6 @@ const char *disk6_eject(int drive) {
unlink(disk6.disk[drive].file_name);
}
pthread_mutex_unlock(&unlink_mutex);
#endif
}
FREE(disk6.disk[drive].file_name);

View File

@ -113,6 +113,24 @@ int test_setup_boot_disk(const char *fileName, int readonly) {
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFStringRef fileString = CFStringCreateWithCString(/*allocator*/NULL, fileName, CFStringGetSystemEncoding());
CFURLRef fileURL = CFBundleCopyResourceURL(mainBundle, fileString, NULL, NULL);
if (!fileURL) {
CFRELEASE(fileString);
char *fileName2 = NULL;
ASPRINTF(&fileName2, "disks/demo/%s", fileName);
fileString = CFStringCreateWithCString(/*allocator*/NULL, fileName2, CFStringGetSystemEncoding());
FREE(fileName2);
fileURL = CFBundleCopyResourceURL(mainBundle, fileString, NULL, NULL);
if (!fileURL) {
CFRELEASE(fileString);
ASPRINTF(&fileName2, "disks/blanks/%s", fileName);
fileString = CFStringCreateWithCString(/*allocator*/NULL, fileName2, CFStringGetSystemEncoding());
FREE(fileName2);
fileURL = CFBundleCopyResourceURL(mainBundle, fileString, NULL, NULL);
}
assert(fileURL);
}
CFStringRef filePath = CFURLCopyFileSystemPath(fileURL, kCFURLPOSIXPathStyle);
CFRELEASE(fileString);
CFRELEASE(fileURL);