File: test_with_utop.sh

package info (click to toggle)
marionnet 0.90.6+bzr508-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 9,532 kB
  • sloc: ml: 18,130; sh: 5,384; xml: 1,152; makefile: 1,003; ansic: 275
file content (64 lines) | stat: -rwxr-xr-x 1,487 bytes parent folder | download
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
#!/bin/bash

set -e
TOPLEVEL=${1:-utop}

which $TOPLEVEL &>/dev/null || {
  echo "Error: $0: $TOPLEVEL not found; install it please."
  exit 2
}

function realpath {
 local B=$(basename $1)
 local D=$(dirname $1)
 (builtin cd $D; echo $PWD/$B)
}

# Make
make compile_for_testing
make marionnet.cma

# Set the variable MARIONNET_HOME
source CONFIGME # set the variable `prefix'
MARIONNET_HOME=${prefix:-/usr/local}/share/marionnet

# Copy all modules to a single directory:
FLATTENED_DIRECTORY=_build/_build.flattened
mkdir -p $FLATTENED_DIRECTORY
find _build -path $FLATTENED_DIRECTORY -prune -o -type f -exec cp -fl {} $FLATTENED_DIRECTORY/ \;
find $MARIONNET_HOME -maxdepth 1 -type f -exec cp -fs {} $FLATTENED_DIRECTORY/ \;
pushd $FLATTENED_DIRECTORY; find $MARIONNET_HOME/* -maxdepth 0 -type d -exec ln -sf {} \;; popd

# Preamble:
PREAMBLE=$(mktemp)
cat > $PREAMBLE  <<EOF
#require "ocamlbricks";;
#load "ocamlbricks.cma";;
Ocamlbricks_log.enable ();;
Printexc.record_backtrace true;;
#require "unix";;
#require "threads";;
#require "str";;
#require "lablgtk2";;
#require "lablgtk2.glade";;
#require "lablgtk2.sourceview2";;
(* --- *)
#load "gtkThread.cmo";;
#load "marionnet.cma";;
(* --- *)
Sys.chdir "$(realpath $FLATTENED_DIRECTORY)" ;;
(* let back = GMain.Main.main ;; *)
EOF

export OCAMLRUNPARAM=-b
# ---
cd $FLATTENED_DIRECTORY
ln -sf ../../etc
ln -sf ../../share
ln -sf ../../po

# Go:
export MARIONNET_DEBUG=true
utop -init $PREAMBLE || CODE=$?
rm -f $PREAMBLE
exit $CODE