Skip to content

Commit

Permalink
Added images and JSON output
Browse files Browse the repository at this point in the history
  • Loading branch information
texhex committed Jan 11, 2015
1 parent 92a7318 commit dc222dd
Show file tree
Hide file tree
Showing 28 changed files with 234 additions and 34 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Expand Up @@ -3,15 +3,15 @@ IMPROVEMENTS:

* Reworked Wiki for creating custom scripts
* Setup does now show the full path where the modules are installed
* Added Lightweight C# Command Line Parser for Xteq5CLI (http://www.codeproject.com/Articles/39120/Lightweight-C-Command-Line-Parser)
* Added Xteq5CLI
* Added Lightweight C# Command Line Parser for Xteq5CLI (http://www.codeproject.com/Articles/39120/Lightweight-C-Command-Line-Parser)
* Added Xteq5UserInterface library
* Added SimplifiedXteq5Runner for *UI programs (Xteq5GUI and Xteq5CLI)
* Rewritten HTMLBootstrapGenerator using new BaseTemplateReplaceGenerator class
* Renamed HTML template to "BootstrapTemplate.html"
* Added XML and JSON output formats
* Improvments for Xteq5Engine


BUG FIXES:

* Fixed bug in all scripts, #requires was missing the _s_ at the end
Expand Down
10 changes: 6 additions & 4 deletions README.md
Expand Up @@ -8,9 +8,9 @@ About Xteq5

A known issues testing framework, powered by PowerShell scripts.

Why you want to use it: Computer systems today are complex. Some years ago, if software A did not run, the reason was A requires B and B is not installed. Today it’s more like A does not run because B is not working as the value C in D is not set by E.
Computer systems today are complex. Some years ago, if software A did not run, the reason was "A requires B and B is not installed". Today it’s more like "A does not run because B is not working as the value C in D is not set by E".

Using Xteq5, you could now write PowerShell scripts that test A, B, C, D and E. The generated HTML report ([Example][_examplereport]) will then inform you if, and what, isn’t right. From that time on, you don’t have to remember this case anymore. Just run Xteq5 again and you will be informed in seconds.
Using Xteq5, you could now write PowerShell scripts that test A, B, C, D and E. The generated HTML report ([Example][_examplereport]) will then inform you if, and what, isn’t right. From that time on, you don’t have to remember this case anymore. Just run Xteq5 again and you will be informed in seconds. This can also be done silently using the command line, resulting in a XML or JSON report for further automated processing.

This procedure can lead to cost savings if you have separated 1st and 2nd level support teams. The 1st level support can check with Xteq5 if the problem is already known and fix it without escalating to 2nd level. This means higher first call resolution rates for 1st level and less tickets for 2nd level.

Expand All @@ -30,15 +30,15 @@ The most recent version can be downloaded from [Releases][_downloads].
<!-- These links are also used in /src/setup/_Setup.iss -->

* Windows 7 SP1 / Windows Server 2008 SP2 (or higher)
* 256MB free memory, 5 MB free disk space
* 256MB free memory, 6 MB free disk space
* [.NET Framework 4.5][_netframework] (or higher)
* [PowerShell 4.0][_wmf] (or higher)
* Download links are provided by Setup.exe if one of the components is not installed


##<a name="docs">Documentation</a>

Please see the [Xteq5 Wiki][_wiki] for [How to use][_wiki_howto] and about creating [custom scripts][_wiki_customscripts].
Please see the [Xteq5 Wiki][_wiki] for [How to use][_wiki_howto] it, creating your [own assets or tests][_wiki_customscripts], [customize][_wiki_setup] the installation or utilizing the [command line interface][_wiki_cli].

##<a name="contribute">Contributions</a>

