]> rtime.felk.cvut.cz Git - omk.git/commitdiff
First converted test to run under wvtest
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 21 Feb 2011 23:06:48 +0000 (00:06 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 22 Feb 2011 00:45:47 +0000 (01:45 +0100)
45 files changed:
tests/Makefile
tests/all_omk_subdirs-recurs-expanded
tests/all_omk_subdirs-recurs-expanded.files [new symlink]
tests/all_omk_subdirs-simply-expanded
tests/all_omk_subdirs-simply-expanded.files [new symlink]
tests/all_omk_subdirs.inc
tests/automatic_subdirs
tests/cmetric
tests/default-config
tests/extra_rules_subdirs.files
tests/functions.sh
tests/header-files.files
tests/headers-generated
tests/headers-generated-default-cflags
tests/headers-generated-default-cflags.files [new symlink]
tests/headers-generated.files
tests/headers-nonexisting.files [moved from tests/headers-nonexising.files with 100% similarity]
tests/hooks.files
tests/includes
tests/includes.files
tests/libraries
tests/no-print-directory
tests/no_vpath
tests/programs
tests/programs-cflags
tests/programs-cflags-cmdline
tests/programs-cflags-cmdline.files [new symlink]
tests/programs-cflags.files [new symlink]
tests/programs-defs
tests/programs-defs.files [new symlink]
tests/programs-test_PROGRAMS
tests/programs-test_PROGRAMS.files [new symlink]
tests/programs.files
tests/qt
tests/qt-qmake
tests/qt-qmake.files [new symlink]
tests/qt.files
tests/shlibs
tests/sources_in_subdirectory
tests/subdirs_first-force-subdir.files [new symlink]
tests/use_leaf_makefiles.files
tests/vxworks
tests/whole_tree
tests/whole_tree.files
tests/wvtest.sh

index a2921ca9ba17e34e2d1e2ad5106094653fc90427..90b1f85f879088d57e0417b9d202182ab0525f7e 100644 (file)
@@ -1,7 +1,6 @@
-wvtest_SCRIPTS = bin_scripts.sh all_omk_subdirs.inc                    \
-all_omk_subdirs-recurs-expanded all_omk_subdirs-simply-expanded                \
-automatic_subdirs bin_scripts.sh cmetric default-config                        \
-extra_rules_subdirs header-files headers-generated                     \
+wvtest_SCRIPTS = 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     \
 no_vpath omk_config override-config parallel_make programs             \
@@ -20,4 +19,4 @@ wvtest: $(wvtest_SCRIPTS:%=run-%)
 RULES=$(shell cd ../rules; ls)
 
 run-%: %
-       for i in $(RULES); do OMK_RULES=$$i ./$* || break; done
+       for i in $(RULES); do OMK_RULES=$$i ./$* || exit 1; done
index a11ddf35c3d5e49bec9bd647661e285c38472f58..1ba01ed2abb863917c551479576b611fb59a955d 100755 (executable)
@@ -1,4 +1,6 @@
 #!/bin/bash
 
+. ./functions.sh
+
 OP="="
-. ./all_omk_subdirs.inc
+. "$OMK_TESTSROOT/all_omk_subdirs.inc"
diff --git a/tests/all_omk_subdirs-recurs-expanded.files b/tests/all_omk_subdirs-recurs-expanded.files
new file mode 120000 (symlink)
index 0000000..b559a88
--- /dev/null
@@ -0,0 +1 @@
+all_omk_subdirs.files
\ No newline at end of file
index 9574036d615dd65337a9f721d1fe711d3a11ec56..9b47b3b2eed1d3faa91710f627b23eb8d8671019 100755 (executable)
@@ -1,4 +1,6 @@
-#!/bin/bash\r
-\r
-OP=":="\r
-. ./all_omk_subdirs.inc\r
+#!/bin/bash
+
+. ./functions.sh
+
+OP=":="
+. "$OMK_TESTSROOT/all_omk_subdirs.inc"
diff --git a/tests/all_omk_subdirs-simply-expanded.files b/tests/all_omk_subdirs-simply-expanded.files
new file mode 120000 (symlink)
index 0000000..b559a88
--- /dev/null
@@ -0,0 +1 @@
+all_omk_subdirs.files
\ No newline at end of file
index 2c0340998cd0626b0868d9c34d5813db043d4956..511eec2cf09daf64c0e14cd24cecc0c338641f1a 100755 (executable)
@@ -1,13 +1,10 @@
 #!/bin/bash
 
-. ./functions.sh
-
 touch config.omk-default
 echo "SUBDIRS $OP \$(ALL_OMK_SUBDIRS)" > Makefile.omk
-
-OUTPUT=$(make 2>&1) || canttest
-echo $OUTPUT | grep make-in-dir1 || error "Make was not called in dir1" 
-echo $OUTPUT | grep make-in-dir2 || error "Make was not called in dir2"
-echo $OUTPUT | grep make-in-dir3 && error "Make shouldn't be called in dir3" 
+WVPASS bash -o pipefail -c 'make 2>&1 | tee output'
+grep make-in-dir1 output || error "Make was not called in dir1" 
+grep make-in-dir2 output || error "Make was not called in dir2"
+grep make-in-dir3 output && error "Make shouldn't be called in dir3" 
 
 exit 0
index 3f7d13153672e2ffb39c3a9032328e06a1d84216..3e747b8b3dfc2d7d609db7af5f9748622ae9a5ab 100755 (executable)
@@ -1,12 +1,12 @@
-#!/bin/bash\r
-\r
-. ./functions.sh\r
-\r
-touch config.omk-default\r
-\r
-OUTPUT=$(make 2>&1) || canttest\r
-echo $OUTPUT | grep make-in-dir1 || error "Make was not called in dir1" \r
-echo $OUTPUT | grep make-in-dir2 || error "Make was not called in dir2"\r
-echo $OUTPUT | grep make-in-dir3 && error "Make shouldn't be called in dir3" \r
-\r
-exit 0\r
+#!/bin/bash
+
+. ./functions.sh
+
+touch config.omk-default
+
+OUTPUT=$(make 2>&1) || canttest
+echo $OUTPUT | grep make-in-dir1 || error "Make was not called in dir1" 
+echo $OUTPUT | grep make-in-dir2 || error "Make was not called in dir2"
+echo $OUTPUT | grep make-in-dir3 && error "Make shouldn't be called in dir3" 
+
+exit 0
index 0bb00e17650b33f666b88f46a191a9bc611a7344..c7d2e66e6726f41c4b0d03d616d0c59e819bcd3b 100755 (executable)
@@ -3,6 +3,8 @@
 . ./functions.sh
 
 touch config.omk-default
+needs_valid_CC
+
 make NM=false && error "cmetric error was not correctly detected"
 make || error "compilation error"
 cmp correct_cmetric_config.h _compiled/include/test/cmetric_config.h || \
index 6e78e41516453a305e63c9a68e78511969b233a7..39656d289166ca02b8a7e463a7e391fa5f8702bb 100755 (executable)
@@ -1,4 +1,6 @@
 #!/bin/bash
-make || exit 2
-echo "Default config differs" > _error
-diff -u config.omk-correct config.omk-default || exit 1
+
+. ./functions.sh
+
+WVPASS make
+WVPASS diff -u config.omk-correct config.omk-default
index c0a01e6616c6c4f60fabb54b0cdc1f3dc7cafea8..4c696a8ed8539a63d0aabfadcded137685b10ecf 100644 (file)
@@ -12,7 +12,7 @@ int main()
         return 0;
 }
 EOF
