]> rtime.felk.cvut.cz Git - omk.git/commitdiff
Partially fix cmetric test for keil16x
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 12 Mar 2011 15:12:37 +0000 (16:12 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 12 Mar 2011 16:07:40 +0000 (17:07 +0100)
snippets/keil16x.omk
tests/cmetric
tests/wvtest.sh

index 61899b3b6932f20743e412e019d5f32e6546e01b..fd6a6e738a8ec88ed9454919832958528bfe9347 100644 (file)
@@ -142,3 +142,9 @@ $(USER_LIB_DIR)/$(LIB_PREF)$(1)$(LIB_EXT): $$($(1)_OBJS)
        $(AR) ADD $$$${S// /,} TO $$$$L $(FILTER_KEIL_LIB_OUTPUT)
        @touch $(USER_LIB_DIR)/timestamp
 endef
+
+# Hack: Unfortunately, USER_LIB_DIR is set later and the rule below would not work.
+USER_LIB_DIR := $(MAKERULES_DIR)/_compiled/lib
+
+$(USER_LIB_DIR)/timestamp:
+       $(Q)touch $@
index c7d2e66e6726f41c4b0d03d616d0c59e819bcd3b..8049fc7b761e19da6ff1ab13dd210a8e12404ad7 100755 (executable)
@@ -5,7 +5,9 @@
 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 || \
-    error "produced file differs"
+WVFAIL make NM=false FAILMSG="cmetric error was not correctly detected"
+WVPASS make FAILMSG="compilation error"
+
+eval $(make omk-get-var VAR=COMPILED_DIR_NAME|grep ^COMPILED_DIR_NAME)
+
+WVPASS diff -u correct_cmetric_config.h $COMPILED_DIR_NAME/include/test/cmetric_config.h
index 0cb7b5222e05aeab5ac791a1fc20c12a9f758e24..5c112228c3af77814cd67c08be632e40c3aa9ae2 100644 (file)
@@ -144,9 +144,9 @@ omkize()
 
 needs_valid_CC()
 {
-    CC=$(make -qp|sed -ne '/^CC = / s///p')
-    if ! [[ -x "$CC" ]]; then
-       echo "Warning: $CC not found - skipping the test"
+    CC=$(make omk-get-var VAR=CC|sed -ne '/^CC=/ s///p')
+    if ! which ${CC%% *} > /dev/null; then
+       echo "Warning: '$CC' not found - skipping the test"
        exit 0
     fi
 }