From abaa729b46ed941aa1cbe84f74dbd15ae45823c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sat, 22 Jun 2019 21:45:48 +0200 Subject: Fix the eunit-test-dir test on Windows It was using os:cmd("echo ...") which on Windows preserves spaces. One possible fix would have been to remove the space, but I instead removed the use of os:cmd("echo ...") to avoid similar issues in the future. --- test/plugin_eunit.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/plugin_eunit.mk b/test/plugin_eunit.mk index e5fc197..8fa7b59 100644 --- a/test/plugin_eunit.mk +++ b/test/plugin_eunit.mk @@ -312,7 +312,7 @@ eunit-test-dir: init "-module($(APP))." \ "-ifdef(TEST)." \ "-include_lib(\"eunit/include/eunit.hrl\")." \ - "log_test() -> os:cmd(\"echo $(APP) >> eunit.log\")." \ + "log_test() -> file:write_file(\"eunit.log\", \"$(APP)\n\", [append])." \ "-endif." > $(APP)/src/$(APP).erl $i "Generate a module containing EUnit tests in TEST_DIR" @@ -320,7 +320,7 @@ eunit-test-dir: init $t printf "%s\n" \ "-module($(APP)_tests)." \ "-include_lib(\"eunit/include/eunit.hrl\")." \ - "log_test() -> os:cmd(\"echo $(APP)_tests >> eunit.log\")." > $(APP)/test/$(APP)_tests.erl + "log_test() -> file:write_file(\"eunit.log\", \"$(APP)_tests\n\", [append])." > $(APP)/test/$(APP)_tests.erl $i "Check that EUnit runs both tests" $t $(MAKE) -C $(APP) eunit | grep -c "2 tests passed." | grep -q 1 -- cgit v1.2.3