-cat > 'subdir2/tools/Makefile.omk' <<EOF
+cat > 'subdir2/tools/Makefile.omk' <<'EOF'
 $(info Extra rules goal: $(MAKECMDGOALS))
 
 bin_PROGRAMS = test
@@ -20,7 +20,7 @@ test_SOURCES = test.c
 EOF
 echo 'SUBDIRS=subdir subdir2' > 'Makefile.omk'
 mkdir 'subdir'
-cat > 'subdir/Makefile.omk' <<EOF
+cat > 'subdir/Makefile.omk' <<'EOF'
 
 $(info Main rules goal: $(MAKECMDGOALS))
 EOF
index 3682037ebb41239cdaaa52887eed8e803a3d91df..0d6122b43a956e1cb8d68e01eae4cba34ac0eb5d 100644 (file)
@@ -7,8 +7,7 @@
 # Exit on the first error
 set -e
 
-WVSTART "$(basename $0 .sh)"
-WVPASS . ../$(basename $0 .sh).files
+WVPASS . ../../$(basename $0 .sh).files
 omkize
 
 findup() {
@@ -37,4 +36,3 @@ canttest() {
     _wvfind_caller
     _wvcheck 1 "$1 (cannot be test)"
 }
-
index 60d0cd8e7ed724dcac67b34d269f791ac144aa78..8b738e91c72f32673a4a89e3662fb5fdede0d753 100644 (file)
@@ -1,5 +1,5 @@
 mkdir 'orte'
-cat > 'orte/orte_config_omk_win32.h' <<EOF
+cat > 'orte/orte_config_omk_win32.h' <<'EOF'
 /* orte/include/orte/orte_config.h.  Generated by configure.  */
 /* orte/include/orte/orte_config.h.in.  Generated from configure.in by autoheader.  */
 
@@ -244,7 +244,7 @@ cat > 'orte/orte_config_omk_win32.h' <<EOF
 /* #undef inline */
 #endif
 EOF
-cat > 'ls-include.txt' <<EOF
+cat > 'ls-include.txt' <<'EOF'
 .:
 orte
 periph
@@ -258,7 +258,7 @@ orte_config.h
 ./periph:
 sci_channels.h
 EOF
-cat > 'Makefile.omk' <<EOF
+cat > 'Makefile.omk' <<'EOF'
 include_HEADERS = x.h periph/sci_regs.h
 nobase_include_HEADERS = periph/sci_channels.h
 renamed_include_HEADERS = x.h->y.h
@@ -266,7 +266,7 @@ renamed_include_HEADERS += orte/orte_config_omk_win32.h->orte/orte_config.h
 EOF
 echo '// Hello' > 'x.h'
 mkdir 'periph'
-cat > 'periph/sci_regs.h' <<EOF
+cat > 'periph/sci_regs.h' <<'EOF'
 /*******************************************************************
   Components for embedded applications builded for
   laboratory and medical instruments firmware
@@ -301,7 +301,7 @@ struct sci_regs {
   
 #endif /* _SCI_REGS_H */
 EOF
-cat > 'periph/sci_channels.h' <<EOF
+cat > 'periph/sci_channels.h' <<'EOF'
 /*******************************************************************
   Components for embedded applications builded for
   laboratory and medical instruments firmware
index 9ebc5fb43f358eb26886f04f9c2aac18f4a664ea..d67ee23a3987917e9338a6ee29a9fe47a39cebf8 100755 (executable)
@@ -10,6 +10,8 @@ test -f "$GC" || error "Can't find the produced global config"
 
 grep -Fv "/* config files:" $GC | diff -u correct/global.h - || error "Global config differs"
 
+needs_valid_CC
+
 make || error "Can't run make to produce local config"
 make CFLAGS=-Wall || error "Make failed with custom CFLAGS"
 LC=$(find _build -wholename '*/lincan/lincan_config.h')
index dfba2ea45a95b0e8b71846802dc0b12b31b644b7..b4b33b07709322c02860b9e71eb801c14210d136 100755 (executable)
@@ -5,6 +5,9 @@
 make default-config || error default-config
 
 make distclean
+
+needs_valid_CC
+
 LC_MESSAGES=C
 export LC_MESSAGES
 set -o pipefail
diff --git a/tests/headers-generated-default-cflags.files b/tests/headers-generated-default-cflags.files
new file mode 120000 (symlink)
index 0000000..7c5ced5
--- /dev/null
@@ -0,0 +1 @@
+headers-generated.files
\ No newline at end of file
index 7370e5839bcacaf0ea4d9daaa097f50e7dea8b8d..e6a4b987be9a9ee286270e3166ee004cbea57dd0 100644 (file)
@@ -1,5 +1,5 @@
 mkdir 'correct'
-cat > 'correct/global.h' <<EOF
+cat > 'correct/global.h' <<'EOF'
 /* Automatically generated from */
 #ifndef  _global_H 
 #define  _global_H 
@@ -9,7 +9,7 @@ cat > 'correct/global.h' <<EOF
 #define CONFIG_TEST_APOS "Text+apostrophes"
 #endif /* _global_H */
 EOF
-cat > 'correct/toplevel_config.h' <<EOF
+cat > 'correct/toplevel_config.h' <<'EOF'
 /* Automatically generated from */
 #ifndef _LOCAL_CONFIG_H
 #define _LOCAL_CONFIG_H
@@ -19,7 +19,7 @@ cat > 'correct/toplevel_config.h' <<EOF
 #define CONFIG_OC_LINCAN 1
 #endif /*_LOCAL_CONFIG_H*/
 EOF
-cat > 'correct/lincan_config.h' <<EOF
+cat > 'correct/lincan_config.h' <<'EOF'
 /* Automatically generated from */
 #ifndef _LOCAL_CONFIG_H
 #define _LOCAL_CONFIG_H
@@ -50,7 +50,7 @@ cat > 'correct/lincan_config.h' <<EOF
 #define CONFIG_OC_LINCAN_CARD_template 1
 #endif /*_LOCAL_CONFIG_H*/
 EOF
-cat > 'config.omk-default' <<EOF
+cat > 'config.omk-default' <<'EOF'
 # Start of OMK config file
 # This file should not be altered manually
 # Overrides should be stored in file config.omk
@@ -98,7 +98,7 @@ CONFIG_TEST_APOS="Text+apostrophes"
 #CONFIG_OC_LINCAN=x
 #CONFIG_UNKNOWN=x
 EOF
-cat > 'Makefile.omk' <<EOF
+cat > 'Makefile.omk' <<'EOF'
 SUBDIRS=lincan
 
 default_CONFIG = CONFIG_TEST_NUM=123 CONFIG_TEST_STR=Hello
@@ -113,7 +113,7 @@ global_DEFINES = CONFIG_OC_LINCAN CONFIG_OC_LINCANRTL  \
                  CONFIG_TEST_NUM CONFIG_TEST_STR CONFIG_TEST_APOS
 EOF
 mkdir 'lincan'
-cat > 'lincan/configtest.c' <<EOF
+cat > 'lincan/configtest.c' <<'EOF'
 #include "lincan_config.h"
 
 int main(void) 
@@ -121,7 +121,7 @@ int main(void)
     /* With default CFLAGS a warning should be produced: control reaches end of non-void function */
 }
 EOF
