aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
author1138-4EB <1138-4EB@users.noreply.github.com>2019-11-21 17:39:24 +0000
committertgingold <tgingold@users.noreply.github.com>2019-11-21 18:39:24 +0100
commite506f77e8f6ddeb3e114a3b7e3ce5f114192d801 (patch)
treed9387c5867ba98c81988591713249915230db9e3 /testsuite
parent03862a4607fd127e6570a3e141a92265a23c2a68 (diff)
downloadghdl-e506f77e8f6ddeb3e114a3b7e3ce5f114192d801.tar.gz
ghdl-e506f77e8f6ddeb3e114a3b7e3ce5f114192d801.tar.bz2
ghdl-e506f77e8f6ddeb3e114a3b7e3ce5f114192d801.zip
Actions: add workflow 'push' (#1016)
* use CC=clang to build C sources on macOS * actions: ensure that shared libs are in the PATH on windows * ci: add GitHub Actions 'push' workflow * ci: fix group labels * dist: add GRAY to ansi_color * ci: use same scripts for GHA and Travis
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/gna/bug097/testsuite.sh8
-rwxr-xr-xtestsuite/testsuite.sh53
2 files changed, 51 insertions, 10 deletions
diff --git a/testsuite/gna/bug097/testsuite.sh b/testsuite/gna/bug097/testsuite.sh
index 126e39c03..b1836a423 100755
--- a/testsuite/gna/bug097/testsuite.sh
+++ b/testsuite/gna/bug097/testsuite.sh
@@ -2,8 +2,12 @@
. ../../testenv.sh
-gcc -c -fPIC getrand.c
-gcc -o getrand.so --shared getrand.o
+if [ -z $CC ]; then
+ CC="gcc"
+fi
+
+$CC -c -fPIC getrand.c
+$CC -o getrand.so --shared getrand.o
analyze tb.vhdl
elab_simulate tb
diff --git a/testsuite/testsuite.sh b/testsuite/testsuite.sh
index 797e733eb..ae6b7f54f 100755
--- a/testsuite/testsuite.sh
+++ b/testsuite/testsuite.sh
@@ -34,20 +34,57 @@ gend () {
:
}
-[ -n "$CI" ] && {
- echo "INFO: set 'gstart' and 'gend' for CI"
+if [ -n "$TRAVIS" ]; then
+ echo "INFO: set 'gstart' and 'gend' for TRAVIS"
+ # This is a trimmed down copy of https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/bash/*
+ travis_time_start() {
+ # `date +%N` returns the date in nanoseconds. It is used as a replacement for $RANDOM, which is only available in bash.
+ travis_timer_id=`date +%N`
+ travis_start_time=$(travis_nanoseconds)
+ echo "travis_time:start:$travis_timer_id"
+ }
+ travis_time_finish() {
+ travis_end_time=$(travis_nanoseconds)
+ local duration=$(($travis_end_time-$travis_start_time))
+ echo "travis_time:end:$travis_timer_id:start=$travis_start_time,finish=$travis_end_time,duration=$duration"
+ }
+
+ if [ "$TRAVIS_OS_NAME" = "osx" ]; then
+ travis_nanoseconds() {
+ date -u '+%s000000000'
+ }
+ else
+ travis_nanoseconds() {
+ date -u '+%s%N'
+ }
+ fi
+
gstart () {
- printf '::[group]'
+ echo "travis_fold:start:group"
+ travis_time_start
print_start "$@"
- SECONDS=0
}
gend () {
- duration=$SECONDS
- echo '::[endgroup]'
- printf "${ANSI_GRAY}took $(($duration / 60)) min $(($duration % 60)) sec.${ANSI_NOCOLOR}\n"
+ travis_time_finish
+ echo "travis_fold:end:group"
}
-} || echo "INFO: not in CI"
+else
+ if [ -n "$CI" ]; then
+ echo "INFO: set 'gstart' and 'gend' for CI"
+ gstart () {
+ printf '::group::'
+ print_start "$@"
+ SECONDS=0
+ }
+
+ gend () {
+ duration=$SECONDS
+ echo '::endgroup::'
+ printf "${ANSI_GRAY}took $(($duration / 60)) min $(($duration % 60)) sec.${ANSI_NOCOLOR}\n"
+ }
+ fi
+fi
#---