From e6656ecee8692c2c18f1ce6058f3cb46edbbc231 Mon Sep 17 00:00:00 2001 From: Jordan Bracco Date: Tue, 2 Jun 2020 15:08:26 +0200 Subject: [PATCH 1/3] Include arpa/inet.h --- src/apprentice.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/apprentice.c b/src/apprentice.c index 10c09b9..9fb76be 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -40,6 +40,7 @@ // {:bytes, binary()} :: same as :file // {:stop, reason :: atom()} :: exit 0 +#include #include #include #include From 69212838e43bb4c1ac859c438093a253f6d9e8ec Mon Sep 17 00:00:00 2001 From: Jordan Bracco Date: Wed, 3 Jun 2020 16:19:25 +0200 Subject: [PATCH 2/3] Compile test db --- Makefile | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 94ecb19..cb2e93d 100644 --- a/Makefile +++ b/Makefile @@ -13,20 +13,17 @@ RM = rm -Rf # Unit test custom magic file MAGIC = file -TEST_DIRECTORY = test -TARGET_MAGIC = $(TEST_DIRECTORY)/elixir.mgc -SOURCE_MAGIC = $(TEST_DIRECTORY)/elixir + +all: priv/apprentice test/elixir.mgc + +test/%.mgc: test/% + cd test; file -C -m ../$^ priv/apprentice: src/apprentice.c mkdir -p priv $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@ -# Test case - -$(TARGET_MAGIC): $(SOURCE_MAGIC) - cd $(TEST_DIRECTORY); $(MAGIC) -C -m elixir - clean: - $(RM) $(PRIV) $(BEAM_FILES) + $(RM) $(PRIV) $(BEAM_FILES) test/*.mgc .PHONY: clean From c7a4683cd6ecb2cd6239ff73754167644e008592 Mon Sep 17 00:00:00 2001 From: Jordan Bracco Date: Wed, 3 Jun 2020 16:20:12 +0200 Subject: [PATCH 3/3] Add builds for sr.ht and multi platform tests --- .builds/alpine.yaml | 17 +++++++++++++++++ .builds/archlinux.yaml | 17 +++++++++++++++++ .builds/debian-oldstable.yaml | 20 ++++++++++++++++++++ .builds/debian-stable.yaml | 20 ++++++++++++++++++++ .builds/debian-testing.yaml | 20 ++++++++++++++++++++ .builds/fedora-latest.yaml | 22 ++++++++++++++++++++++ .builds/freebsd.yaml | 17 +++++++++++++++++ 7 files changed, 133 insertions(+) create mode 100644 .builds/alpine.yaml create mode 100644 .builds/archlinux.yaml create mode 100644 .builds/debian-oldstable.yaml create mode 100644 .builds/debian-stable.yaml create mode 100644 .builds/debian-testing.yaml create mode 100644 .builds/fedora-latest.yaml create mode 100644 .builds/freebsd.yaml diff --git a/.builds/alpine.yaml b/.builds/alpine.yaml new file mode 100644 index 0000000..579497a --- /dev/null +++ b/.builds/alpine.yaml @@ -0,0 +1,17 @@ +image: alpine/latest +packages: + - elixir + - file-dev +sources: + - https://git.sr.ht/~href/gen_magic +tasks: + - setup: | + mix local.hex --force + - build: | + cd gen_magic + mix deps.get + MIX_ENV=test mix compile + - test: | + cd gen_magic + mix test + diff --git a/.builds/archlinux.yaml b/.builds/archlinux.yaml new file mode 100644 index 0000000..4dc0c26 --- /dev/null +++ b/.builds/archlinux.yaml @@ -0,0 +1,17 @@ +image: archlinux +packages: + - elixir + - file +sources: + - https://git.sr.ht/~href/gen_magic +tasks: + - setup: | + mix local.hex --force + - build: | + cd gen_magic + mix deps.get + MIX_ENV=test mix compile + - test: | + cd gen_magic + mix test + diff --git a/.builds/debian-oldstable.yaml b/.builds/debian-oldstable.yaml new file mode 100644 index 0000000..915f1a2 --- /dev/null +++ b/.builds/debian-oldstable.yaml @@ -0,0 +1,20 @@ +image: debian/oldstable +packages: + - build-essential + - erlang + - erlang-dev + - elixir + - libmagic-dev +sources: + - https://git.sr.ht/~href/gen_magic +tasks: + - setup: | + mix local.hex --force + - build: | + cd gen_magic + mix deps.get + MIX_ENV=test mix compile + - test: | + cd gen_magic + mix test + diff --git a/.builds/debian-stable.yaml b/.builds/debian-stable.yaml new file mode 100644 index 0000000..d6bdbe2 --- /dev/null +++ b/.builds/debian-stable.yaml @@ -0,0 +1,20 @@ +image: debian/stable +packages: + - build-essential + - erlang + - erlang-dev + - elixir + - libmagic-dev +sources: + - https://git.sr.ht/~href/gen_magic +tasks: + - setup: | + mix local.hex --force + - build: | + cd gen_magic + mix deps.get + MIX_ENV=test mix compile + - test: | + cd gen_magic + mix test + diff --git a/.builds/debian-testing.yaml b/.builds/debian-testing.yaml new file mode 100644 index 0000000..bda46e4 --- /dev/null +++ b/.builds/debian-testing.yaml @@ -0,0 +1,20 @@ +image: debian/testing +packages: + - build-essential + - erlang + - erlang-dev + - elixir + - libmagic-dev +sources: + - https://git.sr.ht/~hrefhref/gen_magic +tasks: + - setup: | + mix local.hex --force + - build: | + cd gen_magic + mix deps.get + MIX_ENV=test mix compile + - test: | + cd gen_magic + mix test + diff --git a/.builds/fedora-latest.yaml b/.builds/fedora-latest.yaml new file mode 100644 index 0000000..ba87865 --- /dev/null +++ b/.builds/fedora-latest.yaml @@ -0,0 +1,22 @@ +image: fedora/latest +packages: + - make + - gcc + - kernel-devel + - erlang + - elixir + - file-devel +sources: + - https://git.sr.ht/~href/gen_magic +tasks: + - setup: | + sudo dnf -y group install 'Development Tools' + mix local.hex --force + - build: | + cd gen_magic + mix deps.get + MIX_ENV=test mix compile + - test: | + cd gen_magic + mix test + diff --git a/.builds/freebsd.yaml b/.builds/freebsd.yaml new file mode 100644 index 0000000..3a78947 --- /dev/null +++ b/.builds/freebsd.yaml @@ -0,0 +1,17 @@ +image: freebsd/latest +packages: + - elixir + - gmake +sources: + - https://git.sr.ht/~href/gen_magic +tasks: + - setup: | + mix local.hex --force + - build: | + cd gen_magic + mix deps.get + MIX_ENV=test mix compile + - test: | + cd gen_magic + mix test +