Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,35 @@ jobs:
sep: /
ext: .dso
os: ubuntu-latest

AndroidX86_64:
strategy:
fail-fast: false
matrix:
haxe: [ 4.3.7, latest ]
uses: ./.github/workflows/test.yml
name: Test Android (x86_64)
with:
haxe: ${{ matrix.haxe }}
arch: 64
sep: /
ext: .dso
os: ubuntu-latest
target_flag: android
execute: false

AndroidArm64:
strategy:
fail-fast: false
matrix:
haxe: [ 4.3.7, latest ]
uses: ./.github/workflows/test.yml
name: Test Android (Arm64)
with:
haxe: ${{ matrix.haxe }}
arch: Arm64
sep: /
ext: .dso
os: ubuntu-latest
target_flag: android
execute: false
55 changes: 38 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,20 @@ on:
os:
required: true
type: string
target_flag:
type: string
default: ''
execute:
type: boolean
default: true

env:
HXCPP_ARCH_FLAG: ${{ inputs.arch == 'Arm64' && 'HXCPP_ARM64' || format('HXCPP_M{0}', inputs.arch) }}
HXCPP_ARCH_FLAG: ${{ inputs.arch == 'Arm64' && 'HXCPP_ARM64' ||
inputs.target_flag == 'android' && inputs.arch == 64 && 'HXCPP_X86_64'||
format('HXCPP_M{0}', inputs.arch)
}}
HAXE_TARGET_FLAG: ${{ inputs.target_flag && format('-D {0}', inputs.target_flag) || '' }}
HXCPP_TARGET_FLAG: ${{ inputs.target_flag && format('-D{0}', inputs.target_flag) || '' }}

jobs:
haxe:
Expand All @@ -36,8 +47,9 @@ jobs:
with:
haxe: ${{ inputs.haxe }}
- name: build
run: haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }}
run: haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }}
- name: run
if: inputs.execute
run: bin${{ inputs.sep }}TestMain

