Browse Source

Improve tests' platform detection

Fixes a small warning printed on OSX, and don't run a specific
test on FreeBSD (compiles a C library not compatible with FreeBSD).
Loïc Hoguin 9 years ago
parent
commit
41ea5e7fe7
2 changed files with 12 additions and 4 deletions
  1. 10 4
      test/Makefile
  2. 2 0
      test/core_deps.mk

+ 10 - 4
test/Makefile

@@ -19,12 +19,18 @@ APP_TO_CLEAN = $(subst -,_,$(patsubst clean-%,%,$@))
 
 ERL = erl +A0 -noinput -boot start_clean
 
-# Platform, condensed version.
+# Platform detection, condensed version.
 
-ifeq ($(shell uname -o),Msys)
-	PLATFORM = msys2
+UNAME_S := $(shell uname -s)
+
+ifeq ($(UNAME_S),Darwin)
+PLATFORM = darwin
+else ifeq ($(UNAME_S),FreeBSD)
+PLATFORM = freebsd
+else ifeq ($(shell uname -o),Msys)
+PLATFORM = msys2
 else
-	PLATFORM = unix
+PLATFORM = unix
 endif
 
 # Some systems do not have sub-second file times resolution.

+ 2 - 0
test/core_deps.mk

@@ -41,6 +41,7 @@ core-deps-build-c-8cc: build clean-core-deps-build-c-8cc
 		halt()"
 endif
 
+ifneq ($(PLATFORM),freebsd)
 core-deps-build-c-imagejs: build clean-core-deps-build-c-imagejs
 
 	$i "Bootstrap a new OTP library named $(APP)"
@@ -67,6 +68,7 @@ core-deps-build-c-imagejs: build clean-core-deps-build-c-imagejs
 		{ok, Deps} = application:get_key($(APP), applications), \
 		false = lists:member(imagejs, Deps), \
 		halt()"
+endif
 
 core-deps-build-erl: build clean-core-deps-build-erl