X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/abde122a35d85f5db956d652300d7a995d460863..e03c48e0ae58c3d37e03dc3eb0e89d44b07d40f9:/run_tests.sh diff --git a/run_tests.sh b/run_tests.sh index 341c825f..94eb98d9 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -5,12 +5,6 @@ if [ $# -ne 2 ]; then fi set -e -# To update graalvm config, set GRAALVM_HOME, e.g: -# export GRAALVM_HOME=/usr/lib/jvm/java-17-graalvm -if [ ! -z "$GRAALVM_HOME" ]; then - export JAVA_HOME=$GRAALVM_HOME - export SIGNAL_CLI_OPTS='-agentlib:native-image-agent=config-merge-dir=graalvm-config-dir/' -fi NUMBER_1="$1" NUMBER_2="$2" @@ -36,6 +30,13 @@ else fi run() { + # To update graalvm config, set GRAALVM_HOME, e.g: + # export GRAALVM_HOME=/usr/lib/jvm/java-17-graalvm + if [ ! -z "$GRAALVM_HOME" ]; then + export JAVA_HOME=$GRAALVM_HOME + export SIGNAL_CLI_OPTS="-agentlib:native-image-agent=config-merge-dir=graalvm-config-dir-${SIGNAL_CLI_AGENT_ID}/" + fi + set -x if [ "$JSON_RPC" -eq 1 ]; then "$SIGNAL_CLI" $@ @@ -46,25 +47,29 @@ run() { } run_main() { + export SIGNAL_CLI_AGENT_ID=main if [ "$JSON_RPC" -eq 1 ]; then run --json-rpc-socket="$XDG_RUNTIME_DIR/signal-cli/socket" $@ else run --config="$PATH_MAIN" $@ fi + unset SIGNAL_CLI_AGENT_ID } run_linked() { + export SIGNAL_CLI_AGENT_ID=linked if [ "$JSON_RPC" -eq 1 ]; then run --json-rpc-tcp="127.0.0.1:7583" $@ else run --config="$PATH_LINK" $@ fi + unset SIGNAL_CLI_AGENT_ID } register() { NUMBER=$1 PIN=$2 - echo -n "Enter a captcha token (https://signalcaptchas.org/staging/challenge/generate.html): " + echo -n "Enter a captcha token (https://signalcaptchas.org/staging/registration/generate.html): " read CAPTCHA run_main -a "$NUMBER" register --captcha "$CAPTCHA" echo -n "Enter validation code for ${NUMBER}: " @@ -227,3 +232,8 @@ run_main -a "$NUMBER_1" removeDevice -d 2 ## Unregister run_main -a "$NUMBER_1" unregister run_main -a "$NUMBER_2" unregister --delete-account + +if [ ! -z "$GRAALVM_HOME" ]; then + "$GRAALVM_HOME"/lib/svm/bin/native-image-configure generate --input-dir=graalvm-config-dir/ --input-dir=graalvm-config-dir-linked/ --input-dir=graalvm-config-dir-main/ --output-dir=graalvm-config-dir// + rm -r graalvm-config-dir-main graalvm-config-dir-linked +fi