cffi:
Expand All @@ -55,21 +67,24 @@ jobs:
haxe: ${{ inputs.haxe }}
- name: build project
working-directory: test/cffi/project
run: haxelib run hxcpp build.xml -Ddebug -D${{ env.HXCPP_ARCH_FLAG }}
run: haxelib run hxcpp build.xml -Ddebug -D${{ env.HXCPP_ARCH_FLAG }} ${{ env.HXCPP_TARGET_FLAG }}
- name: build
run: haxe compile.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }}
run: haxe compile.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }}
- name: build (utf8)
run: haxe compile-utf8.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }}
run: haxe compile-utf8.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }}
- name: build (neko)
run: haxe compile-neko.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }}
run: haxe compile-neko.hxml --debug -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }}
- name: copy
if: inputs.execute
run: cp project/ndll/*/prime${{ inputs.ext }} bin/neko/prime.ndll
- name: run
if: inputs.execute
run: bin${{ inputs.sep }}cpp${{ inputs.sep }}TestMain-debug
- name: run (utf8)
if: inputs.execute
run: bin${{ inputs.sep }}cpp-utf8${{ inputs.sep }}TestMain-debug
- name: run (neko)
if: inputs.arch == '64'
if: inputs.execute && inputs.arch == '64'
working-directory: test/cffi/bin/neko
run: neko TestMain.n

Expand All @@ -94,8 +109,9 @@ jobs:
with:
haxe: ${{ inputs.haxe }}
- name: build
run: haxe compile.hxml ${{ matrix.suffix }} -D ${{ env.HXCPP_ARCH_FLAG }}
run: haxe compile.hxml ${{ matrix.suffix }} -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }}
- name: run
if: inputs.execute
run: bin${{ inputs.sep }}TestMain${{ matrix.suffix }}

debugger:
Expand All @@ -112,8 +128,9 @@ jobs:
with:
haxe: ${{ inputs.haxe }}
- name: build
run: haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }}
run: haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }}
- name: run
if: inputs.execute
run: bin${{ inputs.sep }}App-debug

native:
Expand All @@ -130,8 +147,9 @@ jobs:
with:
haxe: ${{ inputs.haxe }}
- name: build
run: haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }}
run: haxe compile.hxml -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }}
- name: run
if: inputs.execute
run: bin${{ inputs.sep }}Native

std:
Expand All @@ -148,17 +166,18 @@ jobs:
with:
haxe: ${{ inputs.haxe }}
- name: setup mariadb
if: runner.os == 'Linux'
if: runner.os == 'Linux' && inputs.execute
run: |
set -ex
sudo apt-get update -qqy
sudo apt-get install -qqy mariadb-server
sudo systemctl start mariadb
sudo mariadb -u root -e "create database hxcpp; grant all privileges on hxcpp.* to hxcpp@localhost identified by 'hxcpp'; flush privileges;"
- name: build
run: haxe compile${{ inputs.arch }}.hxml
run: haxe compile-generic.hxml --cpp bin -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }}
- name: run
run: ${{ inputs.arch == 'Arm64' && 'arm64' || format('cpp{0}', inputs.arch) }}${{ inputs.sep }}Test
if: inputs.execute
run: bin${{ inputs.sep }}Test

cppia:
strategy:
Expand All @@ -181,10 +200,11 @@ jobs:
with:
haxe: ${{ inputs.haxe }}
- name: build host
run: haxe compile-host.hxml -D ${{ env.HXCPP_ARCH_FLAG }}
run: haxe compile-host.hxml -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }}
- name: build client
run: haxe compile-client.hxml -D ${{ env.HXCPP_ARCH_FLAG }}
run: haxe compile-client.hxml -D ${{ env.HXCPP_ARCH_FLAG }} ${{ env.HAXE_TARGET_FLAG }}
- name: run
if: inputs.execute
run: bin${{ inputs.sep }}CppiaHost bin${{ inputs.sep }}client.cppia ${{ matrix.suffix }}

suite:
Expand Down Expand Up @@ -218,8 +238,9 @@ jobs:
# haxe 4 tests don't build with latest utest
if: inputs.haxe != 'latest'
- name: build
run: haxe compile-cpp.hxml -D ${{ env.HXCPP_ARCH_FLAG }} -D no_http
run: haxe compile-cpp.hxml -D ${{ env.HXCPP_ARCH_FLAG }} -D no_http ${{ env.HAXE_TARGET_FLAG }}
- name: run
if: inputs.execute
run: bin${{ inputs.sep }}cpp${{ inputs.sep }}TestMain-debug
build_tool:
runs-on: ${{ inputs.os }}
Expand All @@ -236,6 +257,6 @@ jobs:
shell: bash
run: |
for xml in *.xml; do
haxelib run hxcpp $xml
haxelib run hxcpp $xml -D${{ env.HXCPP_ARCH_FLAG }} ${{ env.HXCPP_TARGET_FLAG }}
haxelib run hxcpp $xml clean
done
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ hxcpp.n

.vscode

test/cxx_standard/main
test/cxx_standard/main.hash
test/cxx_standard/main.exe
test/cxx_standard/main.exe.hash

# Created by https://www.toptal.com/developers/gitignore/api/visualstudio
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudio

Expand Down
7 changes: 3 additions & 4 deletions test/cxx_standard/Build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
<file name="c17.c" c_standard="17" />
</files>

<set name="EXESUFFIX" value=".exe" if="windows" />

<target id="default" tool="linker" toolid="exe" output="main${EXESUFFIX}">
<target id="default" tool="linker" toolid="dll" output="main">
<outdir name="bin" />
<files id="test"/>
</target>
</xml>
</xml>
3 changes: 2 additions & 1 deletion test/cxx_standard/Build_legacy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<file name="main.cpp" />
</files>

<target id="default" tool="linker" toolid="exe" output="main">
<target id="default" tool="linker" toolid="dll" output="main">
<outdir name="bin" />
<files id="test"/>
</target>
</xml>
3 changes: 2 additions & 1 deletion test/cxx_standard/Build_section.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
</section>
</files>

<target id="default" tool="linker" toolid="exe" output="main">
<target id="default" tool="linker" toolid="dll" output="main">
<outdir name="bin" />
<files id="test"/>
</target>
</xml>
4 changes: 4 additions & 0 deletions test/std/compile-generic.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-m Test
-D HXCPP_DEBUGGER
-L hx4compat
-L utest
7 changes: 2 additions & 5 deletions test/std/compile32.hxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
-m Test
compile-generic.hxml
-D HXCPP_M32
-D HXCPP_DEBUGGER
-L hx4compat
-L utest
--cpp cpp32
--cpp cpp32
6 changes: 2 additions & 4 deletions test/std/compile64.hxml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
-m Test
compile-generic.hxml
-D HXCPP_M64
-L hx4compat
-L utest
--cpp cpp64
--cpp cpp64
4 changes: 1 addition & 3 deletions test/std/compileArm64.hxml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
-m Test
compile-generic.hxml
-D HXCPP_ARM64
-L hx4compat
-L utest
--cpp arm64
Loading