Browse Source

compile hello world for native compile test

Waldemar Brodkorb 9 years ago
parent
commit
30ef922715
1 changed files with 13 additions and 0 deletions
  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