mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-29 01:26:03 +00:00
example: add script to execute all
This patch will save your time to check example. ./all.sh [interval time between examples, default is 1 second]
This commit is contained in:
parent
100d98d82e
commit
d349f73222
2 changed files with 26 additions and 0 deletions
22
src/examples/all.sh
Executable file
22
src/examples/all.sh
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/bash
|
||||||
|
RED='\033[31m'
|
||||||
|
GREEN='\033[32m'
|
||||||
|
NC='\033[0m'
|
||||||
|
|
||||||
|
INTERVAL=${1:-1}
|
||||||
|
EXAMPLES=`find . -executable -type f | sort | uniq`
|
||||||
|
for EXAMPLE in $EXAMPLES
|
||||||
|
do
|
||||||
|
if [[ $EXAMPLE == *.sh ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "Execute: "${GREEN}$EXAMPLE${NC}" for "$INTERVAL" second(s)"
|
||||||
|
$EXAMPLE &
|
||||||
|
EXAMPLE_PID=$!
|
||||||
|
sleep $INTERVAL
|
||||||
|
kill -s SIGTERM $EXAMPLE_PID
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo -e "Something wrong with: "${RED}$EXAMPLE${NC}
|
||||||
|
fi
|
||||||
|
done
|
|
@ -67,3 +67,7 @@ if get_option('bindings').contains('capi') == true
|
||||||
dependencies : examples_dep)
|
dependencies : examples_dep)
|
||||||
endforeach
|
endforeach
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
execute_all_src = join_paths(meson.source_root(), 'src/examples/all.sh')
|
||||||
|
execute_all_dest = join_paths(meson.build_root(), 'src/examples/all.sh')
|
||||||
|
run_command('cp', execute_all_src, execute_all_dest)
|
||||||
|
|
Loading…
Add table
Reference in a new issue