forked from alfert/propcheck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmix.exs
132 lines (121 loc) · 3.28 KB
/
mix.exs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
defmodule PropCheck.Mixfile do
@moduledoc "Buildfile for PropCheck"
use Mix.Project
@source_url "https://github.com/alfert/propcheck"
@version "1.4.2-dev"
def project do
[
app: :propcheck,
version: @version,
elixir: "~> 1.7",
elixirc_paths: elixirc_paths(Mix.env()),
build_embedded: Mix.env() == :prod,
start_permanent: Mix.env() == :prod,
test_coverage: [tool: Coverex.Task, console_log: true],
package: package(),
name: "PropCheck",
homepage_url: @source_url,
docs: [
main: "readme",
source_url: @source_url,
source_ref: "v#{@version}",
extras: ["README.md", "CHANGELOG.md"],
extra_section: "Overview"
],
description: description(),
propcheck: [counter_examples: "_build/propcheck.ctx"],
aliases: aliases(),
preferred_cli_env: [
tests: :test,
test_ext: :test,
dialyzer: :test,
parallel_test: :test,
test_parallel: :test
],
deps: deps(),
dialyzer: dialyzer()
]
end
# Hex Package description
defp description do
"""
PropCheck provides property based testing and is an Elixir layer around
PropEr. It is also inspired by Quviq's QuickCheck Elixir library.
"""
end
# Hex Package definition
defp package do
[
maintainers: ["Klaus Alfert"],
licenses: ["GPL 3.0"],
links: %{"GitHub" => @source_url}
]
end
# Configuration for the OTP application
#
# Type `mix help compile.app` for more information
def application do
[
applications: [:logger, :proper, :libgraph],
mod: {PropCheck.App, []},
extra_applications: [:iex]
]
end
# Specifies which paths to compile per environment
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
def aliases do
[
clean: ["clean", "propcheck.clean"],
test_ext: &external_tests/1,
parallel_test: ["test --include concurrency_test --only concurrency_test"],
test_parallel: ["test --include concurrency_test --only concurrency_test"],
tests: ["test_ext", "test"],
lint: [
"credo --strict",
"hex.audit",
"dialyzer"
]
]
end
defp deps do
[
# This is the reference to proper on its github repo - instable.
# {:proper, "~> 1.3", github: "proper-testing/proper"},
{:proper, "~> 1.4"},
{:libgraph, "~> 0.13"},
{:coverex, "~> 1.4", only: :test},
{:credo, "~> 1.4", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.0.0", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.21", only: :dev}
]
end
defp dialyzer do
[
plt_add_deps: :apps_direct,
plt_add_apps: ~w(
ex_unit
iex
mix
compiler
)a,
flags: ~w(
error_handling
race_conditions
unmatched_returns
underspecs
)a
]
end
defp external_tests(_args) do
run = fn arg ->
r = Mix.shell().cmd(arg)
r > 0 && System.at_exit(fn _ -> exit({:shutdown, r}) end)
r
end
run.("./test/verify_storing_counterexamples.sh")
run.("./test/verify-verbose.sh")
run.("./test/verify-detect-exceptions.sh")
run.("./test/verify-verbose-in-elixir-syntax.sh")
end
end