summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-11-06 17:59:17 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-11-06 18:08:45 +0100
commit4cb9250e55e389b05162cfc0ec44e8a8d508f0ee (patch)
tree73ce03318c9e938716d54b1c9fee2c4a2e977122
parent2823373cd60021fde10007dc94d04eef99840f7f (diff)
dd
-rw-r--r--.gitignore1
-rw-r--r--run-show-coverage.sh47
-rw-r--r--userconfig-sthalik@Windows-Clang.cmake3
3 files changed, 40 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
index 67a9f9d6..412bfe28 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@
/.idea/
/images/
/userconfig*.cmake
+*.profraw
diff --git a/run-show-coverage.sh b/run-show-coverage.sh
index cdd7503c..32bd11cf 100644
--- a/run-show-coverage.sh
+++ b/run-show-coverage.sh
@@ -17,16 +17,36 @@ if test -z "$1"; then
usage
fi
+if ! command -v llvm-profdata >/dev/null 2>&1; then
+ export PATH="/clang64/bin:/usr/bin:$PATH"
+fi
+
compile=0
run=0
generate=0
open=0
+exe=floormat-editor
+
+find_exe() {
+ case "$1" in
+ floormat-*) exe="$1" ;;
+ *) exe="floormat-$1" ;;
+ esac
+}
while test $# -gt 0; do
case "$1" in
- all) compile=1; run=1; generate=1; open=1 ;;
+ all)
+ {
+ compile=1; run=1; generate=1; open=1 exe=floormat-test
+ if test $# -gt 1; then shift; find_exe "$1"; fi
+ } ;;
compile) compile=1 ;;
- run) compile=1; run=1 ;;
+ run)
+ {
+ compile=1; run=1;
+ if test $# -gt 1; then shift; find_exe "$1"; fi
+ } ;;
generate) generate=1 ;;
open) open=1 ;;
*) echo "error: invalid command-line argument '$1'" >&2; usage ;;
@@ -35,12 +55,12 @@ while test $# -gt 0; do
done
#find build directory
-build="build-coverage"
+build="build/coverage"
if test -f CMakeLists.txt && test -f resources.conf; then
cd ./"${build}"
elif test -d bin; then
cd ../../"${build}"
-elif test -x floormat-editor || test -x floormat-editor.exe; then
+elif test -x "${exe}" || test -x "${exe}".exe; then
cd ../../"${build}"
elif test -d install/bin && test -d install/share/floormat; then
cd ../"${build}"
@@ -56,13 +76,18 @@ if ! test -f "./CMakeCache.txt"; then
exit 65
fi
-exe=
-for i in ./install/bin/floormat-editor.exe ./install/bin/floormat-editor; do
- if test -x "$i"; then
- exe="$i"
- break
- fi
-done
+case "${exe}" in
+[a-zA-Z]:/*) : ;;
+[a-zA-Z]:\\*) : ;;
+/*) : ;;
+\\*) : ;;
+*) for i in ./install/bin/"${exe}".exe ./install/bin/"${exe}"; do
+ if test -x "$i"; then
+ exe="$i"
+ break
+ fi
+ done ;;
+esac
prof=coverage
diff --git a/userconfig-sthalik@Windows-Clang.cmake b/userconfig-sthalik@Windows-Clang.cmake
index 0d6cf89c..8f70fb28 100644
--- a/userconfig-sthalik@Windows-Clang.cmake
+++ b/userconfig-sthalik@Windows-Clang.cmake
@@ -44,6 +44,9 @@ sets(STRING
)
add_compile_options(-Xclang -fcolor-diagnostics -fdiagnostics-color=always)
+if(NOT CMAKE_CXX_COMPILER_VERSION LESS "18.0")
+ add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fassume-nothrow-exception-dtor>)
+endif()
set(FLOORMAT_SUBMODULE-SDL2 1)