Skip to content

Commit

Permalink
Add tests for hxcpp build of haxelib
Browse files Browse the repository at this point in the history
  • Loading branch information
tobil4sk committed Aug 26, 2024
1 parent 6c8f3c7 commit 7540fd0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
10 changes: 10 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,15 @@ run.n:
RUN haxe client.hxml
SAVE ARTIFACT run.n AS LOCAL run.n

haxelib-binary:
FROM +devcontainer
COPY .git .git
COPY src src
COPY hx3compat hx3compat
COPY client_cpp.hxml haxelib.json .
RUN haxe client_cpp.hxml
SAVE ARTIFACT haxelib AS LOCAL haxelib

package-haxelib:
FROM +devcontainer-base
COPY src src
Expand Down Expand Up @@ -518,6 +527,7 @@ ci-tests:
# for package.hxml
COPY haxelib.json README.md .
COPY +run.n/run.n .
COPY +haxelib-binary/haxelib .

COPY +ci-runner/ci.n bin/ci.n
ENV HAXELIB_SERVER=localhost
Expand Down
1 change: 1 addition & 0 deletions libs.hxml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@
-cmd curl -sSLk https://lib.haxe.org/files/3.0/ufront-2,0,0.zip -o haxelib_global/ufront.zip && neko run.n install --always --skip-dependencies haxelib_global/ufront.zip
-cmd curl -sSLk https://lib.haxe.org/files/3.0/utest-1,9,6.zip -o haxelib_global/utest.zip && neko run.n install --always --skip-dependencies haxelib_global/utest.zip
-cmd curl -sSLk https://lib.haxe.org/files/3.0/hxnodejs-12,1,0.zip -o haxelib_global/hxnodejs.zip && neko run.n install --always --skip-dependencies haxelib_global/hxnodejs.zip
-cmd curl -sSLk https://lib.haxe.org/files/3.0/hxcpp-4,3,2.zip -o haxelib_global/hxcpp.zip && neko run.n install --always --skip-dependencies haxelib_global/hxcpp.zip
-cmd neko run.n dev record-macros lib/record-macros
2 changes: 2 additions & 0 deletions test/IntegrationTests.hx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ class IntegrationTests extends TestBase {
function haxelib(args:Array<String>, ?input:String):Process {
final p = #if system_haxelib
new Process("haxelib", ["-R", serverUrl].concat(args));
#elseif haxelib_path
new Process(haxe.macro.Compiler.getDefine("haxelib_path"), ["-R", serverUrl].concat(args));
#else
new Process("neko", [haxelibBin, "-R", serverUrl].concat(args));
#end
Expand Down
21 changes: 7 additions & 14 deletions test/RunCi.hx
Original file line number Diff line number Diff line change
Expand Up @@ -370,19 +370,6 @@ Listen 2000
}

static function integrationTests():Void {
function test():Void {
switch (Sys.getEnv("TRAVIS_HAXE_VERSION")) {
case null, "development":
runCommand("haxe", ["integration_tests.hxml"]);
case "3.1.3":
runCommand("haxe", ["integration_tests.hxml", "-D", "system_haxelib"]);
case _:
runCommand("haxe", ["integration_tests.hxml"]);
runCommand("neko", ["bin/integration_tests.n"]);
runCommand("haxe", ["integration_tests.hxml", "-D", "system_haxelib"]);
}
runCommand("neko", ["bin/integration_tests.n"]);
}
var dbConfigPath = Path.join(["www", "dbconfig.json"]);
saveContent(dbConfigPath, Json.stringify({
user: Sys.getEnv("HAXELIB_DB_USER"),
Expand All @@ -391,7 +378,13 @@ Listen 2000
port: Std.parseInt(Sys.getEnv("HAXELIB_DB_PORT")),
database: Sys.getEnv("HAXELIB_DB_NAME"),
}, "\t"));
test();
runCommand("haxe", ["integration_tests.hxml"]);
runCommand("neko", ["bin/integration_tests.n"]);
runCommand("haxe", [
"integration_tests.hxml",
"-D",
'haxelib_path=${Path.join([Sys.getCwd(), "haxelib"])}'
]);
}

static function deploy():Void {
Expand Down

0 comments on commit 7540fd0

Please sign in to comment.