Skip to content

Test environment for WDL transpiler and Acknex3 API compatibility

License

Notifications You must be signed in to change notification settings

firoball/WDLTransTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WDLTransTest

Test environment for WDL transpiler and Acknex3 API compatibility. It is used for batch testing successful transpilation of Acknex3 WDL files to C# code. The generated output can in turn be tested against the Acknex C# API. This project is to be used in conjunction with WDL2CS and AcknexCSApi.

WdlTransTest

Usage

WDLTransTest <config.xml> <testsuite.xml> [type1,type2,...]

For convenience, test.bat in the repository root can be used for execution.

Important: All path definitions given in any of the config and test xml files will be treated relative to the folder from where WDLTransTest is executed. This is not necessarily the same folder as where WDLTransTest is located (see test.bat).

Parameters:

config.xml Configuration seetings related to transpiler and Acknex Api.

testsuite.xml Several test cases arranged in testsuites.

type1,type2,... Test type filters, e.g. transpiler or api. By using a filter, only tests of the specified types will be executed (optional).

Dependencies

It is required to clone following repositories:

Environment configuration

<!--adjust pathes to your environment//-->
<environment>
	<config type="generic">
		<msbuild>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe</msbuild>
	</config>
	
	<config type="transpiler">
		<prj-path>d:\git\other\WDL2CS\code</prj-path>
		<vsproj>WDL2CS.csproj</vsproj>
		<out-path>out\build</out-path>
	</config>

	<config type="api">
		<prj-path>d:\git\other\AcknexCSApi\Acknex3Api</prj-path>
		<vsproj>Acknex3Api.csproj</vsproj>
		<out-path>out\build</out-path>
	</config>
</environment>

It is important to adjust <prj-path> to the file/project locations on the individual machine. During testing, both Transpiler and the Acknex Api will be ocmpiled and copied to the folder specified with <out-path>. The typeattribute specifies what the config shall be used for specifically.

In general, the shown configuration layout does not need to be changed, except for the absolute pathes.

Testsuites

A testsuite serves as container for one ore more tests. Standalone tests cannot be executed - a testsuite is always needed.

Testsuites can be nested. It is also possible to reference testsuites from external files by using the file attribute. The optional name attribute can be used to give tests a specific name - this helps keeping the overview in bigger testsuites.

External testsuite reference

<testsuite name="Root">
	<testsuite file="test.xml"/>
</testsuite>

Nested testsuites

<testsuite name="Root">
	<testsuite name="subsuite">
		<test name="Example" type="transpiler">
		</test>
	</testsuite>
</testsuite>

Test cases

Test cases are mandatory to be children of a testsuite. Test cases must not be nested in each other. Via the typeattribute, the type of test case can be specified. The nameattribute may be used to give test cases specific names.

Transpiler Test

<testsuite name="Kandoria">
	<test type="transpiler">
		<wdl-file>wdl\wok\game.wdl</wdl-file>
		<cs-file>out\cs\wok\game.cs</cs-file>
		<log-file>out\log\wok\transpile.log</log-file>
	</test>
</testsuite>
  • <wdl-file> Main WDL file with path
  • <cs-file> Output C# file with path (optional)
  • <log-file> Output log file with path (optional)

Acknex API Test

<testsuite name="Kandoria">
	<test type="api">
		<cs-file>out\cs\wok\game.cs</cs-file>
		<exe-file>out\log\wok\game.exe</exe-file>
		<log-file>out\log\wok\api.log</log-file>
	</test>
</testsuite>
  • <cs-file> Output C# file with path
  • <exe-file> Non-funtional executable with path (optional)
  • <log-file> Output log file with path (optional)

Quickstart

  1. Clone WDL2CS and AcknexCSApi repositories.
  2. Clone WdlTransTest repository.
  3. Go to code folder of WdlTransTest and open WDLTransTest.sln.
  4. Build Project in debug mode. code\bin\Debug\WDLTransTest.exe will be available after successful build.
  5. Go to cfgand adjust config.xml to your local setup. See Environment configuration.
  6. Go to project root and execute test wok.xml to run the Kandoria sample test.
  7. If everything is configured alright, enjoy the show.

Legal stuff

https://firoball.de

Please respect license.txt

About

Test environment for WDL transpiler and Acknex3 API compatibility

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published