Beginnings of trace testing on Droid

- Currently broken because !CONFORMANT_TRACKS
This commit is contained in:
Aaron Culliney 2017-05-28 08:45:04 -10:00
parent e1f0557b87
commit 4c893cc197
6 changed files with 63 additions and 5 deletions

View File

@ -95,6 +95,8 @@ elif test "$(basename $0)" = "testdisplay" ; then
ln -s testdisplay.mk Android.mk
elif test "$(basename $0)" = "testprefs" ; then
ln -s testprefs.mk Android.mk
elif test "$(basename $0)" = "testtrace" ; then
ln -s testtrace.mk Android.mk
elif test "$(basename $0)" = "testui" ; then
ln -s testui.mk Android.mk
elif test "$(basename $0)" = "testvm" ; then

1
Android/jni/testtrace Symbolic link
View File

@ -0,0 +1 @@
build.sh

34
Android/jni/testtrace.mk Normal file
View File

@ -0,0 +1,34 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
PACKAGE_IDENTIFIER := "org.deadc0de.apple2ix"
PACKAGE_NAME := "apple2ix"
COMMON_SOURCES_MK := $(LOCAL_PATH)/sources.mk
include $(COMMON_SOURCES_MK)
# -----------------------------------------------------------------------------
# Android build config
LOCAL_MODULE := libapple2ix
LOCAL_SRC_FILES := $(APPLE2_SRC_PATH)/test/testcommon.c $(APPLE2_SRC_PATH)/test/testtrace.c
LOCAL_CFLAGS := $(APPLE2_BASE_CFLAGS) -g -DTEST_TRACE=1 -DTESTING=1 -DCPU_TRACING=1 -DDISK_TRACING=1 -DSPEAKER_TRACING=1 -DMB_TRACING=1 -I$(APPLE2_SRC_PATH)/test
LOCAL_LDLIBS := $(APPLE2_BASE_LDLIBS)
# Add assembly files first ... mostly for the benefit of the ARM assembler ...
ifeq ($(TARGET_ARCH_ABI),x86)
LOCAL_SRC_FILES += $(APPLE2_X86_SRC)
LOCAL_CFLAGS += -DNO_UNDERSCORES=1
else
LOCAL_SRC_FILES += $(APPLE2_ARM_SRC)
endif
LOCAL_SRC_FILES += $(APPLE2_MAIN_SRC) $(APPLE2_META_SRC) $(APPLE2_VIDEO_SRC) $(APPLE2_AUDIO_SRC)
# Build a shared library and let Java/Dalvik drive
include $(BUILD_SHARED_LIBRARY)
# --OR-- Build an executable so native can drive this show
#include $(BUILD_EXECUTABLE)
$(call import-module, android/cpufeatures)

View File

@ -52,6 +52,7 @@
# include "audio/mockingboard.h" // For g_uTimer1IrqCount
# if TESTING
# include "greatest.h"
# undef fprintf // greatest redefines fprintf on Droid!
# endif
#endif

View File

@ -115,7 +115,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# include <sys/io.h>
# endif
# if TESTING
# include "greatest.h"
# include "greatest.h"
# undef fprintf // greatest redefines fprintf on Droid!
# endif
#if defined(FAILED)

View File

@ -55,18 +55,37 @@ static void testspeaker_cyclesOverflow(void) {
}
TEST test_timing_overflow() {
test_setup_boot_disk(BLANK_DSK, /*readonly:*/1);
c_debugger_set_timeout(1);
ASSERT(!cycles_overflowed);
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] != TEST_FINISHED);
// force an almost overflow
testing_getCyclesCount = &testspeaker_getCyclesCount;
testing_cyclesOverflow = &testspeaker_cyclesOverflow;
ASSERT(!cycles_overflowed);
test_setup_boot_disk(BLANK_DSK, /*readonly:*/1);
BOOT_TO_DOS();
extern volatile uint8_t emul_reinitialize;
do {
emul_reinitialize = 1;
c_debugger_go();
if (cycles_overflowed) {
break;
}
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] != TEST_FINISHED);
} while (1);
ASSERT(cycles_overflowed);
c_debugger_set_timeout(0);
c_debugger_go();
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
// appears emulator handled cycle count overflow gracefully ...
testing_getCyclesCount = NULL;
testing_cyclesOverflow = NULL;