#!/bin/dash

# test that smartleia API keeps its compatibility with the other python
# module. At start time, it should not generate backtrace but only an indication
# specifying that there is no board connected.
# The expected return code should be 42.

set +e

smartleia
result=$?

set -e

if test $result -ne 42; then
    echo "received error code ${result}, something wrong happened"
    # this should not happen, something went wrong before smartleia detected
    # that there is no board connected.
    return 1
fi

echo "received code 42: legitimate return value. Exit with no error"
return 0
