From dada9e6af04f5803002a5ee463bc30d3f14de0aa Mon Sep 17 00:00:00 2001 From: tomcw Date: Tue, 15 Aug 2017 21:02:54 +0100 Subject: [PATCH] Add new TestDebugger project with some simple unit-tests for _6502_GetTargets() (#445) --- AppleWinExpress2008.sln | 11 +- AppleWinExpress2008.vcproj | 8 +- test/TestDebugger/TestDebugger.cpp | 195 +++++++++++++++++++++++ test/TestDebugger/TestDebugger.vcproj | 213 ++++++++++++++++++++++++++ test/TestDebugger/stdafx.cpp | 8 + test/TestDebugger/stdafx.h | 16 ++ test/UnitTests.bat | 21 +++ 7 files changed, 466 insertions(+), 6 deletions(-) create mode 100644 test/TestDebugger/TestDebugger.cpp create mode 100644 test/TestDebugger/TestDebugger.vcproj create mode 100644 test/TestDebugger/stdafx.cpp create mode 100644 test/TestDebugger/stdafx.h create mode 100644 test/UnitTests.bat diff --git a/AppleWinExpress2008.sln b/AppleWinExpress2008.sln index 29bd31cc..aa8e1d14 100644 --- a/AppleWinExpress2008.sln +++ b/AppleWinExpress2008.sln @@ -1,12 +1,13 @@  Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AppleWin", "AppleWinExpress2008.vcproj", "{1DA0C491-B5F4-4EC8-B1D2-CF6BE635DADC}" +# Visual C++ Express 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Applewin", "AppleWinExpress2008.vcproj", "{1DA0C491-B5F4-4EC8-B1D2-CF6BE635DADC}" ProjectSection(ProjectDependencies) = postProject {5CE8051A-3F0C-4C39-B1C0-3338E48BA60F} = {5CE8051A-3F0C-4C39-B1C0-3338E48BA60F} {7935B998-C713-42AE-8F6D-9FF9080A1B1B} = {7935B998-C713-42AE-8F6D-9FF9080A1B1B} {2CC8CA9F-E37E-41A4-BFAD-77E54EB783A2} = {2CC8CA9F-E37E-41A4-BFAD-77E54EB783A2} {709278B8-C583-4BD8-90DE-4E4F35A3BD8B} = {709278B8-C583-4BD8-90DE-4E4F35A3BD8B} + {0AE28CF0-15B0-4DDF-B6D2-4562D8E456BB} = {0AE28CF0-15B0-4DDF-B6D2-4562D8E456BB} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib\zlib-Express2008.vcproj", "{7935B998-C713-42AE-8F6D-9FF9080A1B1B}" @@ -17,6 +18,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCPU6502", "test\TestCPU EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yaml", "libyaml\win32\yaml2008.vcproj", "{5CE8051A-3F0C-4C39-B1C0-3338E48BA60F}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestDebugger", "test\TestDebugger\TestDebugger.vcproj", "{0AE28CF0-15B0-4DDF-B6D2-4562D8E456BB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -43,6 +46,10 @@ Global {5CE8051A-3F0C-4C39-B1C0-3338E48BA60F}.Debug|Win32.Build.0 = Debug|Win32 {5CE8051A-3F0C-4C39-B1C0-3338E48BA60F}.Release|Win32.ActiveCfg = Release|Win32 {5CE8051A-3F0C-4C39-B1C0-3338E48BA60F}.Release|Win32.Build.0 = Release|Win32 + {0AE28CF0-15B0-4DDF-B6D2-4562D8E456BB}.Debug|Win32.ActiveCfg = Debug|Win32 + {0AE28CF0-15B0-4DDF-B6D2-4562D8E456BB}.Debug|Win32.Build.0 = Debug|Win32 + {0AE28CF0-15B0-4DDF-B6D2-4562D8E456BB}.Release|Win32.ActiveCfg = Release|Win32 + {0AE28CF0-15B0-4DDF-B6D2-4562D8E456BB}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/AppleWinExpress2008.vcproj b/AppleWinExpress2008.vcproj index 95f88eb8..0402dd56 100644 --- a/AppleWinExpress2008.vcproj +++ b/AppleWinExpress2008.vcproj @@ -26,8 +26,8 @@ > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/TestDebugger/stdafx.cpp b/test/TestDebugger/stdafx.cpp new file mode 100644 index 00000000..f2e94bd5 --- /dev/null +++ b/test/TestDebugger/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// TestDebugger.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/test/TestDebugger/stdafx.h b/test/TestDebugger/stdafx.h new file mode 100644 index 00000000..4bb17e80 --- /dev/null +++ b/test/TestDebugger/stdafx.h @@ -0,0 +1,16 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include +#include + +#include +#include + +#include +#include +#include diff --git a/test/UnitTests.bat b/test/UnitTests.bat new file mode 100644 index 00000000..86bef100 --- /dev/null +++ b/test/UnitTests.bat @@ -0,0 +1,21 @@ +@REM %1 = +@IF "%~1" == "" GOTO help + +@ECHO Performing unit-test: TestCPU6502 +.\%1\TestCPU6502.exe +@IF errorlevel 1 GOTO failed + +@ECHO Performing unit-test: TestDebugger +.\%1\TestDebugger.exe +@if errorlevel 1 GOTO failed + +@GOTO end + +:failed +@ECHO Unit-test failed +EXIT /B 1 + +:help +@ECHO %0 "" + +:end \ No newline at end of file