Import LinuxCNC source tree
This commit is contained in:
22
tests/module-loading/rtapi-app-main-fails/checkresult
Executable file
22
tests/module-loading/rtapi-app-main-fails/checkresult
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
STDERR=$(dirname "$1")/stderr
|
||||
if [ ! -f "$STDERR" ]; then
|
||||
echo "stderr file not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Linux spelling of ERANGE
|
||||
if grep -E -q 'rtapi_app_main_fails.* Numerical result out of range' "$STDERR"; then
|
||||
#echo "loadrt found the test component, and it failed to load"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# FreeBSD spelling of ERANGE
|
||||
if grep -E -q 'rtapi_app_main_fails.* Result too large' "$STDERR"; then
|
||||
#echo "loadrt found the test component, and it failed to load"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "loadrt did not find the test component"
|
||||
exit 1
|
||||
1
tests/module-loading/rtapi-app-main-fails/control
Normal file
1
tests/module-loading/rtapi-app-main-fails/control
Normal file
@@ -0,0 +1 @@
|
||||
Restrictions: sudo
|
||||
@@ -0,0 +1,17 @@
|
||||
component rtapi_app_main_fails "rtapi_app_main error test";
|
||||
pin out bit boo;
|
||||
option rtapi_app no;
|
||||
function _;
|
||||
license "GPL";
|
||||
|
||||
;;
|
||||
|
||||
int rtapi_app_main(void) {
|
||||
return -ERANGE;
|
||||
}
|
||||
|
||||
void rtapi_app_exit(void) {
|
||||
return;
|
||||
}
|
||||
|
||||
FUNCTION(_) { boo ^= 0x1; }
|
||||
1
tests/module-loading/rtapi-app-main-fails/setup.hal
Normal file
1
tests/module-loading/rtapi-app-main-fails/setup.hal
Normal file
@@ -0,0 +1 @@
|
||||
loadrt rtapi_app_main_fails
|
||||
12
tests/module-loading/rtapi-app-main-fails/test.sh
Normal file
12
tests/module-loading/rtapi-app-main-fails/test.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
${SUDO} halcompile --install rtapi_app_main_fails.comp
|
||||
halrun -v setup.hal
|
||||
RETVAL=$?
|
||||
|
||||
if [ $RETVAL -eq 0 ]; then
|
||||
echo "the module loaded, but shouldn't have"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "the module failed to load, just like it should"
|
||||
exit 0
|
||||
Reference in New Issue
Block a user