diff --git a/build/index.js b/build/index.js index bd03b38..ce7e949 100644 --- a/build/index.js +++ b/build/index.js @@ -3373,7 +3373,7 @@ function Tests_runUnitTests(target) { Command_runCallbackInDir("unit",function() { return Haxelib_run(args); }); - if(target == "cpp" || target == "hl") { + if(target == "cpp") { process.stdout.write("Running unit tests...\n"); process.stdout.write("\n"); return OpenFL_run("test","unit",target,"travis"); diff --git a/src/Tests.hx b/src/Tests.hx index 7113da0..a125a97 100644 --- a/src/Tests.hx +++ b/src/Tests.hx @@ -4,7 +4,8 @@ import OpenFL.Target; private final CppDemos = ["Mode", "Flixius", "MinimalistTD", "TurnBasedRPG"]; -function make(target):Array { +function make(target):Array +{ return [ { name: "Running Unit Tests", @@ -35,25 +36,30 @@ function make(target):Array { ]; } -private function runUnitTests(target:Target):ExitCode { +private function runUnitTests(target:Target):ExitCode +{ runCallbackInDir("unit", Haxelib.run.bind(["munit", "gen"])); - + // can't run / display results without a browser, // this at least checks if the tests compile // also, neko fails randomly for some reason... (#2148) - var runTests = target == Cpp || target == Hl; - - if (runTests) { + var runTests = target == Cpp; + + if (runTests) + { Sys.println("Running unit tests...\n"); return OpenFL.run("test", "unit", target, "travis"); - } else { + } + else + { Sys.println('Cannot run tests on $target, building instead\n'); Sys.println("Building unit tests...\n"); return OpenFL.build("unit", target); } } -private function buildCoverageTests(target:Target):ExitCode { +private function buildCoverageTests(target:Target):ExitCode +{ Sys.println("\nBuilding coverage tests...\n"); return runAll([ OpenFL.build.bind("coverage", target, "coverage1"), @@ -61,25 +67,32 @@ private function buildCoverageTests(target:Target):ExitCode { ]); } -private function buildDemos(target:Target, ?demos):ExitCode { - if (demos == null) { +private function buildDemos(target:Target, ?demos):ExitCode +{ + if (demos == null) + { Sys.println('\nBuilding all demos...\n'); demos = []; - } else if (demos == CppDemos) { + } + else if (demos == CppDemos) + { Sys.println('\nSkipping some demos due to cpp build times\nBuilding ${demos.length} demo(s)...\n'); - } else + } + else Sys.println('\nBuilding ${demos.length} demo(s)...\n'); return Flixel.buildProjects(target, demos); } -private function buildSnippetsDemos(target:Target):ExitCode { +private function buildSnippetsDemos(target:Target):ExitCode +{ Sys.println("\nBuilding spnippets demos...\n"); run("git", ["clone", "https://github.com/HaxeFlixel/snippets.haxeflixel.com"]); - + return Flixel.buildProjects(target, ["-dir", "snippets.haxeflixel.com"]); } -private function buildSwfVersionTests(target:Target):ExitCode { +private function buildSwfVersionTests(target:Target):ExitCode +{ Sys.println("\nBuilding swf version tests...\n"); return runAll([ OpenFL.build.bind("swfVersion/11", target),