-cat > 'lincan/Makefile.omk' <<EOF
+cat > 'lincan/Makefile.omk' <<'EOF'
 lincan_cards_NAMES = pip pccan smartcan nsi cc_can104 ems_cpcpci \
                pc_i03 pcm3680 aim104 m437 pcccan ssv bfadcan gensja1000io pikronisa eb8245 \
                kv_pcican msmcan oscar adlink7841 unican virtual template
index 7dc0b6a0f55a91fdda7ec4ee0ccd24885074eaf8..0beab97011d2e2926f1b4f39e172a82002565586 100644 (file)
@@ -1,5 +1,5 @@
 echo '' > 'config.omk-default'
-cat > 'Makefile.omk' <<EOF
+cat > 'Makefile.omk' <<'EOF'
 include-pass_HOOKS=include-pass-hook
 library-pass_HOOKS=library-pass-hook
 binary-pass_HOOKS=binary-pass-hook
index b7e3246523db098fc91da6b75525dff1cccc331d..84fecc4251a8b7cd7da7ed8ab00c92246edeeacb 100755 (executable)
@@ -1,4 +1,7 @@
 #!/bin/bash
 
+. ./functions.sh
+
 touch config.omk-default
-make
+needs_valid_CC
+WVPASS make
index 66e6c875b28ef64db368ea2deae187272d9b8f94..d263c3fcd4f24ef6e1ee895df1369015277412b0 100644 (file)
@@ -1,4 +1,4 @@
-cat > 'test.c' <<EOF
+cat > 'test.c' <<'EOF'
 #include <stdio.h>
 #include <mynumber.h>
 int main()
