diff options
author | Joan Touzet <wohali@users.noreply.github.com> | 2018-11-12 19:50:42 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-12 19:50:42 -0500 |
commit | e4b3b09f33972a8e31fd379ce3a70d96e849b34b (patch) | |
tree | a3a1dc2d55186dc19c0ed95263fa4a9daa0474bc | |
parent | 878866c1efa05fbf8fd6cd77e5bbfa966052e96b (diff) | |
download | couchdb-e4b3b09f33972a8e31fd379ce3a70d96e849b34b.tar.gz |
[win32] Fix dev/run and Makefile for test suite (#1731)
-rw-r--r-- | Makefile.win | 19 | ||||
-rw-r--r-- | dev/boot_node.erl | 24 | ||||
-rwxr-xr-x | dev/run | 6 | ||||
-rw-r--r-- | dev/run.cmd | 15 | ||||
-rw-r--r-- | test/elixir/mix.lock | 3 | ||||
-rw-r--r-- | test/elixir/run.cmd | 5 |
6 files changed, 61 insertions, 11 deletions
diff --git a/Makefile.win b/Makefile.win index 67c15fc69..e4c96b734 100644 --- a/Makefile.win +++ b/Makefile.win @@ -123,10 +123,27 @@ check: all # target: eunit - Run EUnit tests, use EUNIT_OPTS to provide custom options eunit: export ERL_AFLAGS = $(shell echo "-config rel/files/eunit.config") eunit: export BUILDDIR = $(shell echo %cd%) -eunit: +eunit: couch @$(REBAR) setup_eunit 2> nul @$(REBAR) -r eunit $(EUNIT_OPTS) +setup-eunit: export BUILDDIR = $(shell pwd) +setup-eunit: export ERL_AFLAGS = $(shell echo "-config rel/files/eunit.config") +setup-eunit: + @$(REBAR) setup_eunit 2> nul + +just-eunit: export BUILDDIR = $(shell pwd) +just-eunit: export ERL_AFLAGS = $(shell echo "-config rel/files/eunit.config") +just-eunit: + @$(REBAR) -r eunit $(EUNIT_OPTS) + +.PHONY: elixir +elixir: + @del /s/q dev\lib 2> nul + @dev\run -a adm:pass --no-eval test\elixir\run.cmd + + + .PHONY: javascript # target: javascript - Run JavaScript test suites or specific ones defined by suites option diff --git a/dev/boot_node.erl b/dev/boot_node.erl index dd55b1b61..922a5ccb6 100644 --- a/dev/boot_node.erl +++ b/dev/boot_node.erl @@ -29,12 +29,24 @@ monitor_parent() -> monitor_parent(PPid) -> timer:sleep(1000), - case os:cmd("kill -0 " ++ PPid) of - "" -> - monitor_parent(PPid); - _Else -> - % Assume _Else is a no such process error - init:stop() + case os:type() of + {unix, _} -> + case os:cmd("kill -0 " ++ PPid) of + "" -> + monitor_parent(PPid); + _Else -> + % Assume _Else is a no such process error + init:stop() + end; + {win32, _} -> + Fmt = "tasklist /fi \"PID eq ~s\" /fo csv /nh", + Retval = os:cmd(io_lib:format(Fmt, [PPid])), + case re:run(Retval, "^\"python.exe\",*") of + {match, _} -> + monitor_parent(PPid); + nomatch -> + init:stop() + end end. @@ -435,10 +435,10 @@ def boot_node(ctx, node): os.path.join(node_etcdir, "local.ini"), "-reltool_config", os.path.join(reldir, "reltool.config"), "-parent_pid", str(os.getpid()), - "-pa", ctx['devdir'], - "-pa", os.path.join(erl_libs, "*"), - "-s", "boot_node" + "-pa", ctx['devdir'] ] + cmd += [ p[:-1] for p in glob.glob(erl_libs + "/*/") ] + cmd += [ "-s", "boot_node" ] if ctx['reset_logs']: mode = "wb" else: diff --git a/dev/run.cmd b/dev/run.cmd new file mode 100644 index 000000000..14ce2276c --- /dev/null +++ b/dev/run.cmd @@ -0,0 +1,15 @@ +@ECHO OFF + +:: Licensed under the Apache License, Version 2.0 (the "License"); you may not +:: use this file except in compliance with the License. You may obtain a copy of +:: the License at +:: +:: http://www.apache.org/licenses/LICENSE-2.0 +:: +:: Unless required by applicable law or agreed to in writing, software +:: distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +:: WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +:: License for the specific language governing permissions and limitations under +:: the License. + +python %~dp0\run %* diff --git a/test/elixir/mix.lock b/test/elixir/mix.lock index 0723e9474..2bd015100 100644 --- a/test/elixir/mix.lock +++ b/test/elixir/mix.lock @@ -1,3 +1,4 @@ %{"httpotion": {:hex, :httpotion, "3.0.3", "17096ea1a7c0b2df74509e9c15a82b670d66fc4d66e6ef584189f63a9759428d", [], [{:ibrowse, "~> 4.4", [hex: :ibrowse, repo: "hexpm", optional: false]}], "hexpm"}, "ibrowse": {:hex, :ibrowse, "4.4.0", "2d923325efe0d2cb09b9c6a047b2835a5eda69d8a47ed6ff8bc03628b764e991", [], [], "hexpm"}, - "jiffy": {:hex, :jiffy, "0.14.11", "919a87d491c5a6b5e3bbc27fafedc3a0761ca0b4c405394f121f582fd4e3f0e5", [], [], "hexpm"}} + "jiffy": {:hex, :jiffy, "0.14.11", "919a87d491c5a6b5e3bbc27fafedc3a0761ca0b4c405394f121f582fd4e3f0e5", [], [], "hexpm"}, +} diff --git a/test/elixir/run.cmd b/test/elixir/run.cmd new file mode 100644 index 000000000..4c649962a --- /dev/null +++ b/test/elixir/run.cmd @@ -0,0 +1,5 @@ +@ECHO OFF + +cd %~dp0 +call mix deps.get +call mix test --trace |