Ver Fonte

gitignore, shell scripts reformat and small changes

MikeMirzayanov há 1 ano atrás
pai
commit
83754eac80

+ 5 - 0
.gitignore

@@ -0,0 +1,5 @@
+.idea
+
+*.exe
+*.o
+*.obj

+ 1 - 1
tests/run.sh

@@ -36,7 +36,7 @@ for arg in "$@"; do
       ARGS_CPP_VERSIONS="$ARGS_CPP_VERSIONS${arg:1},"
     else
       if [[ -n "$ARGS_CPP" ]]; then
-        echo Expected just one non-version argument: g++, clang++ or msvc
+        echo Expected just one non-version argument: g++, clang++ or msvc, but found "$ARGS_CPP" and "$arg"
         exit 1
       fi
       if [[ ! "$arg" == "g++" && ! "$arg" == "clang++" && ! "$arg" == "msvc" ]]; then

+ 1 - 1
tests/scripts/compile

@@ -48,7 +48,7 @@ else
   eval "$CPP" "$CPP_OPTS" "$CPP_STANDARD" -Wpedantic -Werror -I"${CPP_INCLUDE_DIR}""$EXTRA_ARGS" -o"$exe_file" -O2 "$src_file"
 fi
 
-rm -f *.o *.obj
+rm -f ./*.o ./*.obj
 
 if [ ! -f "$exe_file" ]; then
   echo "Compilation failed: file $exe_file not found"

+ 8 - 6
tests/test-000_compile-all-cpp/run.sh

@@ -1,10 +1,12 @@
 #!/bin/bash
 set -eo pipefail
 
-(IFS='
+(
+  IFS='
 '
-for f in $(find "$TESTS_DIR"/.. -name "*.cpp"); do
-   if [[ ! "$f" == *../tests/* ]]; then
-     bash ../scripts/compile "$f" --check-only
-   fi
-done)
+  for f in $(find "$TESTS_DIR"/.. -name "*.cpp"); do
+    if [[ ! "$f" == *../tests/* ]]; then
+      bash ../scripts/compile "$f" --check-only
+    fi
+  done
+)

+ 4 - 4
tests/test-001_run-sval/run.sh

@@ -3,13 +3,13 @@ set -eo pipefail
 
 os="unix"
 if [[ "$MACHINE" == "Windows" ]]; then
-    os="win"
+  os="win"
 fi
 
 bash ../scripts/compile src/sval.cpp
 for i in files/"$os"/sval/*; do
-    j=$(basename $i)
-    echo "test-ref r-sval-$i "$VALGRIND" ./sval < files/$os/sval/input.$i"
-    bash ../scripts/test-ref r-sval-$j "$VALGRIND" ./sval < $i
+  j=$(basename $i)
+  echo "test-ref r-sval-$i ""$VALGRIND"" ./sval < files/$os/sval/input.$i"
+  bash ../scripts/test-ref r-sval-$j "$VALGRIND" ./sval <$i
 done
 rm -f sval sval.exe