Don't build rtest by default
rtest is the only binary that is built for the host and has additional
dependencies: mpfr and mpc. To avoid build issues only build it if
the randomized tests are run. New build target is introduced for
randomized testing, so make check works without rtest.
Tests are no longer copied to the build directory and the runtest.sh
tool is removed as it is not very useful.
diff --git a/Makefile b/Makefile
index b7785bd..850da5e 100644
--- a/Makefile
+++ b/Makefile
@@ -40,14 +40,15 @@
build/lib/libmathlib.a \
ALL_TOOLS = \
- build/bin/runtest.sh \
- build/bin/rtest \
build/bin/mathtest \
build/bin/mathbench \
build/bin/mathbench_libc \
-TESTS = $(wildcard $(srcdir)/test/testcases/*/*.tst)
-ALL_TESTS = $(TESTS:$(srcdir)/test/testcases/%=build/bin/%)
+HOST_TOOLS = \
+ build/bin/rtest \
+
+TESTS = $(wildcard $(srcdir)/test/testcases/directed/*.tst)
+RTESTS = $(wildcard $(srcdir)/test/testcases/random/*.tst)
# Configure these in config.mk, do not make changes in this file.
HOST_CC = cc
@@ -66,10 +67,10 @@
all: $(ALL_LIBS) $(ALL_TOOLS) $(ALL_INCLUDES)
-DIRS = $(dir $(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(ALL_INCLUDES) $(ALL_TESTS))
+DIRS = $(dir $(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(ALL_INCLUDES))
ALL_DIRS = $(sort $(DIRS:%/=%))
-$(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(ALL_OBJS:%.o=%.os) $(ALL_INCLUDES) $(ALL_TESTS): | $(ALL_DIRS)
+$(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(ALL_OBJS:%.o=%.os) $(ALL_INCLUDES): | $(ALL_DIRS)
$(ALL_DIRS):
mkdir -p $@
@@ -115,12 +116,6 @@
build/include/%.h: $(srcdir)/math/include/%.h
cp $< $@
-build/bin/runtest.sh: $(srcdir)/test/runtest.sh
- cp $< $@
-
-build/bin/%.tst: $(srcdir)/test/testcases/%.tst
- cp $< $@
-
clean:
rm -rf build
@@ -147,7 +142,12 @@
install: install-libs install-headers
-check: $(ALL_TOOLS) $(ALL_TESTS)
- build/bin/runtest.sh $(EMULATOR) ./mathtest
+check: $(ALL_TOOLS)
+ cat $(TESTS) | $(EMULATOR) build/bin/mathtest
-.PHONY: all clean distclean install install-tools install-libs install-headers check
+rcheck: $(HOST_TOOLS) $(ALL_TOOLS)
+ cat $(RTESTS) | build/bin/rtest | $(EMULATOR) build/bin/mathtest
+
+check-all: check rcheck
+
+.PHONY: all clean distclean install install-tools install-libs install-headers check rcheck check-all
diff --git a/test/runtest.sh b/test/runtest.sh
deleted file mode 100755
index eaf706a..0000000
--- a/test/runtest.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-
-# runtest.sh - script to execute all mathlib tests
-#
-# Copyright (c) 2015, Arm Limited.
-# SPDX-License-Identifier: Apache-2.0
-#
-# 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.
-
-# cd to bin directory.
-cd "${0%/*}"
-
-# Run the mathtest executable using input generated with rtest.
-# For a native build, all executables can just be run and should work fine.
-# For a cross-build, the actual tests have to be executed in QEMU or an emulator
-# of choice. This is set in the CMake script and filled in here.
-
-find . -iname "*.tst" -print0 | xargs -0 cat | ./rtest | "$@"