@@ -7,7 +7,7 @@ int main()
         return 0;
 }
 EOF
-cat > 'Makefile.omk' <<EOF
+cat > 'Makefile.omk' <<'EOF'
 bin_PROGRAMS = test
 
 test_SOURCES = test.c
index b7e3246523db098fc91da6b75525dff1cccc331d..84fecc4251a8b7cd7da7ed8ab00c92246edeeacb 100755 (executable)
@@ -1,4 +1,7 @@
 #!/bin/bash
 
+. ./functions.sh
+
 touch config.omk-default
-make
+needs_valid_CC
+WVPASS make
index 09af33b6d460175a14d922822854994fd2e115be..c6590bfaf96facd3ddf21305e64a4eaf94d20153 100755 (executable)
@@ -3,6 +3,7 @@
 . ./functions.sh
 
 touch config.omk-default
+needs_valid_CC
 make 2>/dev/null|grep "Entering directory.*_build" && error "Entering directory message should be suppressed"
 make distclean
 make V=2 2>/dev/null|grep 'Entering directory.*_build' || error "Entering directory message didn't appear"
index d1e7f5bf608962023303fd8ad805a25bc58fec01..7b9d7cd2c92048f2a61e7ee39fea887475af957b 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
 
 . ./functions.sh
-
+needs_valid_CC
 make || error ".o files should not be searched in SOURCES_DIR"
