Skip to content

Commit 9c10138

Browse files
Updated ci and tests
1 parent 6cb8e00 commit 9c10138

File tree

10 files changed

+60
-45
lines changed

10 files changed

+60
-45
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
run: |
2525
sudo apt-get install --quiet -y --no-install-recommends gfortran liblapacke-dev libopenblas-dev
2626
- name: Execute Tests using Pure V Backend with Vlib Math
27-
run: cd vsl; make test
27+
run: cd vsl; ./bin/test
2828
- name: Execute Tests using Pure V Backend with Pure V Math
29-
run: cd vsl; VMATH_BACKEND=ON make test
29+
run: cd vsl; ./bin/test --use-vmath
3030
- name: Execute Tests using Open BLAS Backend
31-
run: cd vsl; CBLAS_BACKEND=ON make test
31+
run: cd vsl; ./bin/test --use-cblas
3232
- name: Execute Tests using Open BLAS Backend and Pure V Math
33-
run: cd vsl; VMATH_BACKEND=ON CBLAS_BACKEND=ON make test
33+
run: cd vsl; ./bin/test --use-vmath --use-cblas

.github/workflows/periodic.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
run: |
2727
sudo apt-get install --quiet -y --no-install-recommends gfortran liblapacke-dev libopenblas-dev
2828
- name: Execute Tests using Pure V Backend with Vlib Math
29-
run: cd vsl; make test
29+
run: cd vsl; ./bin/test
3030
- name: Execute Tests using Pure V Backend with Pure V Math
31-
run: cd vsl; VMATH_BACKEND=ON make test
31+
run: cd vsl; ./bin/test --use-vmath
3232
- name: Execute Tests using Open BLAS Backend
33-
run: cd vsl; CBLAS_BACKEND=ON make test
33+
run: cd vsl; ./bin/test --use-cblas
3434
- name: Execute Tests using Open BLAS Backend and Pure V Math
35-
run: cd vsl; VMATH_BACKEND=ON CBLAS_BACKEND=ON make test
35+
run: cd vsl; ./bin/test --use-vmath --use-cblas

.shellcheckrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
disable=SC1090 # Non-constant source
2+
disable=SC1091 # Not specified as input
3+
disable=SC2034 # Unused variables (they are used but in other scripts)
4+
disable=SC2154 # Referenced, but not assigned

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

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

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 0 additions & 14 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Done. Installation completed.
138138
To test the module, just type the following command:
139139

140140
```sh
141-
$ make test # or ./bin/test
141+
$ ./bin/test # execute `./bin/test -h` to know more about the test command
142142
```
143143

144144
## Contributors

bin/docker

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env sh
22

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

15-
ROOT=$(dirname $0)
15+
ROOT=$(dirname "$0")
1616

1717
source "${ROOT}/util/opts/opts.sh" || exit
1818
source "${ROOT}/util/logs.sh" || exit
@@ -45,14 +45,14 @@ docker_ini() {
4545

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

5353
# docker run
5454
docker_run() {
55-
docker run --rm -it -e DISPLAY=:${XPORT} \
55+
docker run --rm -it -e DISPLAY=:"${XPORT}" \
5656
-v "$(pwd)":"/home/${USER}/vsl" \
5757
-w "/home/${USER}" \
5858
${USER_FLAG} \
@@ -65,5 +65,5 @@ docker_ini
6565
docker_run
6666

6767
# Help shown by default
68-
[[ -z "$documentation" ]] && parse_documentation
68+
[ -z "$documentation" ] && parse_documentation
6969
echo "$documentation"

bin/test

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,47 @@
11
#!/usr/bin/env bash
22

3+
## Copyright (C) 2019-2021 Ulises Jeremias Cornejo Fandos
4+
## Licensed under MIT
5+
##
6+
## @script.name [OPTION] ARGUMENTS...
7+
##
8+
## Options:
9+
## -h, --help Prints usage and example
10+
## --stats Exeute with stats
11+
## --use-cblas Execute tests using cblas
12+
## --use-vmath Use pure V math library as backend
13+
## --use-autofree Execute tests using atofree
14+
##
15+
16+
ROOT=$(dirname "$0")
17+
18+
source "${ROOT}/util/opts/opts.sh" || exit
19+
source "${ROOT}/util/logs.sh" || exit
20+
321
set -eo pipefail
422

523
flags=""
624

7-
if [[ -n "${CBLAS_BACKEND}" ]]; then
25+
if [[ -n "${use_cblas}" ]]; then
826
echo "Running tests using Open BLAS"
927
flags="${flags} -d cblas"
1028
fi
1129

12-
if [[ -n "${VMATH_BACKEND}" ]]; then
30+
if [[ -n "${use_vmath}" ]]; then
1331
echo "Running tests using V Math"
1432
flags="${flags} -d vmath"
1533
fi
1634

17-
if [[ -n "${AUTOFREE}" ]]; then
35+
if [[ -n "${use_autofree}" ]]; then
1836
echo "Running tests using V Math"
1937
flags="${flags} -autofree"
2038
fi
2139

40+
if [[ -n "${stats}" ]]; then
41+
echo "Running tests with stats"
42+
flags="${flags} -stats"
43+
fi
44+
2245
echo "Executing tests with command: \"v ${flags} test .\""
2346
v ${flags} test .
2447

bin/util/logs.sh

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
1-
RED=`tput setaf 1`
2-
GREEN=`tput setaf 2`
3-
YELLOW=`tput setaf 3`
4-
RESET=`tput sgr0`
1+
#!/usr/bin/env sh
2+
3+
RED=$(tput setaf 1)
4+
GREEN=$(tput setaf 2)
5+
YELLOW=$(tput setaf 3)
6+
RESET=$(tput sgr0)
57
CHECK=""
68
CROSS=""
79
WARN=""
810

911
describe() {
10-
printf "$1"
12+
printf "%s" "$1"
1113
dots=${2:-3}
12-
for i in $(seq 1 ${dots}); do sleep 0.035; printf "."; done
14+
for i in $(seq 1 "${dots}"); do sleep 0.035; printf "."; done
1315
sleep 0.035
1416
}
1517

1618
log_warn() {
1719
message=${1:-"Warning"}
1820
log="${YELLOW}${WARN} ${message}${RESET}\n"
19-
printf " ${log}"
20-
[ -f "$3" ] && printf "$2 ${log}" >> $3
21+
printf " %s" "${log}"
22+
[ -f "$3" ] && printf "%s %s" "$2" "${log}" >> "$3"
2123
}
2224

2325
log_failed() {
2426
message=${1:-"Failed"}
2527
log="${RED}${CROSS} ${message}${RESET}\n"
26-
printf " ${log}"
27-
[ -f "$3" ] && printf "$2 ${log}" >> $3
28+
printf " %s" "${log}"
29+
[ -f "$3" ] && printf "%s %s" "$2" "${log}" >> "$3"
2830
}
2931

3032
log_success() {
3133
message=${1:-"Success"}
3234
log="${GREEN}${CHECK} ${message}${RESET}\n"
33-
printf " ${log}"
34-
[ -f "$3" ] && printf "$2 ${log}" >> $3
35+
printf " %s" "${log}"
36+
[ -f "$3" ] && printf "%s %s" "$2" "${log}" >> "$3"
3537
}

static/DOCS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Done. Installation completed.
130130
To test the module, just type the following command:
131131

132132
```sh
133-
$ make test # or ./bin/test
133+
$ ./bin/test # execute `./bin/test -h` to know more about the test command
134134
```
135135

136136
## Contributors

0 commit comments

Comments
 (0)