File: test_python.pro

package info (click to toggle)
gnudatalanguage 0.9.2-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 15,212 kB
  • sloc: cpp: 114,857; sh: 11,170; makefile: 362; awk: 18; python: 6; ansic: 4
file content (18 lines) | stat: -rw-r--r-- 481 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pro test_python

  has_python = ~ (execute("python, 'numpy'") eq 0)  
  if ~ has_python then exit, status=77

  ; testing numpy/scalar return
  if abs(python("numpy", "arccos", .5) - acos(.5)) gt 1e-6 then begin
    message, /conti, 'numpy.arccos(.5) != acos(.5)'
    exit, status=1
  endif

  ; testing numpy/array return
  if ~array_equal(python("numpy", "arange", 5.), findgen(5)) then begin
    message, /conti, 'numpy.arange(5.) != findgen(5)'
    exit, status=1
  endif

end