index 6b749fa4b7dcc701478cf550329ef4fa8d9f478b..f98cb509ec2e55b39359825b88e300e0b17e0e38 100755 (executable)
@@ -3,4 +3,5 @@
 . ./functions.sh
 
 touch config.omk-default
+needs_valid_CC
 make
index 96faf2192c28453a38be342d09d239a31ceefb92..ecd2522ca8367fc2c8f4246a30fc9f61f00bbc63 100755 (executable)
@@ -4,6 +4,7 @@
 
 touch config.omk-default
 echo "CFLAGS=-DNUMBER=123" > config.omk
+needs_valid_CC
 make||error "Can't compile"
 [ $OMK_RULES != linux ] && canttest "Should work only with Linux rules"
 _compiled/bin/test|grep 123 || error "Custom CFLAGS didn't influence the output"
index a30231fd9d929ad3855af92ea8d5e2998ba35f3f..3214ecf321de2f25f3ea8921af4a46aeb7dfa08d 100755 (executable)
@@ -3,6 +3,7 @@
 . ./functions.sh
 
 touch config.omk-default
+needs_valid_CC
 make CFLAGS="-DNONSENSE=abc -DNUMBER=123"||error "Can't compile"
 [ $OMK_RULES != linux ] && canttest "Should work only with Linux rules"
 _compiled/bin/test|grep 123 || error "Custom CFLAGS didn't influence the output"
diff --git a/tests/programs-cflags-cmdline.files b/tests/programs-cflags-cmdline.files
new file mode 120000 (symlink)
index 0000000..73e4eca
--- /dev/null
@@ -0,0 +1 @@
+programs.files
\ No newline at end of file
diff --git a/tests/programs-cflags.files b/tests/programs-cflags.files
new file mode 120000 (symlink)
index 0000000..73e4eca
--- /dev/null
@@ -0,0 +1 @@
+programs.files
\ No newline at end of file
index 435defa0d5a09fbf0c03884a049ef8438a8b98f0..cb28daaed469f3715b858c1c0fef155bd80d1f8f 100755 (executable)
@@ -4,6 +4,7 @@
 
 touch config.omk-default
 echo "DEFS=-DNUMBER=123" > config.omk
