alpha
Login
or
Join now
nandi.uk
/
gleam
Star
2
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Fork of daniellemaywood.uk/gleam — Wasm codegen work
Star
2
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
rename to project_erlang_windows
author
bun
committer
Louis Pilfold
date
2 years ago
(Nov 5, 2023, 12:21 PM UTC)
commit
75759da8
75759da8c7760b9c994b9ae593810b61039090fe
parent
2333fce8
2333fce8a8c8de69e637baecee44caf5fee4c7e2
+96
-15
15 changed files
Expand all
Collapse all
Unified
Split
.github
workflows
ci.yaml
test
project_erlang_min
src
elixir_file.ex
erlang_file.erl
project_erlang_windows
.gitignore
gleam.toml
manifest.toml
priv
hello.txt
src
elixir_file.ex
erlang_file.erl
erlang_header.hrl
project.gleam
test
elixir_test_file.ex
erlang_test_file.erl
erlang_test_header.hrl
project_test.gleam
+13
-4
.github/workflows/ci.yaml
View file
Reviewed
···
109
109
args: "--workspace --target ${{ matrix.target }}"
110
110
use-cross: ${{ matrix.use-cross }}
111
111
112
112
-
- name: test/project_erlang
112
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
119
-
if: ${{ matrix.run-integration-tests }}
119
119
+
if: ${{ matrix.os != 'windows-latest' && matrix.run-integration-tests }}
120
120
+
121
121
+
- name: test/project_erlang (windows)
122
122
+
run: |
123
123
+
gleam run
124
124
+
gleam check
125
125
+
gleam test
126
126
+
gleam docs build
127
127
+
working-directory: ./test/project_erlang_windows
128
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
128
-
- name: test/project_erlang_min export erlang-shipment (windows)
137
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
132
-
working-directory: ./test/project_erlang_min
141
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
View file
Reviewed
test/project_erlang_min/gleam.toml
test/project_erlang_windows/gleam.toml
View file
Reviewed
test/project_erlang_min/manifest.toml
test/project_erlang_windows/manifest.toml
View file
Reviewed
test/project_erlang_min/priv/hello.txt
test/project_erlang_windows/priv/hello.txt
View file
Reviewed
-5
test/project_erlang_min/src/elixir_file.ex
Reviewed
···
1
1
-
defmodule ElixirFile do
2
2
-
def main() do
3
3
-
"Hello, from the Elixir module!"
4
4
-
end
5
5
-
end
-6
test/project_erlang_min/src/erlang_file.erl
Reviewed
···
1
1
-
-module(erlang_file).
2
2
-
3
3
-
-export([main/0]).
4
4
-
5
5
-
main() ->
6
6
-
<<"Hello, from the Erlang module!"/utf8>>.
+4
test/project_erlang_min/src/project.gleam
test/project_erlang_windows/src/project.gleam
View file
Reviewed
···
4
4
io.println("Hello, from Gleam compiled to Erlang!")
5
5
io.println(erlang_function())
6
6
io.println(elixir_function())
7
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
15
+
16
16
+
@external(erlang, "Elixir.ElixirFileAgain", "main")
17
17
+
fn another_elixir_function() -> String
+11
test/project_erlang_windows/src/elixir_file.ex
View file
Reviewed
···
1
1
+
defmodule ElixirFile do
2
2
+
def main() do
3
3
+
"Hello, from the Elixir module!"
4
4
+
end
5
5
+
end
6
6
+
7
7
+
defmodule ElixirFileAgain do
8
8
+
def main() do
9
9
+
"Hello, from another Elixir module!"
10
10
+
end
11
11
+
end
+9
test/project_erlang_windows/src/erlang_file.erl
View file
Reviewed
···
1
1
+
-module(erlang_file).
2
2
+
3
3
+
-export([main/0]).
4
4
+
5
5
+
-include("erlang_header.hrl").
6
6
+
7
7
+
main() ->
8
8
+
String = header_function(),
9
9
+
<<"Hello, from the Erlang module!\n"/utf8, String/binary>>.
+2
test/project_erlang_windows/src/erlang_header.hrl
View file
Reviewed
···
1
1
+
header_function() ->
2
2
+
<<"Hello, from the Erlang header!">>.
+5
test/project_erlang_windows/test/elixir_test_file.ex
View file
Reviewed
···
1
1
+
defmodule ElixirTestFile do
2
2
+
def main() do
3
3
+
"Hello, from the Elixir test module!"
4
4
+
end
5
5
+
end
+9
test/project_erlang_windows/test/erlang_test_file.erl
View file
Reviewed
···
1
1
+
-module(erlang_test_file).
2
2
+
3
3
+
-export([main/0]).
4
4
+
5
5
+
-include("erlang_test_header.hrl").
6
6
+
7
7
+
main() ->
8
8
+
String = header_function(),
9
9
+
<<"Hello, from the Erlang test module!\n"/utf8, String/binary>>.
+2
test/project_erlang_windows/test/erlang_test_header.hrl
View file
Reviewed
···
1
1
+
header_function() ->
2
2
+
<<"Hello, from the Erlang test header!">>.
+41
test/project_erlang_windows/test/project_test.gleam
View file
Reviewed
···
1
1
+
import gleam/io
2
2
+
import gleam/dynamic.{type Dynamic}
3
3
+
import project
4
4
+
import gleeunit
5
5
+
import gleam/erlang/atom.{from_string as atom_from_string}
6
6
+
7
7
+
pub fn main() {
8
8
+
project.main()
9
9
+
io.println("Hello, from the Gleam test module!")
10
10
+
io.println(erlang_function())
11
11
+
io.println(elixir_function())
12
12
+
gleeunit.main()
13
13
+
}
14
14
+
15
15
+
pub fn rebar3_dep_function_test() {
16
16
+
io.println("Testing calling a rebar3 library (that uses headers)")
17
17
+
rebar3_dep_function()
18
18
+
}
19
19
+
20
20
+
pub fn mix_dep_function_test() {
21
21
+
io.println("Testing calling a mix library")
22
22
+
mix_dep_function()
23
23
+
}
24
24
+
25
25
+
@external(erlang, "erlang_test_file", "main")
26
26
+
fn erlang_function() -> String
27
27
+
28
28
+
@external(erlang, "certifi", "cacertfile")
29
29
+
fn rebar3_dep_function() -> Dynamic
30
30
+
31
31
+
@external(erlang, "Elixir.ElixirTestFile", "main")
32
32
+
fn elixir_function() -> String
33
33
+
34
34
+
@external(erlang, "Elixir.Countries", "all")
35
35
+
fn mix_dep_function() -> Dynamic
36
36
+
37
37
+
// Testing for this bug in metadata encoding.
38
38
+
// https://github.com/gleam-lang/gleam/commit/c8f3bd0ddbf61c27ea35f37297058ecca7515f6c
39
39
+
pub fn name_test() {
40
40
+
let assert True = atom.from_string("ok") == atom_from_string("ok")
41
41
+
}