Skip to content

Commit

Permalink
add conditional compile test case for native backend
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-Flash committed Sep 23, 2024
1 parent 599910b commit 2477f81
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/moon/tests/test_cases/cond_comp.in/moon.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
moonc link-core ./target/wasm-gc/release/build/lib/lib.core ./target/wasm-gc/release/build/main/main.core -main username/hello/main -o ./target/wasm-gc/release/build/main/main.wasm -pkg-sources username/hello/lib:./src/lib -pkg-sources username/hello/main:./src/main -target wasm-gc

$ moon build --target wasm --dry-run --sort-input --nostd
moonc build-package ./src/lib/all.mbt ./src/lib/all_wasm.mbt ./src/lib/js_or_wasm.mbt ./src/lib/not_js.mbt ./src/lib/only_wasm.mbt ./src/lib/wasm_release_or_js_debug.mbt -o ./target/wasm/release/build/lib/lib.core -pkg username/hello/lib -pkg-sources username/hello/lib:./src/lib -target wasm
moonc build-package ./src/lib/all.mbt ./src/lib/all_wasm.mbt ./src/lib/js_or_wasm.mbt ./src/lib/native_and_wasm.mbt ./src/lib/not_js.mbt ./src/lib/only_wasm.mbt ./src/lib/wasm_release_or_js_debug.mbt -o ./target/wasm/release/build/lib/lib.core -pkg username/hello/lib -pkg-sources username/hello/lib:./src/lib -target wasm
moonc build-package ./src/main/main.mbt -o ./target/wasm/release/build/main/main.core -pkg username/hello/main -is-main -i ./target/wasm/release/build/lib/lib.mi:lib -pkg-sources username/hello/main:./src/main -target wasm
moonc link-core ./target/wasm/release/build/lib/lib.core ./target/wasm/release/build/main/main.core -main username/hello/main -o ./target/wasm/release/build/main/main.wasm -pkg-sources username/hello/lib:./src/lib -pkg-sources username/hello/main:./src/main -target wasm

Expand All @@ -19,7 +19,7 @@
moonc link-core ./target/js/release/build/lib/lib.core ./target/js/release/build/main/main.core -main username/hello/main -o ./target/js/release/build/main/main.js -pkg-sources username/hello/lib:./src/lib -pkg-sources username/hello/main:./src/main -target js

$ moon build --dry-run --target wasm --sort-input --nostd --debug
moonc build-package ./src/lib/all.mbt ./src/lib/all_wasm.mbt ./src/lib/js_or_wasm.mbt ./src/lib/not_js.mbt ./src/lib/only_debug.mbt ./src/lib/only_wasm.mbt ./src/lib/wasm_release_or_js_debug.mbt -o ./target/wasm/debug/build/lib/lib.core -pkg username/hello/lib -pkg-sources username/hello/lib:./src/lib -target wasm -g
moonc build-package ./src/lib/all.mbt ./src/lib/all_wasm.mbt ./src/lib/js_or_wasm.mbt ./src/lib/native_and_wasm.mbt ./src/lib/not_js.mbt ./src/lib/only_debug.mbt ./src/lib/only_wasm.mbt ./src/lib/wasm_release_or_js_debug.mbt -o ./target/wasm/debug/build/lib/lib.core -pkg username/hello/lib -pkg-sources username/hello/lib:./src/lib -target wasm -g
moonc build-package ./src/main/main.mbt -o ./target/wasm/debug/build/main/main.core -pkg username/hello/main -is-main -i ./target/wasm/debug/build/lib/lib.mi:lib -pkg-sources username/hello/main:./src/main -target wasm -g
moonc link-core ./target/wasm/debug/build/lib/lib.core ./target/wasm/debug/build/main/main.core -main username/hello/main -o ./target/wasm/debug/build/main/main.wasm -pkg-sources username/hello/lib:./src/lib -pkg-sources username/hello/main:./src/main -target wasm -g

Expand Down Expand Up @@ -52,3 +52,8 @@
moonc build-package ./src/main/main.mbt -o ./target/js/release/bundle/main/main.core -pkg username/hello/main -is-main -i ./target/js/release/bundle/lib/lib.mi:lib -pkg-sources username/hello/main:./main -target js
moonc bundle-core ./target/js/release/bundle/lib/lib.core ./target/js/release/bundle/main/main.core -o ./target/js/release/bundle/hello.core

$ moon build --dry-run --target native --sort-input --nostd --debug
moonc build-package ./src/lib/all.mbt ./src/lib/native_and_wasm.mbt ./src/lib/native_only.mbt ./src/lib/not_js.mbt ./src/lib/only_debug.mbt -o ./target/native/debug/build/lib/lib.core -pkg username/hello/lib -pkg-sources username/hello/lib:./src/lib -target native -g
moonc build-package ./src/main/main.mbt -o ./target/native/debug/build/main/main.core -pkg username/hello/main -is-main -i ./target/native/debug/build/lib/lib.mi:lib -pkg-sources username/hello/main:./src/main -target native -g
moonc link-core ./target/native/debug/build/lib/lib.core ./target/native/debug/build/main/main.core -main username/hello/main -o ./target/native/debug/build/main/main.exe -pkg-sources username/hello/lib:./src/lib -pkg-sources username/hello/main:./src/main -target native -g

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"targets": {
"native_only.mbt": ["native"],
"native_and_wasm.mbt": ["native", "wasm"],
"only_js.mbt": ["js"],
"only_wasm.mbt": ["wasm"],
"only_wasm_gc.mbt": ["wasm-gc"],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
test {
let a = 1

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
test {
let a = 1

}

0 comments on commit 2477f81

Please sign in to comment.