+needs_valid_CC
 make||error "Can't compile"
 [ $OMK_RULES != linux ] && canttest "Should work only with Linux rules"
 _compiled/bin/test|grep 123 || error "Variable DEFS didn't influence the output"
diff --git a/tests/programs-defs.files b/tests/programs-defs.files
new file mode 120000 (symlink)
index 0000000..73e4eca
--- /dev/null
@@ -0,0 +1 @@
+programs.files
\ No newline at end of file
index 0eb558adebb78befa2d554969e174a41b2fdd609..5e802122df557b97a17e7fdf12892943a8cf51ae 100755 (executable)
@@ -3,6 +3,7 @@
 
 touch config.omk-default
 rm -rf _compiled
+needs_valid_CC
 make MAKEFILE_OMK=Makefile.omk-test_PROGRAMS || error make
 FOUND=`find _compiled -wholename '*/bin-tests/test*'`
 echo "Found: $FOUND"
diff --git a/tests/programs-test_PROGRAMS.files b/tests/programs-test_PROGRAMS.files
new file mode 120000 (symlink)
index 0000000..73e4eca
--- /dev/null
@@ -0,0 +1 @@
+programs.files
\ No newline at end of file
index 31faf982bcf8512188ea920faf9cffe9e39f1a26..0ee273551493c801c0c5ab7c4cb7f042584632b4 100644 (file)
@@ -1,8 +1,9 @@
-cat > 'Makefile.omk-test_PROGRAMS' <<EOF
+cat > 'Makefile.omk-test_PROGRAMS' <<'EOF'
 test_PROGRAMS = test
 
-test_SOURCES = test.cEOF
-cat > 'test.c' <<EOF
+test_SOURCES = test.c
+EOF
+cat > 'test.c' <<'EOF'
 #include <stdio.h>
 
 int main()
@@ -13,7 +14,8 @@ int main()
         return 0;
 }
 EOF
-cat > 'Makefile.omk' <<EOF
+cat > 'Makefile.omk' <<'EOF'
 bin_PROGRAMS = test
 
-test_SOURCES = test.cEOF
+test_SOURCES = test.c
+EOF
index ceb41193178d600463b637a2079f566426a4cf04..7e2dc65a7c9d943a761a16c2cc18f876fe4bfd6c 100755 (executable)
--- a/tests/qt
+++ b/tests/qt
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+[[ $OMK_RULES != linux ]] && exit 0
+
 . ./functions.sh
 
 touch config.omk-default
index e11e7055e56c944d0913065d04e1475a1b632c69..ff684f5b1e63fd16780bab9f55e1831332203f1a 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+[[ $OMK_RULES != linux ]] && exit 0
+
 . ./functions.sh
 
 touch config.omk-default
diff --git a/tests/qt-qmake.files b/tests/qt-qmake.files
new file mode 120000 (symlink)
index 0000000..b19a45c
--- /dev/null
@@ -0,0 +1 @@
+qt.files
\ No newline at end of file
index c7f0ea991a76a1e9e735b90b7446443dbd0c738e..33a4b70d39cae533b665d6c7713aaaa85a8e00c0 100644 (file)
@@ -1,13 +1,13 @@
 echo 'SUBDIRS = somelib qtapp' > 'Makefile3.omk'
-cat > 'Makefile2.omk' <<EOF
+cat > 'Makefile2.omk' <<'EOF'
 SUBDIRS = somelib dir
 
 EOF
-cat > 'Makefile.omk' <<EOF
+cat > 'Makefile.omk' <<'EOF'
 SUBDIRS = somelib
 QT_SUBDIRS = qtapp
 EOF
-cat > 'test.inc' <<EOF
+cat > 'test.inc' <<'EOF'
 cp Makefile1.omk Makefile.omk
 make || error "QT compilation"
 [ -x _compiled/bin/qtapp ] || error "QT application was not compiled"
