]> rtime.felk.cvut.cz Git - omk.git/blob - tests/idl
Update wvtool
[omk.git] / tests / idl
1 #!/bin/bash
2
3 . ./wvtest.sh
4
5 case $OMK_RULES in
6     sysless) echo "SKIPPING sysless RULES!!!!"; exit;
7 esac
8
9 touch config.omk-default
10
11 cat > test.idl <<EOF
12 # IDL input for dummy IDL compiler
13 EOF
14
15 cat > Makefile.omk <<EOF
16 bin_PROGRAMS = testclient testserver
17 INCLUDES=-I.
18
19 testclient_SOURCES = testclient.c
20 testclient_CLIENT_IDL = test.idl
21
22 testserver_SOURCES = testserver.c
23 testserver_LIBS = idlserver
24
25 lib_LIBRARIES = idlserver
26 idlserver_SERVER_IDL = test.idl
27 EOF
28
29 create_idlcomp() {
30 cat > idlcomp <<EOF
31 #!/bin/sh
32 out=\$(basename \${1%.idl})
33 echo "int idl_skels;" > \${out}-skels.c
34 echo "int idl_common;" > \${out}-common.c
35 echo "int idl_stubs;" > \${out}-stubs.c
36 echo "extern volatile int idl_skels;
37       extern volatile int idl_common;
38       extern volatile int idl_stubs;" > \${out}.h
39 EOF
40 chmod +x idlcomp
41 }
42 create_idlcomp
43
44 cat > testclient.c <<EOF
45 #include "test.h"
46 int main() {
47   idl_common = 0;
48   idl_stubs = 0;
49   return 0;
50 }
51 EOF
52
53 cat > testserver.c <<EOF
54 #include "test.h"
55 int main() {
56   idl_common = 0;
57   idl_skels = 0;
58   return 0;
59 }
60 EOF
61
62
63 needs_valid_CC
64 WVPASS make V=1 IDL_COMPILER=$PWD/idlcomp
65
66 WVSTART "Two idl files in a program"
67 create_idlcomp
68 cat > test1.idl <<< "# IDL input for dummy IDL compiler"
69 cat > test2.idl <<< "# IDL input for dummy IDL compiler"
70 cat > testclient.c <<< "int main() {return 0;}"
71
72 cat > Makefile.omk <<EOF
73 bin_PROGRAMS = testclient
74 INCLUDES=-I.
75
76 testclient_SOURCES = testclient.c
77 testclient_CLIENT_IDL = test1.idl test2.idl
78 EOF
79 cat > config.omk <<< IDL_COMPILER=$PWD/idlcomp
80
81 WVPASS make