#!/bin/sh
set -C -e -u

cd "$AUTOPKGTEST_TMP"

cat > proc.adb <<EOF
with Ada.Command_Line;
with Ada.Text_IO;
with GNATCOLL.Python;
procedure Proc is
begin
   GNATCOLL.Python.Py_SetProgramNAme (Ada.Command_Line.Command_Name);
   GNATCOLL.Python.Py_Initialize;

   Ada.Text_IO.Put_Line (GNATCOLL.Python.PyString_AsString
                         (GNATCOLL.Python.PyObject_Str
                          (GNATCOLL.Python.Py_None)));

   GNATCOLL.Python.Py_finalize;
end Proc;
EOF

cat > proj.gpr <<EOF
with "gnatcoll_python.gpr";
project Proj is
   for Main use ("proc.adb");
end Proj;
EOF

gprbuild -v proj.gpr

./proc