@@ -27,7 +27,7 @@ make || error "QT_PROJECT test "
 make clean || error "QT clean 3"
 EOF
 mkdir 'somelib'
-cat > 'somelib/somelib.c' <<EOF
+cat > 'somelib/somelib.c' <<'EOF'
 #include <header.h>
 
 int some_function(int num)
@@ -35,14 +35,14 @@ int some_function(int num)
     return SOME_CONST - num;
 }
 EOF
-cat > 'somelib/Makefile.omk' <<EOF
+cat > 'somelib/Makefile.omk' <<'EOF'
 include_HEADERS = header.h
 shared_LIBRARIES = somelib
 
 
 somelib_SOURCES = somelib.c
 EOF
-cat > 'somelib/header.h' <<EOF
+cat > 'somelib/header.h' <<'EOF'
 #ifndef HEADER_H
 #define HEADER_H
 
@@ -63,7 +63,7 @@ EOF
 mkdir 'dir'
 echo 'QT_SUBDIRS = ../qtapp' > 'dir/Makefile.omk'
 mkdir 'qtapp'
-cat > 'qtapp/qtapp.cxx' <<EOF
+cat > 'qtapp/qtapp.cxx' <<'EOF'
 #include <QApplication>
 #include <QPushButton>
 #include <header.h>
@@ -81,7 +81,7 @@ cat > 'qtapp/qtapp.cxx' <<EOF
  } 
 EOF
 echo 'QT_PROJECTS=qtapp.pro' > 'qtapp/Makefile.omk'
-cat > 'qtapp/qtapp.pro' <<EOF
+cat > 'qtapp/qtapp.pro' <<'EOF'
 ######################################################################
 # Automatically generated by qmake (2.01a) po ?rc 16 18:49:31 2007
 ######################################################################
@@ -93,8 +93,9 @@ INCLUDEPATH += .
 
 # Input
 SOURCES += qtapp.cxx
-LIBS+=-lsomelibEOF
-cat > 'Makefile1.omk' <<EOF
+LIBS+=-lsomelib
+EOF
+cat > 'Makefile1.omk' <<'EOF'
 SUBDIRS = somelib
 QT_SUBDIRS = qtapp
 EOF
index b7e3246523db098fc91da6b75525dff1cccc331d..618a7971430150038e8abd1304e7b1f2055af870 100755 (executable)
@@ -1,4 +1,11 @@
 #!/bin/bash
 
+case $OMK_RULES in
+    sdcc|rtems|sysless-keil51|sysless-keil16x)
+       exit 0;;
+esac
+
+. ./functions.sh
+
 touch config.omk-default
-make
+WVPASS make
index b97a6f8edd77cdea55a56454c97b056543b4e1fa..439dffb7a5c037350f0cad4289c2527eb5dc39c3 100755 (executable)
@@ -2,6 +2,12 @@
 
 . ./functions.sh
 
+case $OMK_RULES in
+    linux|sysless)
+       ;;
+    *) exit 0
+esac
+
 touch config.omk-default
 mkdir dir
 cd dir
diff --git a/tests/subdirs_first-force-subdir.files b/tests/subdirs_first-force-subdir.files
new file mode 120000 (symlink)
index 0000000..d67d467
--- /dev/null
@@ -0,0 +1 @@
+subdirs_first.files
\ No newline at end of file
index d640bca1ead4325bb7ab94a19c07a44887e88c5c..fb56f4b523d41aa74c831d970dbc7d43fb7a1009 100644 (file)
@@ -1,12 +1,12 @@
 mkdir 'dir1'
-cat > 'dir1/Makefile.omk' <<EOF
+cat > 'dir1/Makefile.omk' <<'EOF'
 SUBDIRS=dir3
 
 USE_LEAF_MAKEFILES=n
 EOF
 mkdir 'dir1/dir3'
 echo '$(warning Makefile.omk used without leaf Makefile)' > 'dir1/dir3/Makefile.omk'
-cat > 'config.omk-default' <<EOF
+cat > 'config.omk-default' <<'EOF'
 # Start of OMK config file
 # This file should not be altered manually
 # Overrides should be stored in file config.omk
@@ -17,7 +17,7 @@ echo 'SUBDIRS=dir1 dir2' > 'Makefile.omk'
 mkdir 'dir2'
 echo 'SUBDIRS=dir4' > 'dir2/Makefile.omk'
 mkdir 'dir2/dir4'
-cat > 'dir2/dir4/Makefile' <<EOF
+cat > 'dir2/dir4/Makefile' <<'EOF'
 $(warning Leaf Makefile included)
 
 %:
index 506fc4203d446a2a6bd04bde548be5428c8aada2..0c30d1d2de1ebecd4206c37bdd9fb92f6922ff23 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+[[ $OMK_RULES != wxworks ]] && exit 0
+
 touch config.omk-default
 make
 
index 141386c9b475eb5879b796a89228970e236f0692..e409c15b45c9a30e50152cea5a4ee4b7b22721ce 100755 (executable)
@@ -4,7 +4,7 @@
 
 rm -f *.mark
 
-make -C subdir W=1
+WVPASS make -C subdir W=1
 
 [ -f 'toplevel.mark' ] || error "Toplevel make was not called".
 [ `wc -l < subdir.mark` -eq 1 ] || error "OMK_SERIALIZE does not work"
index df65435e4cd97cf4e6426d4fc02c141bc041fdb5..13b75bfaa09b6417e6c8eaa293b923eb3e109803 100644 (file)
@@ -1,12 +1,11 @@
 echo '' > 'config.omk-default'
-cat > 'Makefile.omk' <<EOF
+cat > 'Makefile.omk' <<'EOF'
 $(shell echo "Top-level executed" > toplevel.mark)
 
 SUBDIRS=subdir
-
 EOF
-mkdir 'subdir'
-cat > 'subdir/Makefile.omk' <<EOF
+mkdir subdir
+cat > 'subdir/Makefile.omk' <<'EOF'
 include-pass_HOOKS=include-pass-test
 
 include-pass-test:
index 2bd551f67c727702b07b787709f4432800c4ba4d..222a96689edc71831fba40b8393a06784ae63b9a 100644 (file)
@@ -136,13 +136,36 @@ WVSTART()
 omkize()
 {
     WVPASS cp "$OMK_TESTSROOT/../leaf-makefile/Makefile" .
-    WVPASS make omkize
+    for i in `find -L . -mindepth 2 -name Makefile.omk`; do
+       d=`dirname ${i}`
+       WVPASS cp Makefile "${d}/Makefile"
+    done
+}
+
+needs_valid_CC()
+{
+    CC=$(make -qp|sed -ne '/^CC = / s///p')
+    if ! [[ -x "$CC" ]]; then
+       echo "Warning: $CC not found - skipping the test"
+       exit 0
+    fi
 }
 
 OMK_TESTSROOT=${OMK_TESTSROOT:-$(readlink --canonicalize $(dirname $0))}
 OMK_RULES=${OMK_RULES:-linux}  # When run manually, we use linux rules
-testdir="tmp.$(basename $0 .sh)"
+
+case $OMK_RULES in
+    rtems)
+       [[ -z "$RTEMS_MAKEFILE_PATH" ]] && exit 0
+       ;;
+    vxworks)
+       [[ -z "$WRENV" ]] && exit 0
+       ;;
+esac
+
+echo "Testing \"$OMK_RULES rules\" in $(basename $0):" >&2
+testdir="tmp/$(basename $0 .sh).$OMK_RULES"
 [ -d "$testdir" ] && WVPASS rm -rf "$testdir"
-WVPASS mkdir "$testdir"
+WVPASS mkdir -p "$testdir"
 WVPASS cd "$testdir"
 WVPASS cp "$OMK_TESTSROOT"/../rules/$OMK_RULES/* .