]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Add test for IDL
authorMichal Sojka <sojka@os.inf.tu-dresden.de>
Mon, 18 Jul 2011 12:59:28 +0000 (14:59 +0200)
committerMichal Sojka <sojka@os.inf.tu-dresden.de>
Mon, 18 Jul 2011 13:03:06 +0000 (15:03 +0200)
tests/Makefile
tests/idl [new file with mode: 0755]

index eabe6ebc4a1286deabd166ef20b7eaecd165ca38..b086ff5bf0c44aa1031a6f531dfd0e42d64fe004 100644 (file)
@@ -2,7 +2,7 @@ wvtest_SCRIPTS = get_var.sh bin_scripts.sh all_omk_subdirs-recurs-expanded \
 all_omk_subdirs-simply-expanded automatic_subdirs cmetric              \
 default-config extra_rules_subdirs header-files headers-generated      \
 headers-generated-default-cflags headers-nonexisting hooks             \
-ignore_errors includes invocation_dir libraries no-print-directory     \
+idl ignore_errors includes invocation_dir libraries no-print-directory \
 no_vpath omk_config override-config parallel_make programs             \
 programs-cflags programs-cflags-cmdline programs-defs                  \
 programs-test_PROGRAMS qt qt-qmake shlibs sources_dir                  \
diff --git a/tests/idl b/tests/idl
new file mode 100755 (executable)
index 0000000..6db9557
--- /dev/null
+++ b/tests/idl
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+. ./functions.sh
+
+case $OMK_RULES in
+    sysless) echo "SKIPPING sysless RULES!!!!"; exit;
+esac
+
+touch config.omk-default
+
+cat > test.idl <<EOF
+# IDL input for dummy IDL compiler
+EOF
+
+cat > Makefile.omk <<EOF
+bin_PROGRAMS = testclient testserver
+INCLUDES=-I.
+
+testclient_SOURCES = testclient.c
+testclient_CLIENT_IDL = test.idl
+
+testserver_SOURCES = testserver.c
+testserver_LIBS = idlserver
+
+lib_LIBRARIES = idlserver
+idlserver_SERVER_IDL = test.idl
+EOF
+
+cat > idlcomp <<EOF
+#!/bin/sh
+out=\$(basename \${1%.idl})
+echo "int idl_skels;" > \${out}-skels.c
+echo "int idl_common;" > \${out}-common.c
+echo "int idl_stubs;" > \${out}-stubs.c
+echo "extern volatile int idl_skels;
+      extern volatile int idl_common;
+      extern volatile int idl_stubs;" > \${out}.h
+EOF
+chmod +x idlcomp
+
+cat > testclient.c <<EOF
+#include "test.h"
+int main() {
+  idl_common = 0;
+  idl_stubs = 0;
+  return 0;
+}
+EOF
+
+cat > testserver.c <<EOF
+#include "test.h"
+int main() {
+  idl_common = 0;
+  idl_skels = 0;
+  return 0;
+}
+EOF
+
+
+needs_valid_CC
+WVPASS make V=1 IDL_COMPILER=$PWD/idlcomp