瀏覽代碼

compile hello world for native compile test

Waldemar Brodkorb 9 年之前
父節點
當前提交
30ef922715
共有 1 個文件被更改,包括 13 次插入0 次删除
  1. 13 0
      embedded-test.sh

+ 13 - 0
embedded-test.sh

@@ -946,6 +946,19 @@ EOF
   if [ $test = "ltp" ]; then
   if [ $test = "ltp" ]; then
 cat >> $file << EOF
 cat >> $file << EOF
 /opt/ltp/runltp $tee
 /opt/ltp/runltp $tee
+EOF
+  fi
+  # native test
+  if [ $test = "native" ]; then
+cat >> $file << EOF
+echo '#include <stdio.h>\nint main() {\n printf("Hello World");\n return 0; \n}'> /hello.c
+gcc -o /hello /hello.c $tee
+/hello $tee
+if [ \$? -eq 0 ]; then
+  echo "\nsuccess"
+else
+  echo "\nfailed"
+fi
 EOF
 EOF
   fi
   fi
   # mksh test
   # mksh test