Created
July 3, 2014 22:35
-
-
Save tiagolr/d7e82f2009dbc90e9a66 to your computer and use it in GitHub Desktop.
Std unit tests template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bin | |
.temp | |
report.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Creates coverage report and saves it to report.txt file. | |
:: MCoverage lib must be installed | |
@echo off | |
CALL lime test neko -debug -DCOVERAGE > report.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<project> | |
<app main="TestMain" file="test" path="bin" /> | |
<set name="SHOW_CONSOLE" value="1"/> | |
<haxedef name="SHOW_CONSOLE"/> | |
<haxelib name="openfl" /> | |
<!-- Code coverage --> | |
<!-- Compile with flag COVERAGE to view code coverage, eg: lime test neko -DCOVERAGE --> | |
<!-- Adjust packages classpath (['../src']) if necessary --> | |
<haxelib name="mcover"/> | |
<haxeflag name="--macro" value="mcover.MCover.coverage([''], ['../src'], null)" /> | |
</project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
call lime test flash -debug | |
pause | |
call lime test neko -debug | |
pause | |
call lime test cpp -debug | |
pause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ; | |
import haxe.unit.TestCase; | |
/** | |
* Simple test case | |
*/ | |
class TestExample extends TestCase | |
{ | |
public function new() { | |
super(); | |
} | |
override public function setup() { | |
} | |
override public function tearDown() { | |
} | |
public function testExample() { | |
assertTrue(true); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ; | |
class TestMain { | |
static function main(){ | |
var r = new haxe.unit.TestRunner(); | |
r.add(new TestExample()); | |
r.run(); | |
#if COVERAGE | |
var logger = mcover.coverage.MCoverage.getLogger(); | |
logger.report(); | |
#end | |
#if !flash | |
Sys.exit(0); | |
#end | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<project version="2"> | |
<!-- Output SWF options --> | |
<output> | |
<movie outputType="Application" /> | |
<movie input="" /> | |
<movie path="project.xml" /> | |
<movie fps="30" /> | |
<movie width="800" /> | |
<movie height="600" /> | |
<movie version="3" /> | |
<movie minorVersion="0" /> | |
<movie platform="NME" /> | |
<movie background="FFFFFF" /> | |
<movie preferredSDK=";3;" /> | |
</output> | |
<!-- Other classes to be compiled into your SWF --> | |
<classpaths> | |
</classpaths> | |
<!-- Build options --> | |
<build> | |
<option flashStrict="False" /> | |
<option noInlineOnDebug="False" /> | |
<option mainClass="ApplicationMain" /> | |
<option enabledebug="True" /> | |
<option additional="--no-output
--remap flash:openfl
--macro mcover.MCover.coverage([''], ['../src'], null)
#--macro keep("TestRunner")" /> | |
</build> | |
<!-- haxelib libraries --> | |
<haxelib> | |
<!-- example: <library name="..." /> --> | |
</haxelib> | |
<!-- Class files to compile (other referenced classes will automatically be included) --> | |
<compileTargets> | |
<compile path="src\Main.hx" /> | |
</compileTargets> | |
<!-- Assets to embed into the output SWF --> | |
<library> | |
</library> | |
<!-- Paths to exclude from the Project Explorer tree --> | |
<hiddenPaths> | |
<hidden path="obj" /> | |
</hiddenPaths> | |
<!-- Executed before build --> | |
<preBuildCommand /> | |
<!-- Executed after build --> | |
<postBuildCommand alwaysRun="False" /> | |
<!-- Other project options --> | |
<options> | |
<option showHiddenPaths="False" /> | |
<option testMovie="Custom" /> | |
<option testMovieCommand="" /> | |
</options> | |
<!-- Plugin storage --> | |
<storage /> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment