]> rtime.felk.cvut.cz Git - omk.git/blobdiff - tests/programs
NuttX: the adapt to new implementation of ROMFS mounting at /etc
[omk.git] / tests / programs
index 530534a58f6dbf4baf37bc94c5c8435ae66f93a7..98a626ee35879f421aaf5f57c26d360b14a39eb5 100755 (executable)
@@ -1,6 +1,62 @@
-#!/bin/sh
+#!/bin/bash
 
-. ../functions.sh
+. ./wvtest.sh
 
-touch config.omk-default
-make
+
+WVSTART "Compile a single source C program"
+cat > 'test.c' <<'EOF'
+int main() { return 0; }
+EOF
+cat > 'Makefile.omk' <<'EOF' # OMK manual includes this file - do not modify it
+bin_PROGRAMS = test
+test_SOURCES = test.c
+EOF
+needs_valid_CC
+WVPASS make V=1
+
+WVSTART "Compile a multiple source C program"
+cat > 'func.c' <<< "void func() { }"
+cat > 'test.c' <<< "void func(); int main() { func(); return 0; }"
+cat > 'Makefile.omk' <<'EOF'
+bin_PROGRAMS = test
+test_SOURCES = test.c func.c
+EOF
+needs_valid_CC
+WVPASS make V=1
+
+WVSTART "Two programs sharing a source"
+cat > 'func.c' <<< "void func() { }"
+cat > 'p1.c' <<< "void func(); int main() { func(); return 0; }"
+cat > 'p2.c' <<< "void func(); int main() { func(); return 0; }"
+cat > 'Makefile.omk' <<'EOF'
+bin_PROGRAMS = p1 p2
+p1_SOURCES = p1.c func.c
+p2_SOURCES = p2.c func.c
+EOF
+needs_valid_CC
+WVPASS make
+
+
+WVSTART "Generated sources"
+cat > 'Makefile.omk' <<'EOF'
+bin_PROGRAMS = p
+p_GEN_SOURCES = gen.c
+
+gen.c:
+       echo "int main() { return 0; }" > $@
+EOF
+needs_valid_CC
+WVPASS make
+
+WVSTART "Compile a single source C program twice"
+cat > 'test.c' <<'EOF'
+int main() { return 0; }
+EOF
+cat > 'Makefile.omk' <<'EOF' # OMK manual includes this file - do not modify it
+bin_PROGRAMS = test
+test_SOURCES = test.c
+EOF
+needs_valid_CC
+WVPASS make
+touch test.c
+WVPASS make