Skip to content

Commit

Permalink
added support for upcoming utest 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHaxe committed Dec 21, 2023
1 parent 0759820 commit aefb0de
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 26 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/RunCI.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import sys.io.File;

using StringTools;

class RunCI {
Expand All @@ -25,9 +24,12 @@ class RunCI {
Sys.setCwd(oldCwd);
}

buildSample("samples/munit");
#if (haxe > version ("4.0.5"))
buildSample("samples/utest");
buildSample("samples/buddy");
#end

buildSample("samples/munit");
buildSample("samples/hexunit");
buildSample("samples/tink_unittest");
buildSample("samples/haxeunit");
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
build:
strategy:
matrix:
haxe-version: [3.4.7, 4.0.5, 4.1.5, 4.2.5, nightly]
haxe-version: [3.4.7, 4.0.5, 4.1.5, 4.2.5, 4.3.3, nightly]
fail-fast: false
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .haxerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "4.3.1",
"version": "4.3.3",
"resolveLibs": "scoped"
}
2 changes: 1 addition & 1 deletion makeReleaseZip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

npm install
npx lix download
npx lix use haxe 4.3.1
npx lix use haxe 4.3.3

npx haxe build.hxml

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"icon": "images/icon.png",
"author": "Alexander Blum <[email protected]>",
"publisher": "vshaxe",
"version": "2.0.5",
"version": "2.0.6",
"license": "MIT",
"homepage": "https://github.com/vshaxe/haxe-test-adapter",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion samples/buddy/.haxerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "4.3.1",
"version": "4.3.3",
"resolveLibs": "scoped"
}
4 changes: 2 additions & 2 deletions samples/buddy/haxe_libraries/json2object.hxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @install: lix --silent download "haxelib:/json2object#3.11.0" into json2object/3.11.0/haxelib
# @install: lix --silent download "gh://github.com/elnabo/json2object#a75859de1e966c09e73591b6c9186086c143fe60" into json2object/3.11.0/github/a75859de1e966c09e73591b6c9186086c143fe60
-lib hxjsonast
-cp ${HAXE_LIBCACHE}/json2object/3.11.0/haxelib/src
-cp ${HAXE_LIBCACHE}/json2object/3.11.0/github/a75859de1e966c09e73591b6c9186086c143fe60/src
-D json2object=3.11.0
2 changes: 1 addition & 1 deletion samples/utest/.haxerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "4.2.5",
"version": "4.3.3",
"resolveLibs": "scoped"
}
6 changes: 3 additions & 3 deletions samples/utest/haxe_libraries/hxjsonast.hxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# @install: lix --silent download "haxelib:/hxjsonast#1.0.1" into hxjsonast/1.0.1/haxelib
-cp ${HAXE_LIBCACHE}/hxjsonast/1.0.1/haxelib/src
-D hxjsonast=1.0.1
# @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
6 changes: 3 additions & 3 deletions samples/utest/haxe_libraries/json2object.hxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @install: lix --silent download "haxelib:/json2object#3.10.0" into json2object/3.10.0/haxelib
# @install: lix --silent download "gh://github.com/elnabo/json2object#a75859de1e966c09e73591b6c9186086c143fe60" into json2object/3.11.0/github/a75859de1e966c09e73591b6c9186086c143fe60
-lib hxjsonast
-cp ${HAXE_LIBCACHE}/json2object/3.10.0/haxelib/src
-D json2object=3.10.0
-cp ${HAXE_LIBCACHE}/json2object/3.11.0/github/a75859de1e966c09e73591b6c9186086c143fe60/src
-D json2object=3.11.0
7 changes: 3 additions & 4 deletions samples/utest/haxe_libraries/utest.hxml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# @install: lix --silent download "gh://github.com/haxe-utest/utest#afb943e2732177824a92feb5e15e541117fbba19" into utest/1.13.2/github/afb943e2732177824a92feb5e15e541117fbba19
-cp ${HAXE_LIBCACHE}/utest/1.13.2/github/afb943e2732177824a92feb5e15e541117fbba19/src
-D utest=1.13.2
--macro utest.utils.Macro.checkHaxe()
# @install: lix --silent download "gh://github.com/haxe-utest/utest#88bc3001470eefb45d8547a0897dc4f718dadc89" into utest/2.0.0-alpha/github/88bc3001470eefb45d8547a0897dc4f718dadc89
-cp ${HAXE_LIBCACHE}/utest/2.0.0-alpha/github/88bc3001470eefb45d8547a0897dc4f718dadc89/src
-D utest=2.0.0-alpha
--macro utest.utils.Macro.importEnvSettings()
2 changes: 1 addition & 1 deletion src/HaxeTestController.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import haxe.Json;
import haxe.ds.ArraySort;
import haxe.io.Path;
import js.lib.Promise;
import vscode.OutputChannel;
import _testadapter.data.Data;
import _testadapter.data.TestFilter;
import _testadapter.data.TestResults;
Expand All @@ -10,7 +11,6 @@ import vscode.DebugSession;
import vscode.ExtensionContext;
import vscode.FileSystemWatcher;
import vscode.Location;
import vscode.OutputChannel;
import vscode.ProcessExecution;
import vscode.Range;
import vscode.RelativePattern;
Expand Down
8 changes: 7 additions & 1 deletion test-adapter/_testadapter/utest/Reporter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Reporter implements IReport<Reporter> {
testResults.save();
}

function dumpStack(stack:Array<StackItem>):String {
function dumpStack(stack:Stack):String {
if (stack.length == 0) {
return "";
}
Expand All @@ -93,3 +93,9 @@ class Reporter implements IReport<Reporter> {

public function setHandler(handler:Reporter->Void) {}
}

#if (utest >= version("2.0.0-alpha"))
typedef Stack = CallStack;
#else
typedef Stack = Array<StackItem>;
#end
4 changes: 2 additions & 2 deletions test-adapter/haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"vscode"
],
"description": "A Test Adapter for Visual Studio Code",
"version": "2.0.5",
"releasenote": "added support for pending tests in buddy",
"version": "2.0.6",
"releasenote": "updated utest Reporter",
"contributors": [
"AlexHaxe",
"Gama11",
Expand Down

0 comments on commit aefb0de

Please sign in to comment.