diff --git a/.travis.yml b/.travis.yml index ad7e547..2286cb2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,104 +3,112 @@ dist: trusty language: haxe +os: + - linux + # haxe versions : http://haxe.org/website-content/downloads/versions.json haxe: - "3.4.7" - development -matrix: - allow_failures: - - haxe: development - env: global: - # travis encrypt GH_TOKEN= -r DoclerLabs/hexMachina - - secure: Y7k64lsVnGXXFyEttqcYONkQog9pynxGIXnJAa/sdbehdknjQooDQbqWbd2CDzHs1lp7I5kppD3oM8jjkd+7ZH0EjnhzPr2f1OzdcLN3djml2hrKaDr4EMrQW9K3pDCAKP2CtaQtbxjm2l5QHEUcjLe82d/dS5TgEemUPA7/JYM4afCoXpGnCVZcknf5PbR2W3hyFk1R9+8B++5MuH3pNMwZvYEWwzUQLV4GZppe22N7ZlFjLNKnZ9tOd4QcRT9528ujvIKR0K9antuJDBQKTCQqxCTcQmndDp0lEuBhfC9ZDlrMVTLbKUD4B/0g0wHlMKsiJIWo1L03Ec5aASRV4uKRC/4RSLqmY1EXDEuDb1xG4Pg4/NH2Qpqju0qHE/vT5jYNMr2rmnQpcXZEotyoJ70wtIKRR0iIwsSAvTI5SKyNBXg8Wpkqu83/03IfgFqCXPAvOmuv7Pp8zPtLNcz7XnjTiwRFSGvwOzX8jz/+JwCCagLCo6AEcCDT4HCj6hUtHfWdrcyBBHUD40rFJjEDyYyl5MX9yJonznwiWo8Nu3Gx5f4C5WmdEQpxuwUK5wz4uZdH3gpCu7LZyvjUxdPwJNRp5P0uAdptH/vLyVMSyxBG4yC+KFMjWmj65pk0hW0YdS0JcuzgLrtb4r0TvtyElcv04vN7i0sKhY3ai+63IJ8= - - TRAVIS_NODE_VERSION="6.6.0" + # travis encrypt GH_TOKEN= -r DoclerLabs/hexMachina + - secure: Y7k64lsVnGXXFyEttqcYONkQog9pynxGIXnJAa/sdbehdknjQooDQbqWbd2CDzHs1lp7I5kppD3oM8jjkd+7ZH0EjnhzPr2f1OzdcLN3djml2hrKaDr4EMrQW9K3pDCAKP2CtaQtbxjm2l5QHEUcjLe82d/dS5TgEemUPA7/JYM4afCoXpGnCVZcknf5PbR2W3hyFk1R9+8B++5MuH3pNMwZvYEWwzUQLV4GZppe22N7ZlFjLNKnZ9tOd4QcRT9528ujvIKR0K9antuJDBQKTCQqxCTcQmndDp0lEuBhfC9ZDlrMVTLbKUD4B/0g0wHlMKsiJIWo1L03Ec5aASRV4uKRC/4RSLqmY1EXDEuDb1xG4Pg4/NH2Qpqju0qHE/vT5jYNMr2rmnQpcXZEotyoJ70wtIKRR0iIwsSAvTI5SKyNBXg8Wpkqu83/03IfgFqCXPAvOmuv7Pp8zPtLNcz7XnjTiwRFSGvwOzX8jz/+JwCCagLCo6AEcCDT4HCj6hUtHfWdrcyBBHUD40rFJjEDyYyl5MX9yJonznwiWo8Nu3Gx5f4C5WmdEQpxuwUK5wz4uZdH3gpCu7LZyvjUxdPwJNRp5P0uAdptH/vLyVMSyxBG4yC+KFMjWmj65pk0hW0YdS0JcuzgLrtb4r0TvtyElcv04vN7i0sKhY3ai+63IJ8= + matrix: + - HAXE_TARGET=cpp + #- HAXE_TARGET=cs + - HAXE_TARGET=flash + #- HAXE_TARGET=lua + - HAXE_TARGET=neko + - HAXE_TARGET=node + - HAXE_TARGET=php + - HAXE_TARGET=php7 + #- HAXE_TARGET=python + - HAXE_TARGET=js + #- HAXE_TARGET=java + - HAXE_TARGET=hl + +matrix: + fast_finish: true + allow_failures: + - haxe: development + - env: HAXE_TARGET=flash # cannot trust that guy + - env: HAXE_TARGET=cpp # Not supported yet + - env: HAXE_TARGET=cs # Not supported yet + - env: HAXE_TARGET=lua # Not supported yet + - env: HAXE_TARGET=python # Not supported yet + - env: HAXE_TARGET=java # Not supported yet + - env: HAXE_TARGET=hl # Not supported yet + exclude: + - haxe: "3.4.7" + env: HAXE_TARGET=hl before_install: - echo $TRAVIS_BRANCH - - if [[ "$TRAVIS_BRANCH" != "master" ]]; then export DEPENDENCIES_BRANCH=$TRAVIS_BRANCH; else export DEPENDENCIES_BRANCH=master; fi + - export DEPENDENCIES_BRANCH=$TRAVIS_BRANCH - echo $TRAVIS_TAG - if [[ "$TRAVIS_TAG" != "" ]]; then export DEPENDENCIES_BRANCH=$TRAVIS_TAG; fi - echo $DEPENDENCIES_BRANCH - - sudo sed -i -e 's/deb http/deb [arch=amd64] http/' "/etc/apt/sources.list.d/google-chrome.list" "/opt/google/chrome/cron/google-chrome" - - sudo dpkg --add-architecture i386 - - sudo apt-get update - - sudo apt-get install -qq libcurl3:i386 - - sudo apt-get install -qq libglib2.0-0:i386 - - sudo apt-get install -qq libx11-6:i386 - - sudo apt-get install -qq libxext6:i386 - - sudo apt-get install -qq libxt6:i386 - - sudo apt-get install -qq libxcursor1:i386 - - sudo apt-get install -qq libnss3:i386 - - sudo apt-get install -qq libgtk2.0-0:i386 install: - export BRANCH_REF=$DEPENDENCIES_BRANCH + - haxelib install travix --always # hexLog - - if [[ $( git ls-remote https://github.com/DoclerLabs/hexLog.git $DEPENDENCIES_BRANCH | wc -l ) == "0" ]]; then export DEPENDENCIES_BRANCH=develop; else export DEPENDENCIES_BRANCH=$BRANCH_REF; fi + - if [ $( git ls-remote https://github.com/DoclerLabs/hexLog.git $BRANCH_REF | wc -l ) == "0" ]; then export DEPENDENCIES_BRANCH=master; else export DEPENDENCIES_BRANCH=$BRANCH_REF; fi - echo Checking out $DEPENDENCIES_BRANCH - git clone --recursive -b $DEPENDENCIES_BRANCH https://github.com/DoclerLabs/hexLog.git ~/hexlog - haxelib dev hexlog ~/hexlog # hexCore - - if [[ $( git ls-remote https://github.com/DoclerLabs/hexCore.git $DEPENDENCIES_BRANCH | wc -l ) == "0" ]]; then export DEPENDENCIES_BRANCH=develop; else export DEPENDENCIES_BRANCH=$BRANCH_REF; fi + - if [ $( git ls-remote https://github.com/DoclerLabs/hexCore.git $BRANCH_REF | wc -l ) == "0" ]; then export DEPENDENCIES_BRANCH=master; else export DEPENDENCIES_BRANCH=$BRANCH_REF; fi - echo Checking out $DEPENDENCIES_BRANCH - git clone --recursive -b $DEPENDENCIES_BRANCH https://github.com/DoclerLabs/hexCore.git ~/hexcore - haxelib install ~/hexcore/haxelib.json --always - haxelib dev hexcore ~/hexcore # hexUnit - - if [[ $( git ls-remote https://github.com/DoclerLabs/hexUnit.git $DEPENDENCIES_BRANCH | wc -l ) == "0" ]]; then export DEPENDENCIES_BRANCH=develop; else export DEPENDENCIES_BRANCH=$BRANCH_REF; fi + - if [ $( git ls-remote https://github.com/DoclerLabs/hexUnit.git $BRANCH_REF | wc -l ) == "0" ]; then export DEPENDENCIES_BRANCH=master; else export DEPENDENCIES_BRANCH=$BRANCH_REF; fi - echo Checking out $DEPENDENCIES_BRANCH - git clone --recursive -b $DEPENDENCIES_BRANCH https://github.com/DoclerLabs/hexUnit.git ~/hexunit - haxelib dev hexunit ~/hexunit # hexReflection - - if [[ $( git ls-remote https://github.com/DoclerLabs/hexReflection.git $DEPENDENCIES_BRANCH | wc -l ) == "0" ]]; then export DEPENDENCIES_BRANCH=develop; else export DEPENDENCIES_BRANCH=$BRANCH_REF; fi + - if [ $( git ls-remote https://github.com/DoclerLabs/hexReflection.git $BRANCH_REF | wc -l ) == "0" ]; then export DEPENDENCIES_BRANCH=master; else export DEPENDENCIES_BRANCH=$BRANCH_REF; fi - echo Checking out $DEPENDENCIES_BRANCH - git clone --recursive -b $DEPENDENCIES_BRANCH https://github.com/DoclerLabs/hexReflection.git ~/hexreflection - haxelib dev hexreflection ~/hexreflection # hexAnnotation - - if [[ $( git ls-remote https://github.com/DoclerLabs/hexAnnotation.git $DEPENDENCIES_BRANCH | wc -l ) == "0" ]]; then export DEPENDENCIES_BRANCH=develop; else export DEPENDENCIES_BRANCH=$BRANCH_REF; fi + - if [ $( git ls-remote https://github.com/DoclerLabs/hexAnnotation.git $BRANCH_REF | wc -l ) == "0" ]; then export DEPENDENCIES_BRANCH=master; else export DEPENDENCIES_BRANCH=$BRANCH_REF; fi - echo Checking out $DEPENDENCIES_BRANCH - git clone --recursive -b $DEPENDENCIES_BRANCH https://github.com/DoclerLabs/hexAnnotation.git ~/hexannotation - haxelib dev hexannotation ~/hexannotation # hexInject - - if [[ $( git ls-remote https://github.com/DoclerLabs/hexInject.git $DEPENDENCIES_BRANCH | wc -l ) == "0" ]]; then export DEPENDENCIES_BRANCH=develop; else export DEPENDENCIES_BRANCH=$BRANCH_REF; fi + - if [ $( git ls-remote https://github.com/DoclerLabs/hexInject.git $BRANCH_REF | wc -l ) == "0" ]; then export DEPENDENCIES_BRANCH=master; else export DEPENDENCIES_BRANCH=$BRANCH_REF; fi - echo Checking out $DEPENDENCIES_BRANCH - git clone --recursive -b $DEPENDENCIES_BRANCH https://github.com/DoclerLabs/hexInject.git ~/hexinject - haxelib dev hexinject ~/hexinject # hexDsl - - if [[ $( git ls-remote https://github.com/DoclerLabs/hexDsl.git $DEPENDENCIES_BRANCH | wc -l ) == "0" ]]; then export DEPENDENCIES_BRANCH=develop; else export DEPENDENCIES_BRANCH=$BRANCH_REF; fi + - if [ $( git ls-remote https://github.com/DoclerLabs/hexDsl.git $BRANCH_REF | wc -l ) == "0" ]; then export DEPENDENCIES_BRANCH=master; else export DEPENDENCIES_BRANCH=$BRANCH_REF; fi - echo Checking out $DEPENDENCIES_BRANCH - git clone --recursive -b $DEPENDENCIES_BRANCH https://github.com/DoclerLabs/hexDsl.git ~/hexdsl - haxelib dev hexdsl ~/hexdsl # hexCommand - - if [[ $( git ls-remote https://github.com/DoclerLabs/hexCommand.git $DEPENDENCIES_BRANCH | wc -l ) == "0" ]]; then export DEPENDENCIES_BRANCH=develop; else export DEPENDENCIES_BRANCH=$BRANCH_REF; fi + - if [ $( git ls-remote https://github.com/DoclerLabs/hexCommand.git $BRANCH_REF | wc -l ) == "0" ]; then export DEPENDENCIES_BRANCH=master; else export DEPENDENCIES_BRANCH=$BRANCH_REF; fi - echo Checking out $DEPENDENCIES_BRANCH - git clone --recursive -b $DEPENDENCIES_BRANCH https://github.com/DoclerLabs/hexCommand.git ~/hexcommand - haxelib dev hexcommand ~/hexcommand #hexMachina - haxelib dev hexmachina . -#---- dependencies done ---- - - export DISPLAY=:99.0; - - export AUDIODEV=null; - - haxe flash/install.hxml + - haxelib path hexcommand - git clone --recursive https://github.com/chipshort/hexDoc-Theme.git ~/hexdoctheme -# update node for deploy scripts - - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION before_script: - git config --global user.email "laurent@geturl.net" - git config --global user.name "Travis-CI" script: -- haxe build-php.hxml && php bin/index.php -- haxe build-neko.hxml && neko bin/MainTest.n -- haxe build-js.hxml && node bin/MainTest.js -- haxe build-flash.hxml -D fdb && haxe flash/run.hxml bin/MainTest.swf + - haxelib run travix $HAXE_TARGET before_deploy: -- if [ $TRAVIS_HAXE_VERSION == "3.4.7" ]; then ./.travis/pre-deploy.sh; fi + - if [ $TRAVIS_HAXE_VERSION == "3.4.7" && ]; then ./.travis/pre-deploy.sh; fi deploy: provider: releases @@ -116,7 +124,7 @@ deploy: tags: true after_deploy: -- if [ $TRAVIS_HAXE_VERSION == "3.4.7" ]; then ./.travis/post-deploy.sh; fi +- if [ $TRAVIS_HAXE_VERSION == "3.4.7" ] && [ $HAXE_TARGET == "flash" ]; then ./.travis/post-deploy.sh; fi notifications: email: diff --git a/build-flash.hxml b/build-flash.hxml index ed6dde1..ef01556 100644 --- a/build-flash.hxml +++ b/build-flash.hxml @@ -1,4 +1,4 @@ -build-each.hxml +tests.hxml --each diff --git a/build-js.hxml b/build-js.hxml index f0d98fa..4daa875 100644 --- a/build-js.hxml +++ b/build-js.hxml @@ -1,4 +1,4 @@ -build-each.hxml +tests.hxml --each diff --git a/build-neko.hxml b/build-neko.hxml index 54a8a3a..954d0a6 100644 --- a/build-neko.hxml +++ b/build-neko.hxml @@ -1,4 +1,4 @@ -build-each.hxml +tests.hxml --each diff --git a/build-php.hxml b/build-php.hxml index f8ecaa0..a65c096 100644 --- a/build-php.hxml +++ b/build-php.hxml @@ -1,4 +1,4 @@ -build-each.hxml +tests.hxml --each diff --git a/flash/Install.hx b/flash/Install.hx deleted file mode 100644 index 60c11b2..0000000 --- a/flash/Install.hx +++ /dev/null @@ -1,77 +0,0 @@ -import Sys.*; -import sys.FileSystem.*; -import sys.io.File.*; -import haxe.*; -import haxe.io.*; - -class Install { - // https://www.adobe.com/support/flashplayer/downloads.html - static var fpDownload(default, never) = switch (systemName()) { - case "Linux": - "https://fpdownload.macromedia.com/pub/flashplayer/updaters/11/flashplayer_11_sa_debug.i386.tar.gz"; - case "Mac": - "https://fpdownload.macromedia.com/pub/flashplayer/updaters/19/flashplayer_19_sa_debug.dmg"; - case "Windows": - "http://fpdownload.macromedia.com/pub/flashplayer/updaters/19/flashplayer_19_sa_debug.exe"; - case _: - throw "unsupported system"; - } - // https://helpx.adobe.com/flash-player/kb/configure-debugger-version-flash-player.html - static var mmcfg(default, never) = switch (systemName()) { - case "Linux": - Path.join([getEnv("HOME"), "mm.cfg"]); - case "Mac": - "/Library/Application Support/Macromedia/mm.cfg"; - case "Windows": - Path.join([getEnv("HOMEDRIVE") + getEnv("HOMEPATH"), "mm.cfg"]); - case _: - throw "unsupported system"; - } - // http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7c95.html - static var fpTrust(default, never) = switch (systemName()) { - case "Linux": - Path.join([getEnv("HOME"), ".macromedia/Flash_Player/#Security/FlashPlayerTrust"]); - case "Mac": - "/Library/Application Support/Macromedia/FlashPlayerTrust"; - case "Windows": - Path.join([getEnv("SYSTEMROOT"), "system32", "Macromed", "Flash", "FlashPlayerTrust"]); - case _: - throw "unsupported system"; - } - static function main() { - switch (systemName()) { - case "Linux": - // Download and unzip flash player - if (command("wget", [fpDownload]) != 0) - throw "failed to download flash player"; - if (command("tar", ["-xf", Path.withoutDirectory(fpDownload), "-C", "flash"]) != 0) - throw "failed to extract flash player"; - case "Mac": - if (command("brew", ["install", "caskroom/cask/brew-cask"]) != 0) - throw "failed to brew install caskroom/cask/brew-cask"; - if (command("brew", ["cask", "install", "flash-player-debugger", "--appdir=flash"]) != 0) - throw "failed to install flash-player-debugger"; - case "Windows": - // Download flash player - download(fpDownload, "flash\\flashplayer.exe"); - case _: - throw "unsupported system"; - } - - - // Create a configuration file so the trace log is enabled - createDirectory(Path.directory(mmcfg)); - saveContent(mmcfg, "ErrorReportingEnable=1\nTraceOutputFileEnable=1"); - - // Add the current directory as trusted, so exit() can be used - createDirectory(fpTrust); - saveContent(Path.join([fpTrust, "test.cfg"]), getCwd()); - } - static function download(url:String, saveAs:String):Void { - var http = new Http(url); - http.onError = function(e) { - throw e; - }; - http.customRequest(false, write(saveAs)); - } -} \ No newline at end of file diff --git a/flash/Run.hx b/flash/Run.hx deleted file mode 100644 index e70e5ad..0000000 --- a/flash/Run.hx +++ /dev/null @@ -1,46 +0,0 @@ -import Sys.*; -import sys.FileSystem.*; -import sys.io.File.*; -import haxe.io.*; - -class Run { - // https://helpx.adobe.com/flash-player/kb/configure-debugger-version-flash-player.html - static var flashlog(default, never) = switch (systemName()) { - case "Linux": - Path.join([getEnv("HOME"), ".macromedia/Flash_Player/Logs/flashlog.txt"]); - case "Mac": - Path.join([getEnv("HOME"), "Library/Preferences/Macromedia/Flash Player/Logs/flashlog.txt"]); - case "Windows": - Path.join([getEnv("APPDATA"), "Macromedia", "Flash Player", "Logs", "flashlog.txt"]); - case _: - throw "unsupported system"; - } - static function main() { - var args = args(); - var swf = args[0]; - var exitCode = switch (systemName()) { - case "Linux": - // The flash player has some issues with unexplained crashes, - // but if it runs about 8 times, it should succeed one of those... - var c = -1; - for (i in 0...8) { - println('Launch Flash player... $i'); - if ((c = command("xvfb-run", ["flash/flashplayerdebugger", swf])) == 0) - { - println('Flash runs successfully $swf file'); - break; - } - println('retry... (${i+1})'); - } - c; - case "Mac": - command("flash/Flash Player Debugger.app/Contents/MacOS/Flash Player Debugger", [fullPath(swf)]); - case "Windows": - command("flash\\flashplayer.exe", [fullPath(swf)]); - case _: - throw "unsupported platform"; - } - println(getContent(flashlog)); - exit(exitCode); - } -} \ No newline at end of file diff --git a/flash/install.hxml b/flash/install.hxml deleted file mode 100644 index 1321998..0000000 --- a/flash/install.hxml +++ /dev/null @@ -1,2 +0,0 @@ --cp flash ---run Install \ No newline at end of file diff --git a/flash/run.hxml b/flash/run.hxml deleted file mode 100644 index cf39832..0000000 --- a/flash/run.hxml +++ /dev/null @@ -1,2 +0,0 @@ --cp flash ---run Run \ No newline at end of file diff --git a/test/MainMachinaTest.hx b/test/MainMachinaTest.hx index 2aa1003..2170f7d 100644 --- a/test/MainMachinaTest.hx +++ b/test/MainMachinaTest.hx @@ -12,8 +12,10 @@ class MainMachinaTest static public function main() : Void { var emu = new ExMachinaUnitCore(); - - #if flash + + #if travix + emu.addListener( new hex.unittest.notifier.TravixNotifier( ) ); + #elseif flash TestRunner.RENDER_DELAY = 80; emu.addListener( new hex.unittest.notifier.TraceNotifier( flash.Lib.current.loaderInfo, false, true ) ); #elseif (php && haxe_ver < 4.0) diff --git a/build-each.hxml b/tests.hxml similarity index 100% rename from build-each.hxml rename to tests.hxml