Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

rename to project_erlang_windows

+96 -15
+13 -4
.github/workflows/ci.yaml
··· 109 109 args: "--workspace --target ${{ matrix.target }}" 110 110 use-cross: ${{ matrix.use-cross }} 111 111 112 - - name: test/project_erlang 112 + - name: test/project_erlang (non-windows) 113 113 run: | 114 114 gleam run 115 115 gleam check 116 116 gleam test 117 117 gleam docs build 118 118 working-directory: ./test/project_erlang 119 - if: ${{ matrix.run-integration-tests }} 119 + if: ${{ matrix.os != 'windows-latest' && matrix.run-integration-tests }} 120 + 121 + - name: test/project_erlang (windows) 122 + run: | 123 + gleam run 124 + gleam check 125 + gleam test 126 + gleam docs build 127 + working-directory: ./test/project_erlang_windows 128 + if: ${{ matrix.os == 'windows-latest' && matrix.run-integration-tests }} 120 129 121 130 - name: test/project_erlang export erlang-shipment (non-windows) 122 131 run: | ··· 125 134 working-directory: ./test/project_erlang 126 135 if: ${{ matrix.os != 'windows-latest' && matrix.run-integration-tests }} 127 136 128 - - name: test/project_erlang_min export erlang-shipment (windows) 137 + - name: test/project_erlang export erlang-shipment (windows) 129 138 run: | 130 139 gleam export erlang-shipment 131 140 .\build\erlang-shipment\entrypoint.ps1 run 132 - working-directory: ./test/project_erlang_min 141 + working-directory: ./test/project_erlang_windows 133 142 if: ${{ matrix.os == 'windows-latest' && matrix.run-integration-tests }} 134 143 135 144 - name: test/project_javascript
test/project_erlang_min/.gitignore test/project_erlang_windows/.gitignore
test/project_erlang_min/gleam.toml test/project_erlang_windows/gleam.toml
test/project_erlang_min/manifest.toml test/project_erlang_windows/manifest.toml
test/project_erlang_min/priv/hello.txt test/project_erlang_windows/priv/hello.txt
-5
test/project_erlang_min/src/elixir_file.ex
··· 1 - defmodule ElixirFile do 2 - def main() do 3 - "Hello, from the Elixir module!" 4 - end 5 - end
-6
test/project_erlang_min/src/erlang_file.erl
··· 1 - -module(erlang_file). 2 - 3 - -export([main/0]). 4 - 5 - main() -> 6 - <<"Hello, from the Erlang module!"/utf8>>.
+4
test/project_erlang_min/src/project.gleam test/project_erlang_windows/src/project.gleam
··· 4 4 io.println("Hello, from Gleam compiled to Erlang!") 5 5 io.println(erlang_function()) 6 6 io.println(elixir_function()) 7 + io.println(another_elixir_function()) 7 8 } 8 9 9 10 @external(erlang, "erlang_file", "main") ··· 11 12 12 13 @external(erlang, "Elixir.ElixirFile", "main") 13 14 fn elixir_function() -> String 15 + 16 + @external(erlang, "Elixir.ElixirFileAgain", "main") 17 + fn another_elixir_function() -> String
+11
test/project_erlang_windows/src/elixir_file.ex
··· 1 + defmodule ElixirFile do 2 + def main() do 3 + "Hello, from the Elixir module!" 4 + end 5 + end 6 + 7 + defmodule ElixirFileAgain do 8 + def main() do 9 + "Hello, from another Elixir module!" 10 + end 11 + end
+9
test/project_erlang_windows/src/erlang_file.erl
··· 1 + -module(erlang_file). 2 + 3 + -export([main/0]). 4 + 5 + -include("erlang_header.hrl"). 6 + 7 + main() -> 8 + String = header_function(), 9 + <<"Hello, from the Erlang module!\n"/utf8, String/binary>>.
+2
test/project_erlang_windows/src/erlang_header.hrl
··· 1 + header_function() -> 2 + <<"Hello, from the Erlang header!">>.
+5
test/project_erlang_windows/test/elixir_test_file.ex
··· 1 + defmodule ElixirTestFile do 2 + def main() do 3 + "Hello, from the Elixir test module!" 4 + end 5 + end
+9
test/project_erlang_windows/test/erlang_test_file.erl
··· 1 + -module(erlang_test_file). 2 + 3 + -export([main/0]). 4 + 5 + -include("erlang_test_header.hrl"). 6 + 7 + main() -> 8 + String = header_function(), 9 + <<"Hello, from the Erlang test module!\n"/utf8, String/binary>>.
+2
test/project_erlang_windows/test/erlang_test_header.hrl
··· 1 + header_function() -> 2 + <<"Hello, from the Erlang test header!">>.
+41
test/project_erlang_windows/test/project_test.gleam
··· 1 + import gleam/io 2 + import gleam/dynamic.{type Dynamic} 3 + import project 4 + import gleeunit 5 + import gleam/erlang/atom.{from_string as atom_from_string} 6 + 7 + pub fn main() { 8 + project.main() 9 + io.println("Hello, from the Gleam test module!") 10 + io.println(erlang_function()) 11 + io.println(elixir_function()) 12 + gleeunit.main() 13 + } 14 + 15 + pub fn rebar3_dep_function_test() { 16 + io.println("Testing calling a rebar3 library (that uses headers)") 17 + rebar3_dep_function() 18 + } 19 + 20 + pub fn mix_dep_function_test() { 21 + io.println("Testing calling a mix library") 22 + mix_dep_function() 23 + } 24 + 25 + @external(erlang, "erlang_test_file", "main") 26 + fn erlang_function() -> String 27 + 28 + @external(erlang, "certifi", "cacertfile") 29 + fn rebar3_dep_function() -> Dynamic 30 + 31 + @external(erlang, "Elixir.ElixirTestFile", "main") 32 + fn elixir_function() -> String 33 + 34 + @external(erlang, "Elixir.Countries", "all") 35 + fn mix_dep_function() -> Dynamic 36 + 37 + // Testing for this bug in metadata encoding. 38 + // https://github.com/gleam-lang/gleam/commit/c8f3bd0ddbf61c27ea35f37297058ecca7515f6c 39 + pub fn name_test() { 40 + let assert True = atom.from_string("ok") == atom_from_string("ok") 41 + }