File: euslisp-test

package info (click to toggle)
euslisp 9.32%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 55,268 kB
  • sloc: ansic: 41,693; lisp: 3,339; makefile: 286; sh: 238; asm: 138; python: 53
file content (67 lines) | stat: -rwxr-xr-x 2,175 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh

exec 2>&1

set -e

eval $(dpkg-architecture)
case "${DEB_HOST_ARCH}" in
  armhf)
      echo "=="
      echo "=="
      echo "== Skip ${DEB_HOST_ARCH}"
      echo "=="
      echo "=="
      exit 0
    ;;
esac

test_executables_eus0() {
    # if eusrt.l is not exists, it fails before print *user*
    name=$( eus0 "(progn (print *user*) (unix::exit))" )
    assertNotEquals "" "$name"

    # check if lib/llib/unittest.l exists
    name=$( cd /tmp; eus0 "(let ((l \"lib/llib/unittest.l\")) (setq lisp::*exit-on-fatal-error* t) (lisp::install-error-handler #'(lambda (&rest args) (unix::exit 1))) (if (load l) (print *user*)) (unix::exit))" )
    assertNotEquals "" "$name"
}

test_executables_eus1() {
    # if eusrt.l is not exists, it fails before print *user*
    name=$( eus1 "(progn (print *user*) (unix::exit))" )
    assertNotEquals "" "$name"
}

test_executables_eus2() {
    # if eusrt.l is not exists, it fails before print *user*
    name=$( eus2 "(progn (print *user*) (unix::exit))" )
    assertNotEquals "" "$name"
}

test_executables_eusg() {
    # If libeusgeo.so not exists, calling (make-cube) fails.
    name=$( eusg "(progn (print (make-cube 10 10 10)) (unix::exit))" )
    assertNotEquals "" "$name"
}

test_executables_eusx() {
    # if eusx faile to load libeusx.so, it fails to initialize x::*display*
    name=$( eusx "(progn (print (print x::*display*)) (unix::exit))" )
    assertNotEquals "" "$name"

    # if eusx faile to load image functions from libeusgeo.so, it fails to instantiate color-image
    name=$( eusx "(progn (print (instance color-image :init 100 100)) (unix::exit))" )
    assertNotEquals "" "$name"
}

test_executables_eusgl() {
    # if eusgl faile to load libeusgl.so, it fails to initialize gl::*perspective-near*
    name=$( eusgl "(progn (gl::glbegin gl::gl_polygon)(gl::glnormal3fv #f(1 1 1))(gl::glend) (print gl::*perspective-near*) (unix::exit))" )
    assertNotEquals "" "$name"

    # if eusgl failed to load opengl/src/util.c, it fails to call gl::glrotatefv
    name=$( eusgl "(progn (gl::glrotatefv #f(1 1 1 1)) (print gl::*perspective-near*) (unix::exit))" )
    assertNotEquals "" "$name"
}

. shunit2