Skip to content

Commit

Permalink
Updated ci and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ulises-jeremias committed Apr 5, 2021
1 parent 6cb8e00 commit 9c10138
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 45 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
run: |
sudo apt-get install --quiet -y --no-install-recommends gfortran liblapacke-dev libopenblas-dev
- name: Execute Tests using Pure V Backend with Vlib Math
run: cd vsl; make test
run: cd vsl; ./bin/test
- name: Execute Tests using Pure V Backend with Pure V Math
run: cd vsl; VMATH_BACKEND=ON make test
run: cd vsl; ./bin/test --use-vmath
- name: Execute Tests using Open BLAS Backend
run: cd vsl; CBLAS_BACKEND=ON make test
run: cd vsl; ./bin/test --use-cblas
- name: Execute Tests using Open BLAS Backend and Pure V Math
run: cd vsl; VMATH_BACKEND=ON CBLAS_BACKEND=ON make test
run: cd vsl; ./bin/test --use-vmath --use-cblas
8 changes: 4 additions & 4 deletions .github/workflows/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
run: |
sudo apt-get install --quiet -y --no-install-recommends gfortran liblapacke-dev libopenblas-dev
- name: Execute Tests using Pure V Backend with Vlib Math
run: cd vsl; make test
run: cd vsl; ./bin/test
- name: Execute Tests using Pure V Backend with Pure V Math
run: cd vsl; VMATH_BACKEND=ON make test
run: cd vsl; ./bin/test --use-vmath
- name: Execute Tests using Open BLAS Backend
run: cd vsl; CBLAS_BACKEND=ON make test
run: cd vsl; ./bin/test --use-cblas
- name: Execute Tests using Open BLAS Backend and Pure V Math
run: cd vsl; VMATH_BACKEND=ON CBLAS_BACKEND=ON make test
run: cd vsl; ./bin/test --use-vmath --use-cblas
4 changes: 4 additions & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
disable=SC1090 # Non-constant source
disable=SC1091 # Not specified as input
disable=SC2034 # Unused variables (they are used but in other scripts)
disable=SC2154 # Referenced, but not assigned
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019-2020 Ulises Jeremias Cornejo Fandos
Copyright (c) 2019-2021 Ulises Jeremias Cornejo Fandos

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 0 additions & 14 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Done. Installation completed.
To test the module, just type the following command:

```sh
$ make test # or ./bin/test
$ ./bin/test # execute `./bin/test -h` to know more about the test command
```

## Contributors
Expand Down
10 changes: 5 additions & 5 deletions bin/docker
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env sh

## Copyright (C) 2019-2020 Ulises Jeremias Cornejo Fandos
## Copyright (C) 2019-2021 Ulises Jeremias Cornejo Fandos
## Licensed under MIT
##
## @script.name [OPTION] ARGUMENTS...
Expand All @@ -12,7 +12,7 @@
## --log-file=LOG_FILE_PATH Logs file path, is /tmp/install_progress_log_$(date +'%m-%d-%y_%H:%M:%S').txt by default.
##

ROOT=$(dirname $0)
ROOT=$(dirname "$0")

source "${ROOT}/util/opts/opts.sh" || exit
source "${ROOT}/util/logs.sh" || exit
Expand Down Expand Up @@ -45,14 +45,14 @@ docker_ini() {

if [[ -n "${build}" ]] || [[ "$(docker images ${IMAGE_NAME_ARRAY[0]} | grep ${IMAGE_NAME_ARRAY[1]} 2> /dev/null)" = "" ]]; then
docker build -f Dockerfile -t "${IMAGE_NAME}" \
--build-arg USERNAME=${USER} \
--build-arg USERNAME="${USER}" \
.
fi
}

# docker run
docker_run() {
docker run --rm -it -e DISPLAY=:${XPORT} \
docker run --rm -it -e DISPLAY=:"${XPORT}" \
-v "$(pwd)":"/home/${USER}/vsl" \
-w "/home/${USER}" \
${USER_FLAG} \
Expand All @@ -65,5 +65,5 @@ docker_ini
docker_run

# Help shown by default
[[ -z "$documentation" ]] && parse_documentation
[ -z "$documentation" ] && parse_documentation
echo "$documentation"
29 changes: 26 additions & 3 deletions bin/test
Original file line number Diff line number Diff line change
@@ -1,24 +1,47 @@
#!/usr/bin/env bash

## Copyright (C) 2019-2021 Ulises Jeremias Cornejo Fandos
## Licensed under MIT
##
## @script.name [OPTION] ARGUMENTS...
##
## Options:
## -h, --help Prints usage and example
## --stats Exeute with stats
## --use-cblas Execute tests using cblas
## --use-vmath Use pure V math library as backend
## --use-autofree Execute tests using atofree
##

ROOT=$(dirname "$0")

source "${ROOT}/util/opts/opts.sh" || exit
source "${ROOT}/util/logs.sh" || exit

set -eo pipefail

flags=""

if [[ -n "${CBLAS_BACKEND}" ]]; then
if [[ -n "${use_cblas}" ]]; then
echo "Running tests using Open BLAS"
flags="${flags} -d cblas"
fi

if [[ -n "${VMATH_BACKEND}" ]]; then
if [[ -n "${use_vmath}" ]]; then
echo "Running tests using V Math"
flags="${flags} -d vmath"
fi

if [[ -n "${AUTOFREE}" ]]; then
if [[ -n "${use_autofree}" ]]; then
echo "Running tests using V Math"
flags="${flags} -autofree"
fi

if [[ -n "${stats}" ]]; then
echo "Running tests with stats"
flags="${flags} -stats"
fi

echo "Executing tests with command: \"v ${flags} test .\""
v ${flags} test .

Expand Down
26 changes: 14 additions & 12 deletions bin/util/logs.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
RED=`tput setaf 1`
GREEN=`tput setaf 2`
YELLOW=`tput setaf 3`
RESET=`tput sgr0`
#!/usr/bin/env sh

RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
RESET=$(tput sgr0)
CHECK=""
CROSS=""
WARN=""

describe() {
printf "$1"
printf "%s" "$1"
dots=${2:-3}
for i in $(seq 1 ${dots}); do sleep 0.035; printf "."; done
for i in $(seq 1 "${dots}"); do sleep 0.035; printf "."; done
sleep 0.035
}

log_warn() {
message=${1:-"Warning"}
log="${YELLOW}${WARN} ${message}${RESET}\n"
printf " ${log}"
[ -f "$3" ] && printf "$2 ${log}" >> $3
printf " %s" "${log}"
[ -f "$3" ] && printf "%s %s" "$2" "${log}" >> "$3"
}

log_failed() {
message=${1:-"Failed"}
log="${RED}${CROSS} ${message}${RESET}\n"
printf " ${log}"
[ -f "$3" ] && printf "$2 ${log}" >> $3
printf " %s" "${log}"
[ -f "$3" ] && printf "%s %s" "$2" "${log}" >> "$3"
}

log_success() {
message=${1:-"Success"}
log="${GREEN}${CHECK} ${message}${RESET}\n"
printf " ${log}"
[ -f "$3" ] && printf "$2 ${log}" >> $3
printf " %s" "${log}"
[ -f "$3" ] && printf "%s %s" "$2" "${log}" >> "$3"
}
2 changes: 1 addition & 1 deletion static/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Done. Installation completed.
To test the module, just type the following command:

```sh
$ make test # or ./bin/test
$ ./bin/test # execute `./bin/test -h` to know more about the test command
```

## Contributors
Expand Down

0 comments on commit 9c10138

Please sign in to comment.