Expand Down Expand Up @@ -85,4 +85,6 @@ Licensed under the **Apache License, Version 2.0**. For details, please see [LIC
[_wiki]: https://github.com/texhex/xteq5/wiki
[_wiki_howto]: https://github.com/texhex/xteq5/wiki/How-to-use
[_wiki_customscripts]: https://github.com/texhex/xteq5/wiki/Custom-scripts
[_wiki_setup]: https://github.com/texhex/xteq5/wiki/Setup-customization
[_wiki_cli]: https://github.com/texhex/xteq5/wiki/Command-line-interface

3 changes: 3 additions & 0 deletions images/Convert_Icons.bat
Expand Up @@ -11,4 +11,7 @@ SET EXE_CONVERT=C:\_Tools\ImageMagick-6.9.0-2\convert.exe
REM -colors 256
"%EXE_CONVERT%" Xteq5_Icon_16x16.ico Xteq5_Icon_32x32.ico Xteq5_Icon_48x48.ico Xteq5_Icon.ico

"%EXE_CONVERT%" Xteq5_Icon_Secondary_16x16.ico Xteq5_Icon_Secondary_32x32.ico Xteq5_Icon_Secondary_48x48.ico Xteq5_Icon_Secondary.ico


pause
Binary file added images/Xteq5_Icon_Secondary.ico
Binary file not shown.
Binary file added images/Xteq5_Icon_Secondary_16x16.ico
Binary file not shown.
Binary file added images/Xteq5_Icon_Secondary_32x32.ico
Binary file not shown.
Binary file added images/Xteq5_Icon_Secondary_48x48.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion licenses/LICENSE-CPOL.htm
@@ -1,4 +1,4 @@
?<html>
<html>
<head>
<title>The Code Project Open License (CPOL)</title>
<Style>
Expand Down
10 changes: 9 additions & 1 deletion licenses/LICENSE.txt
Expand Up @@ -67,7 +67,15 @@ Licensed under the Inno Setup License
http://www.jrsoftware.org/files/is/license.txt
The license is distributed with this software as LICENSE-InnoSetup.txt



JSON.NET
Copyright (c) 2007 James Newton-King
http://james.newtonking.com/json
Licensed under the MIT License
https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md
The license is distributed with this software as LICENSE-JSON.NET.txt


This product includes software developed by Jon Skeet
http://www.jonskeet.uk/
Copyright (c) 2004-2006 Jon Skeet. All rights reserved.
Expand Down
4 changes: 2 additions & 2 deletions scripts/XMLtemplate.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Xteq5 XML template version 1.06
<!-- Xteq5 XML template version 1.06 -->
<!--
It is assumed that this file will be used for automatic processing.
Therefore it contains only the minimum required information in order to reduce the file size.
-->
Expand Down
2 changes: 1 addition & 1 deletion src/Readme.md
Expand Up @@ -14,7 +14,7 @@
## Projects
- `HeadlessPS` is a library to run scripts using PowerShell.
- `Xteq5Engine` is the main library and uses HeadlessPS to run assets and tests.
- `Xteq5OutputGenerator` is used to generate output files (HTML, XML) from a report
- `Xteq5OutputGenerator` is used to generate output files (HTML, XML, JSON) from a report
- `Xteq5UserInterface` contains helper functions for a program that interacts with a user
- `Xteq5GUI` (Xteq5.exe) is the GUI used to operate Xteq5, it uses all four libraries above.
- `Xteq5CLI` (Xteq5Cli.exe) is a command line interface for Xteq5, it uses all four libraries above.
Expand Down
13 changes: 12 additions & 1 deletion src/Setup/Setup.iss
Expand Up @@ -149,7 +149,7 @@ Source: "scripts\*.*"; DestDir: "{commonappdata}\Xteq5\"; Flags: ignoreversion r
;All license files go to \licenses
Source: "licenses\*.*"; DestDir: "{app}\licenses"; Flags: ignoreversion recursesubdirs;

;Xteq5Launcher
;Xteq5Launcher (Does not use ann DLLs)
Source: "src\Xteq5Launcher\bin\release\*.exe"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs;
Source: "src\Xteq5Launcher\bin\release\*.config"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs;

Expand All @@ -163,6 +163,17 @@ Source: "src\Xteq5GUI\bin\x86\release\*.exe"; DestDir: "{app}\32bit"; Flags: ign
Source: "src\Xteq5GUI\bin\x86\release\*.dll"; DestDir: "{app}\32bit"; Flags: ignoreversion recursesubdirs;
Source: "src\Xteq5GUI\bin\x86\release\*.config"; DestDir: "{app}\32bit"; Flags: ignoreversion recursesubdirs;

;Xteq5CLI (64 bit)
Source: "src\Xteq5CLI\bin\x64\release\*.exe"; DestDir: "{app}\64bit"; Flags: ignoreversion recursesubdirs;
Source: "src\Xteq5CLI\bin\x64\release\*.dll"; DestDir: "{app}\64bit"; Flags: ignoreversion recursesubdirs;
Source: "src\Xteq5CLI\bin\x64\release\*.config"; DestDir: "{app}\64bit"; Flags: ignoreversion recursesubdirs;

;Xteq5CLI (32 bit)
Source: "src\Xteq5CLI\bin\x86\release\*.exe"; DestDir: "{app}\32bit"; Flags: ignoreversion recursesubdirs;
Source: "src\Xteq5CLI\bin\x86\release\*.dll"; DestDir: "{app}\32bit"; Flags: ignoreversion recursesubdirs;
Source: "src\Xteq5CLI\bin\x86\release\*.config"; DestDir: "{app}\32bit"; Flags: ignoreversion recursesubdirs;



[Ini]
;Create VERSION.ini to allow the user to easily see the version currently installed.
Expand Down
2 changes: 1 addition & 1 deletion src/SharedAssemblyInfo.cs
Expand Up @@ -8,7 +8,7 @@

[assembly: AssemblyTitle("Xteq5")] //Explorer: File description
[assembly: AssemblyProduct("http://www.xteq5.com/")] //Explorer: Product name
[assembly: AssemblyVersion("2.16.*")] //Explorer: Product version
[assembly: AssemblyVersion("2.17.*")] //Explorer: Product version
//[assembly: AssemblyFileVersion("1.0.0.0")] //If not set, AssemblyVersion is also used for AssemblyFileVersion. Explorer: File version


Expand Down
5 changes: 5 additions & 0 deletions src/Xteq5CLI/CMDLineParser.cs
Expand Up @@ -789,6 +789,7 @@ private void SetIdentifiedDecimalSeperator(string parameter)
/// <summary>
/// Command line parsing Exception.
/// </summary>
[Serializable]
public class CMDLineParserException : Exception
{
public CMDLineParserException(string message)
Expand All @@ -798,6 +799,7 @@ public CMDLineParserException(string message)
/// <summary>
/// Thrown when required option was not detected
/// </summary>
[Serializable]
public class MissingRequiredOptionException : CMDLineParserException
{
public MissingRequiredOptionException(string message)
Expand All @@ -807,6 +809,7 @@ public MissingRequiredOptionException(string message)
/// <summary>
/// Thrown when invalid (not registered) options have been detected
/// </summary>
[Serializable]
public class InvalidOptionsException : CMDLineParserException
{
public InvalidOptionsException(string message)
Expand All @@ -816,6 +819,7 @@ public InvalidOptionsException(string message)
/// <summary>
/// Thrown when duplicate option was detected
/// </summary>
[Serializable]
public class DuplicateOptionException : CMDLineParserException
{
public DuplicateOptionException(string message)
Expand All @@ -825,6 +829,7 @@ public DuplicateOptionException(string message)
/// <summary>
/// Thrown when parameter value conversion to specified type failed
/// </summary>
[Serializable]
public class ParameterConversionException : CMDLineParserException
{
public ParameterConversionException(string message)
Expand Down
16 changes: 9 additions & 7 deletions src/Xteq5CLI/WorkInstruction.cs
Expand Up @@ -31,32 +31,34 @@ public WorkInstruction(string[] CommandlineArguments)
CMDLineParser parser = new CMDLineParser();
parser.throwInvalidOptionsException = true;

//Until further notice, no aliases are supported except for HELP.

//Add -Help option
CMDLineParser.Option HelpOption = parser.AddBoolSwitch("-Help", "Displays help");
HelpOption.AddAlias("/?");

//Add -Run option
CMDLineParser.Option RunOption = parser.AddBoolSwitch("-Run", "Required. Execute all files in compilation path");
RunOption.AddAlias("/Run");
//RunOption.AddAlias("/Run");

//Add -Path parameter
CompilationPathOption PathParameter = new CompilationPathOption("-Path", "Compilation path to load scripts from", false);
PathParameter.AddAlias("/Path");
//PathParameter.AddAlias("/Path");
parser.AddOption(PathParameter);

//Add -Format parameter
ReportFormatOption FormatParameter = new ReportFormatOption("-Format", "Format of the report that should be generated (HTML, XML ...)", false);
FormatParameter.AddAlias("/Format");
//FormatParameter.AddAlias("/Format");
parser.AddOption(FormatParameter);

//Add -Filename parameter
FilenameOption FilenameParameter = new FilenameOption("-Filename", "Filename of the generated report", false);
FilenameParameter.AddAlias("/Filename");
//FilenameParameter.AddAlias("/Filename");
parser.AddOption(FilenameParameter);

//Add -Text parameter
CMDLineParser.Option TextParameter = parser.AddStringParameter("-Text", "Additonal text to be included in generated report", false);
FilenameParameter.AddAlias("/Text");
CMDLineParser.Option TextParameter = parser.AddStringParameter("-Text", "Additional text to be included in generated report", false);
//FilenameParameter.AddAlias("/Text");

bool commandLineParsed = false;

Expand Down Expand Up @@ -102,10 +104,10 @@ public WorkInstruction(string[] CommandlineArguments)

//Check for the FORMAT parameter and use HTML if not set
string reportFormatString = OptionIsMatchedAndNotEmpty(FormatParameter) ? FormatParameter.Value.ToString() : "HTML";

//This direct cast without any error checking is OK because FORMATPARAMETER already tried to parse it and will only be set if the value is OK
this.DestinationFormat = OutputFormatConverter.ParseReportFormat(reportFormatString);


this.UserText = OptionIsMatchedAndNotEmpty(TextParameter) ? TextParameter.Value.ToString() : "";

}
Expand Down
6 changes: 6 additions & 0 deletions src/Xteq5CLI/Xteq5CLI.csproj
Expand Up @@ -71,6 +71,9 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Xteq5_Icon_Secondary.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down Expand Up @@ -110,6 +113,9 @@
<Name>Yamua</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Xteq5_Icon_Secondary.ico" />
</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.
Expand Down
3 changes: 3 additions & 0 deletions src/Xteq5CLI/Xteq5CLIMain.cs
Expand Up @@ -23,6 +23,9 @@
-Run -Filename "C:\Temp\daresult.xml" -Format XML
-Run -Filename "C:\Temp\daresult.xml" -Format XML -Text "blah BLUB"
-Run -Path "C:\dev\git\Xteq5\scripts" -Format XML -Filename "C:\Temp\result.xml" -Text "My comment"
-Run -Path "C:\dev\git\Xteq5\scripts" -Format JSON -Filename "C:\Temp\result.json" -Text "My comment"
-Run -Path "C:\dev\git\Xteq5\src\ScriptsForTesting\Test1" -Format JSON -Filename "C:\Temp\result.json" -Text "My comment"
*/
namespace Xteq5CLI
Expand Down
Binary file added src/Xteq5CLI/Xteq5_Icon_Secondary.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions src/Xteq5Engine/Xteq5Runner.cs
Expand Up @@ -13,7 +13,7 @@
namespace Xteq5
{
/// <summary>
/// This allows to run a test suite (Assets and Tests).
/// This processes an compilation folder (Assets and Tests)
/// </summary>
public class Xteq5Runner
{
Expand All @@ -35,7 +35,7 @@ public Report Run(string CompilationPath)
}

/// <summary>
/// Executes all assets and tests found in BasePath asynchronously
/// Executes all assets and tests found in CompilationPath asynchronously
/// </summary>
/// <param name="CompilationPath">Directory to read data from. Must contain the required subfolders ASSETS, TESTS and MODULES.</param>
public async Task<Report> RunAsync(string CompilationPath)
Expand Down
15 changes: 15 additions & 0 deletions src/Xteq5OutputGenerator/BaseGenerator.cs
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Xteq5
{
public abstract class BaseGenerator
{
//Base function that is called by a consumer of an implementation of this class
public abstract string Generate(Report Report);

}
}
8 changes: 7 additions & 1 deletion src/Xteq5OutputGenerator/BaseTemplateReplaceGenerator.cs
Expand Up @@ -11,7 +11,7 @@ namespace Xteq5
/// <summary>
/// A base class for class that reads a template file and then replaces the content with the actual values.
/// </summary>
public abstract class BaseTemplateReplaceGenerator
public abstract class BaseTemplateReplaceGenerator : BaseGenerator
{
protected StringBuilder _content = new StringBuilder();

Expand All @@ -29,6 +29,12 @@ protected void ReadTemplate(string TemplateFilepath)
_content = new StringBuilder(File.ReadAllText(TemplateFilepath, Encoding.UTF8));
}

//Because we require a template, this function can't be used
public override string Generate(Report Report)
{
throw new NotImplementedException();
}

//Base function that is called by a consumer of an implementation of this class
public abstract string Generate(Report Report, string TemplateFilepath);

Expand Down
Expand Up @@ -7,9 +7,9 @@

namespace Xteq5
{
public class BootstrapHTMLGenerator2 : BaseTemplateReplaceGenerator
public class BootstrapHTMLGenerator : BaseTemplateReplaceGenerator
{
public BootstrapHTMLGenerator2()
public BootstrapHTMLGenerator()
{

}
Expand Down

0 comments on commit dc222dd

Please sign in to comment.