Merge: More macosx compat things
authorJean Privat <jean@pryen.org>
Sun, 14 Dec 2014 13:44:15 +0000 (08:44 -0500)
committerJean Privat <jean@pryen.org>
Sun, 14 Dec 2014 13:44:15 +0000 (08:44 -0500)
Are nedded to pass more tests on jenkins

http://gresil.org/jenkins/job/CI%20Github%20OSX/

Pull-Request: #1017
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

misc/jenkins/unitrun.sh
src/compiler/abstract_compiler.nit
src/nitx.nit

index ed4e2f7..6b1c7f5 100755 (executable)
@@ -26,13 +26,20 @@ shift
 
 # Detect a working time command
 if env time --quiet -f%U true 2>/dev/null; then
-       TIME="env time --quiet -f%U -o '${name}.t.out'"
+       TIME="env time --quiet -f%U -o ${name}.t.out"
 elif env time -f%U true 2>/dev/null; then
        TIME="env time -f%U -o ${name}.t.out"
 else
        TIME=
 fi
 
+# Detect a working date command
+if date -Iseconds >/dev/null 2>&1; then
+       TIMESTAMP="timestamp='`date -Iseconds`'"
+else
+       TIMESTAMP=
+fi
+
 # Magic here! This tee and save both stdout and stderr in distinct files without messing with them
 # Time  just get the user time
 $TIME "$@" > >(tee "${name}.out") 2> >(tee "${name}.2.out" >&2)
@@ -41,9 +48,16 @@ res=$?
 c=`echo "${name%-*}" | tr "-" "."`
 n=${name##*-}
 
+# Do we have a time result?
+if test -f "${name}.t.out"; then
+       T="time='`cat "${name}.t.out"`'"
+else
+       T=
+fi
+
 cat > "${name}.xml"<<END
 <testsuites><testsuite>
-<testcase classname='$c' name='$n' time='`cat "${name}.t.out"`' timestamp='`date -Iseconds`'>
+<testcase classname='$c' name='$n' $T $TIMESTAMP>
 END
 if test "$res" != "0"; then
 echo >> "${name}.xml" "<error message='Command returned $res'/>"
@@ -60,4 +74,4 @@ cat >> "${name}.xml"<<END
 </testsuite></testsuites>
 END
 
-rm "${name}.out" "${name}.2.out" "${name}.t.out"
+rm "${name}.out" "${name}.2.out" "${name}.t.out" 2> /dev/null || true
index caf6622..ca3269e 100644 (file)
@@ -333,7 +333,7 @@ class MakefileToolchain
                        if libs != null then linker_options.add_all(libs)
                end
 
-               makefile.write("CC = ccache cc\nCXX = ccache c++\nCFLAGS = -g -O2 -Wno-unused-value -Wno-switch\nCINCL =\nLDFLAGS ?= \nLDLIBS  ?= -lm {linker_options.join(" ")}\n\n")
+               makefile.write("CC = ccache cc\nCXX = ccache c++\nCFLAGS = -g -O2 -Wno-unused-value -Wno-switch -Wno-attributes\nCINCL =\nLDFLAGS ?= \nLDLIBS  ?= -lm {linker_options.join(" ")}\n\n")
 
                var ost = toolcontext.opt_stacktrace.value
                if (ost == "libunwind" or ost == "nitstack") and (platform == null or platform.supports_libunwind) then makefile.write("NEED_LIBUNWIND := YesPlease\n")
index 0a9c436..69b34e7 100644 (file)
@@ -347,7 +347,7 @@ private class Pager
        fun add_indent do addn("  " * indent)
        fun addn(text: String) do content.append(text.escape)
        fun add_rule do add("\n---\n")
-       fun render do sys.system("echo \"{content}\" | pager -r")
+       fun render do sys.system("echo \"{content}\" | less -r")
 end
 
 redef class MModule