Skip to content

Commit

Permalink
Test added for CosmosOS#126.
Browse files Browse the repository at this point in the history
  • Loading branch information
mterwoord committed Jun 27, 2015
1 parent c1851c9 commit 21c0e35
Show file tree
Hide file tree
Showing 6 changed files with 237 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Tests/Cosmos.TestRunner/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ static void Main(string[] args)
var xEngine = new Engine();

xEngine.AddKernel(typeof(Cosmos.Compiler.Tests.SimpleWriteLine.Kernel.Kernel).Assembly.Location);
//xEngine.AddKernel(typeof(Cosmos.Compiler.Tests.SimpleWriteLine.Kernel.Kernel).Assembly.Location);

// known bugs, therefor disabled for now:
//xEngine.AddKernel(typeof(Cosmos.Compiler.Tests.Interfaces.Kernel.Kernel).Assembly.Location);
//xEngine.AddKernel(typeof(VGACompilerCrash.Kernel).Assembly.Location);

xEngine.OutputHandler = new OutputHandlerXml(@"c:\data\CosmosTests.xml");
//xEngine.OutputHandler = new OutputHandlerConsole();
Expand Down
36 changes: 36 additions & 0 deletions Tests/Staging/VGACompilerCrash/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Package Name")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Company")]
[assembly: AssemblyProduct("Package Name")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: CLSCompliant(false)]
[assembly: NeutralResourcesLanguage("en-US")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]



59 changes: 59 additions & 0 deletions Tests/Staging/VGACompilerCrash/Kernel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Text;
using Cosmos.HAL;
using Sys = Cosmos.System;

