-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
179 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"version": "4.3.6", | ||
"resolveLibs": "scoped" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Debug", | ||
"type": "haxe-eval", | ||
"request": "launch", | ||
"args": ["test.hxml", "--lib", "test-adapter"] | ||
} | ||
] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"[haxe]": { | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": true | ||
}, | ||
"haxeTestExplorer.coverageCommand": [ | ||
"${haxe}", | ||
"testCoverage.hxml", | ||
"-lib", | ||
"test-adapter" | ||
], | ||
"haxeTestExplorer.lcovPath": "lcov.info", | ||
"haxeTestExplorer.enableAttributableCoverage": true, | ||
"haxeTestExplorer.enableCoverageUI": true, | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "haxe", | ||
"args": "active configuration", | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
} | ||
} | ||
] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# @install: lix --silent download "haxelib:/hxjsonast#1.1.0" into hxjsonast/1.1.0/haxelib | ||
-cp ${HAXE_LIBCACHE}/hxjsonast/1.1.0/haxelib/src | ||
-D hxjsonast=1.1.0 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# @install: lix --silent download "haxelib:/instrument#1.3.1" into instrument/1.3.1/haxelib | ||
-lib safety | ||
-cp ${HAXE_LIBCACHE}/instrument/1.3.1/haxelib/src | ||
-D instrument=1.3.1 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# @install: lix --silent download "haxelib:/json2object#3.11.0" into json2object/3.11.0/haxelib | ||
-lib hxjsonast | ||
-cp ${HAXE_LIBCACHE}/json2object/3.11.0/haxelib/src | ||
-D json2object=3.11.0 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# @install: lix --silent download "haxelib:/mconsole#1.6.0" into mconsole/1.6.0/haxelib | ||
-cp ${HAXE_LIBCACHE}/mconsole/1.6.0/haxelib/ | ||
-D mconsole=1.6.0 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# @install: lix --silent download "haxelib:/mcover#2.2.2" into mcover/2.2.2/haxelib | ||
-lib mconsole | ||
-lib munit | ||
-cp ${HAXE_LIBCACHE}/mcover/2.2.2/haxelib/ | ||
-D mcover=2.2.2 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# @install: lix --silent download "haxelib:/mlib#2.0.3" into mlib/2.0.3/haxelib | ||
# @run: haxelib run-dir mlib "${HAXE_LIBCACHE}/mlib/2.0.3/haxelib" | ||
-cp ${HAXE_LIBCACHE}/mlib/2.0.3/haxelib/ | ||
-D mlib=2.0.3 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# @install: lix --silent download "haxelib:/munit#2.3.5" into munit/2.3.5/haxelib | ||
# @run: haxelib run-dir munit "${HAXE_LIBCACHE}/munit/2.3.5/haxelib" | ||
-lib mcover | ||
-lib mlib | ||
-cp ${HAXE_LIBCACHE}/munit/2.3.5/haxelib/ | ||
-D munit=2.3.5 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# @install: lix --silent download "haxelib:/safety#1.1.2" into safety/1.1.2/haxelib | ||
-cp ${HAXE_LIBCACHE}/safety/1.1.2/haxelib/src | ||
-D safety=1.1.2 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-lib json2object | ||
-cp ../../test-adapter | ||
-D test-adapter=2.0.7 | ||
${SCOPE_DIR}/../../test-adapter/extraParams.hxml | ||
--macro Sys.println("haxe_libraries/test-adapter.hxml:3: [Warning] Using dev version of library test-adapter") |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
class Main { | ||
public function new() { | ||
doNothing(); | ||
} | ||
|
||
public function doSomething(condition:Bool) { | ||
if (condition) { | ||
doNothing(); | ||
return false; | ||
} else { | ||
doNothing(); | ||
} | ||
doNothing(); | ||
return true; | ||
} | ||
|
||
public function doSomethingFullCoverage(condition:Bool) { | ||
if (condition) { | ||
doNothing(); | ||
return false; | ||
} else { | ||
doNothing(); | ||
} | ||
doNothing(); | ||
return true; | ||
} | ||
|
||
public function doNothing() { | ||
return true; | ||
} | ||
|
||
public function doMoreNothing() { | ||
return true; | ||
} | ||
|
||
static function main() { | ||
new Main(); | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-cp src | ||
-cp tests | ||
-lib munit | ||
-x Test |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-cp src | ||
-cp tests | ||
-lib munit | ||
-lib instrument | ||
-x Test | ||
|
||
-D coverage-console-summary-reporter | ||
|
||
--macro instrument.Instrumentation.coverage([''], ['src'], []) | ||
-D instrument-quiet |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import massive.munit.Assert; | ||
import massive.munit.TestRunner; | ||
import massive.munit.client.RichPrintClient; | ||
|
||
class Test { | ||
static function main() { | ||
var client = new RichPrintClient(); | ||
var runner = new TestRunner(client); | ||
runner.run([TestSuite]); | ||
|
||
#if instrument | ||
instrument.coverage.Coverage.endCoverage(); | ||
#end | ||
} | ||
} | ||
|
||
class TestSuite extends massive.munit.TestSuite { | ||
public function new() { | ||
super(); | ||
add(TestMain); | ||
} | ||
} | ||
|
||
class TestMain { | ||
@Test | ||
function testDoNothing() { | ||
var main = new Main(); | ||
|
||
Assert.isTrue(main.doNothing()); | ||
} | ||
|
||
@Test | ||
function testDoSomething() { | ||
var main = new Main(); | ||
|
||
Assert.isTrue(main.doSomething(false)); | ||
} | ||
|
||
@Test | ||
function testDoSomethingFullCoverage() { | ||
var main = new Main(); | ||
|
||
Assert.isTrue(main.doSomethingFullCoverage(false)); | ||
Assert.isFalse(main.doSomethingFullCoverage(true)); | ||
} | ||
} |