Add Makefile, fix multiple things

Makefile: useful to run in parallel at no cost
This commit is contained in:
Théophile Bastian 2018-03-26 17:20:29 +02:00
parent d45b1ffc36
commit 461f3d3ef0
5 changed files with 20 additions and 7 deletions

7
Makefile Normal file
View file

@ -0,0 +1,7 @@
TESTS := $(shell find "glibc/build/" -executable -name 'test-*' -or -executable -name 'tst-*')
TESTS_SUFFIX := $(TESTS:=.test)
all: $(TESTS_SUFFIX)
%.test: %
./run_single_test.sh $<

2
env
View file

@ -26,4 +26,4 @@ export PYTHONPATH="$PYTHONPATH:$python_base"
export PS1="(efc_env) $PS1"
unset base_dir glibc_base python_version python_base
unset glibc_base python_version python_base

View file

@ -1,3 +1,3 @@
intervaltree==2.1.0
pyelftools==0.24
git+https://github.com/eliben/pyelftools.git
sortedcontainers==1.5.9

View file

@ -5,12 +5,12 @@ cd "$base_dir"
source ./env
if [ "$#" -le 1 ] ; then
if [ "$#" -lt 1 ] ; then
>&2 echo -e "Missing argument: test name. Usage example:\n" \
"$0 math/test-matherr"
exit 1
fi
test_file="$1"
test_file="$(echo "$1" | sed 's|glibc/build/||')"
glibc_base="$base_dir/glibc/build"
test_path="$glibc_base/$test_file"

View file

@ -22,6 +22,10 @@ function gitclone {
fi
}
function do_make {
make $(MAKE_FLAGS) $1
}
base_dir="$(dirname "$(readlink -f "$0")")"
cd "$base_dir"
@ -42,12 +46,14 @@ source venv/bin/activate
pip install -r requirements.txt || fail
# Compiling glibc
install_dir="$base_dir/glibc/build/install"
status_update "Compiling base glibc"
(
mkdir -p glibc/build/install
cd glibc/build
../configure --prefix="$base_dir/glibc/build/install" || exit 1
make || exit 1
../configure --prefix="$install_dir" || exit 1
do_make || exit 1
do_make install || exit 1
) || fail
# Compiling testsuite
@ -55,7 +61,7 @@ status_update "Compiling glibc testsuite"
status_update "Feel free to go and drink some coffee now. This will take some time."
(
cd glibc/build
make check || exit 1
CPATH="$install_dir/include:$CPATH" do_make check || exit 1
) || fail
# Done!