namespace VGACompilerCrash
{
public class Kernel : Sys.Kernel
{
public static VGAScreen screen = new VGAScreen();

public void startGraphics()
{
//screen.SetGraphicsMode(VGAScreen.ScreenSize.Size320x200,VGAScreen.ColorDepth.BitDepth8);
//screen.Clear(0);
}

protected override void BeforeRun()
{
Console.WriteLine("Successfully Loaded.");
}

protected override void Run()
{
Console.WriteLine("Welcome. Please login with the administrative credentials provided to you.");
//LOGIN
string username = "";
string password = "";
bool loggedIn = false;
int attempts = 0;
while (!loggedIn)
{
Console.Write("Username:");
username = Console.ReadLine();
Console.Write("Password:");
password = Console.ReadLine();
if (username == "root" && password == "password")
loggedIn = true;
else { attempts++; Console.WriteLine("Error: password mismatch. Try again."); }
if (attempts >= 3)
{
Console.WriteLine("Too many attempts. Please power down."); //add ACPI.Shutdown later
while (!loggedIn) { }
}
}
//END LOGIN
while (loggedIn)
{
Console.Write(">: ");
var input = Console.ReadLine();
if (input == "startx")
{
startGraphics();
}
}
}
}
}
60 changes: 60 additions & 0 deletions Tests/Staging/VGACompilerCrash/VGACompilerCrash.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{21915A7E-CC84-4836-8B87-857B6149D496}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>VGACompilerCrash</RootNamespace>
<AssemblyName>VGACompilerCrash</AssemblyName>
<FileAlignment>512</FileAlignment>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Cosmos.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983, processorArchitecture=MSIL" />
<Reference Include="Cosmos.System, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983, processorArchitecture=MSIL" />
<Reference Include="Cosmos.Debug.Kernel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983, processorArchitecture=MSIL" />
</ItemGroup>
<ItemGroup>
<Compile Include="Kernel.cs" />
<Compile Include="AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\source\Cosmos.HAL\Cosmos.HAL.csproj">
<Project>{6A991D03-1435-4005-9809-B8BACDF3B021}</Project>
<Name>Cosmos.HAL</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
48 changes: 48 additions & 0 deletions Tests/Staging/VGACompilerCrash/VGACompilerCrashBoot.Cosmos
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{78ac2b12-8185-4033-80f0-da5bf874be5e}</ProjectGuid>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
<Name>VGACompilerCrashBoot</Name>
<BinFormat>elf</BinFormat>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<Profile>VMware</Profile>
<!-- Looks like this was a mispelled attribute. Replaced by DebugEnabled below.
<DebugEnable>true</DebugEnable>
-->
<DebugEnabled>true</DebugEnabled>
<DebugMode>Source</DebugMode>
<TraceMode>User</TraceMode>
<EnableGDB>False</EnableGDB>
<StartCosmosGDB>false</StartCosmosGDB>
<VMWareEdition>Player</VMWareEdition>
<OutputPath>bin\Debug\</OutputPath>
<Name>VGACompilerCrashBoot</Name>
<Description>Use VMware Player or Workstation to deploy and debug.</Description>
<Deployment>ISO</Deployment>
<Launch>VMware</Launch>
<VisualStudioDebugPort>Pipe: Cosmos\Serial</VisualStudioDebugPort>
</PropertyGroup>
<ItemGroup>
<Reference Include="Cosmos.Core.Plugs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" />
<Reference Include="Cosmos.System.Plugs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" />
<Reference Include="Cosmos.Debug.Kernel.Plugs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VGACompilerCrash\VGACompilerCrash.csproj">
<Name>VGACompilerCrash</Name>
<Project>{21915a7e-cc84-4836-8b87-857b6149d496}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<!--<ItemGroup>
<Content Include="Cosmos.bxrc">
<SubType>Content</SubType>
</Content>
</ItemGroup>-->
<Import Project="$(MSBuildExtensionsPath)\Cosmos\Cosmos.targets" />
</Project>
33 changes: 33 additions & 0 deletions source/Cosmos.sln
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cosmos.TestRunner", "..\Tes
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cosmos.TestRunner.TestController", "..\Tests\Cosmos.TestRunner.TestController\Cosmos.TestRunner.TestController.csproj", "{E6D3B644-C487-472D-A978-C1A82D0C099B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Staging", "Staging", "{25C3C6E4-1EDD-4542-A663-CAC7A1F40B3A}"
EndProject
Project("{471EC4BB-E47E-4229-A789-D1F5F83B52D4}") = "VGACompilerCrashBoot", "..\Tests\Staging\VGACompilerCrash\VGACompilerCrashBoot.Cosmos", "{78AC2B12-8185-4033-80F0-DA5BF874BE5E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VGACompilerCrash", "..\Tests\Staging\VGACompilerCrash\VGACompilerCrash.csproj", "{21915A7E-CC84-4836-8B87-857B6149D496}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1122,6 +1128,30 @@ Global
{E6D3B644-C487-472D-A978-C1A82D0C099B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{E6D3B644-C487-472D-A978-C1A82D0C099B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{E6D3B644-C487-472D-A978-C1A82D0C099B}.Release|x86.ActiveCfg = Release|Any CPU
{78AC2B12-8185-4033-80F0-DA5BF874BE5E}.Debug|Any CPU.ActiveCfg = Debug|x86
{78AC2B12-8185-4033-80F0-DA5BF874BE5E}.Debug|Itanium.ActiveCfg = Debug|x86
{78AC2B12-8185-4033-80F0-DA5BF874BE5E}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{78AC2B12-8185-4033-80F0-DA5BF874BE5E}.Debug|Mixed Platforms.Build.0 = Debug|x86
{78AC2B12-8185-4033-80F0-DA5BF874BE5E}.Debug|x86.ActiveCfg = Debug|x86
{78AC2B12-8185-4033-80F0-DA5BF874BE5E}.Debug|x86.Build.0 = Debug|x86
{78AC2B12-8185-4033-80F0-DA5BF874BE5E}.Release|Any CPU.ActiveCfg = Debug|x86
{78AC2B12-8185-4033-80F0-DA5BF874BE5E}.Release|Itanium.ActiveCfg = Debug|x86
{78AC2B12-8185-4033-80F0-DA5BF874BE5E}.Release|Mixed Platforms.ActiveCfg = Debug|x86
{78AC2B12-8185-4033-80F0-DA5BF874BE5E}.Release|Mixed Platforms.Build.0 = Debug|x86
{78AC2B12-8185-4033-80F0-DA5BF874BE5E}.Release|x86.ActiveCfg = Debug|x86
{78AC2B12-8185-4033-80F0-DA5BF874BE5E}.Release|x86.Build.0 = Debug|x86
{21915A7E-CC84-4836-8B87-857B6149D496}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{21915A7E-CC84-4836-8B87-857B6149D496}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21915A7E-CC84-4836-8B87-857B6149D496}.Debug|Itanium.ActiveCfg = Debug|Any CPU
{21915A7E-CC84-4836-8B87-857B6149D496}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{21915A7E-CC84-4836-8B87-857B6149D496}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{21915A7E-CC84-4836-8B87-857B6149D496}.Debug|x86.ActiveCfg = Debug|Any CPU
{21915A7E-CC84-4836-8B87-857B6149D496}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21915A7E-CC84-4836-8B87-857B6149D496}.Release|Any CPU.Build.0 = Release|Any CPU
{21915A7E-CC84-4836-8B87-857B6149D496}.Release|Itanium.ActiveCfg = Release|Any CPU
{21915A7E-CC84-4836-8B87-857B6149D496}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{21915A7E-CC84-4836-8B87-857B6149D496}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{21915A7E-CC84-4836-8B87-857B6149D496}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1208,5 +1238,8 @@ Global
{758FAF24-9974-4DB8-82EF-1B64DAF2F0BC} = {79173AE7-4596-4D33-866F-6F94A2314BE8}
{78304B1E-C323-4A78-9E7D-2578E58311B6} = {79173AE7-4596-4D33-866F-6F94A2314BE8}
{E6D3B644-C487-472D-A978-C1A82D0C099B} = {79173AE7-4596-4D33-866F-6F94A2314BE8}
{25C3C6E4-1EDD-4542-A663-CAC7A1F40B3A} = {A06B122A-4AB7-4090-B41A-35028A293450}
{78AC2B12-8185-4033-80F0-DA5BF874BE5E} = {25C3C6E4-1EDD-4542-A663-CAC7A1F40B3A}
{21915A7E-CC84-4836-8B87-857B6149D496} = {25C3C6E4-1EDD-4542-A663-CAC7A1F40B3A}
EndGlobalSection
EndGlobal

0 comments on commit 21c0e35

Please sign in to comment.