]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Rework libraries and shlibs tests
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 12 Nov 2013 15:46:45 +0000 (16:46 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 12 Nov 2013 16:57:49 +0000 (17:57 +0100)
tests/libraries
tests/libraries.files [deleted file]
tests/shlibs
tests/shlibs.files [deleted file]
tests/shlibs.rules [deleted file]

index 84fecc4251a8b7cd7da7ed8ab00c92246edeeacb..bbe0220bbae1c61f160df8b7be40f9b2e0ea89e6 100755 (executable)
@@ -1,7 +1,37 @@
 #!/bin/bash
 
-. ./functions.sh
+. ./wvtest.sh
 
-touch config.omk-default
+WVSTART "Static library"
+cat > 'funca.c' <<EOF
+#include <mylib.h>
+int funca(int a) {return a+1;}
+EOF
+cat > 'funcb.c' <<EOF
+#include <mylib.h>
+int funcb(int b) {return b*2;}
+EOF
+cat > 'mylib.h' <<EOF
+int funca(int a);
+int funcb(int b);
+EOF
+cat > 'test.c' <<EOF
+#include <mylib.h>
+int main() {
+  funca(10);
+  funcb(20);
+  return 0;
+}
+EOF
+cat > 'Makefile.omk' <<EOF
+lib_LIBRARIES = mylib
+mylib_SOURCES = funca.c funcb.c
+include_HEADERS = mylib.h
+
+bin_PROGRAMS = test
+test_SOURCES = test.c
+test_LIBS = mylib
+EOF
 needs_valid_CC
 WVPASS make
+WVPASS test -f _compiled/lib/libmylib.a
diff --git a/tests/libraries.files b/tests/libraries.files
deleted file mode 100644 (file)
index fa89138..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-cat > 'funcb.c' <<EOF
-#include <mylib.h>
-
-int funcb(int b)
-{
-       return b*2;
-}
-EOF
-cat > 'test.c' <<EOF
-#include <stdio.h>
-#include <mynumber.h>
-int main()
-{
-        printf("NUMBER is %d\n", NUMBER);
-        return 0;
-}
-EOF
-cat > 'Makefile.omk' <<EOF
-lib_LIBRARIES = mylib
-mylib_SOURCES = funca.c funcb.c
-include_HEADERS = mylib.h
-EOF
-cat > 'funca.c' <<EOF
-#include <mylib.h>
-
-int funca(int a)
-{
-       return a+1;
-}
-EOF
-cat > 'mylib.h' <<EOF
-#ifndef MYLIB_H
-#define MYLIB_H
-
-int funca(int a);
-int funcb(int b);
-
-
-#endif
-EOF
index 618a7971430150038e8abd1304e7b1f2055af870..9adc3e72dc320dd541e7899511334906de4376ea 100755 (executable)
@@ -5,7 +5,42 @@ case $OMK_RULES in
        exit 0;;
 esac
 
-. ./functions.sh
+. ./wvtest.sh
 
-touch config.omk-default
+WVSTART "Shared library"
+
+cat > 'funca.c' <<EOF
+#include <mylib.h>
+int funca(int a) {return a+1;}
+EOF
+cat > 'funcb.c' <<EOF
+#include <mylib.h>
+int funcb(int b) {return funca(b*2);}
+EOF
+cat > 'mylib.h' <<EOF
+int funca(int a);
+int funcb(int b);
+EOF
+cat > 'test.c' <<EOF
+#include <stdio.h>
+#include <mylib.h>
+int main()
+{
+        printf("result is %d\n", funcb(1));
+        return 0;
+}
+EOF
+cat > 'Makefile.omk' <<EOF
+shared_LIBRARIES = a b
+a_SOURCES = funca.c
+b_SOURCES = funcb.c
+b_LIBS = a
+
+include_HEADERS = mylib.h
+
+bin_PROGRAMS = test
+test_SOURCES = test.c
+test_LIBS = a b
+EOF
+needs_valid_CC
 WVPASS make
diff --git a/tests/shlibs.files b/tests/shlibs.files
deleted file mode 100644 (file)
index dcf2b86..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-cat > 'funcb.c' <<EOF
-#include <mylib.h>
-
-int funcb(int b)
-{
-       return funca(b*2);
-}
-EOF
-cat > 'test.c' <<EOF
-#include <stdio.h>
-#include <mylib.h>
-int main()
-{
-        printf("result is %d\n", funcb(1));
-        return 0;
-}
-EOF
-cat > 'Makefile.omk' <<EOF
-shared_LIBRARIES = a b
-a_SOURCES = funca.c
-b_SOURCES = funcb.c
-b_LIBS = a
-
-include_HEADERS = mylib.h
-
-bin_PROGRAMS = test
-test_SOURCES = test.c
-test_LIBS = a b
-EOF
-cat > 'funca.c' <<EOF
-#include <mylib.h>
-
-int funca(int a)
-{
-       return a+1;
-}
-EOF
-cat > 'mylib.h' <<EOF
-#ifndef MYLIB_H
-#define MYLIB_H
-
-int funca(int a);
-int funcb(int b);
-
-
-#endif
-EOF
diff --git a/tests/shlibs.rules b/tests/shlibs.rules
deleted file mode 100644 (file)
index 30b7b1b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-python: rules not in ['sdcc', 'rtems', 'sysless-keil51', 'sysless-keil16x']