Debian Codegraph @

debian/tests/jmagickExample

raw
1 #!/bin/sh
2 # autopkgtest check: build a simple program and launch it.
3 # (C) 2024 Pierre Gruet.
4 # Author: Pierre Gruet <[email protected]>
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this package; if not, see https://www.gnu.org/licenses/.
18
19 set -e
20
21 WORKDIR=$(mktemp -d)
22 trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
23
24 cp debian/tests/Example.java $WORKDIR
25 cp debian/tests/in.jpg $WORKDIR
26 cd $WORKDIR
27
28 # Building and launching
29 javac -cp /usr/share/java/jmagick.jar Example.java
30 java --enable-native-access=ALL-UNNAMED -cp .:/usr/share/java/jmagick.jar Example
31
32 # Was the output file created?
33 [ -e out.jpg ]