diff --git a/.appveyor.yml b/.appveyor.yml index 8f35ef331..56c8d5b27 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -17,6 +17,7 @@ environment: GIT_CLONE_DIR: $(ECMWF)\git INSTALL_DIR: $(ECMWF)\install ECCODES_SRC: $(GIT_CLONE_DIR)\eccodes + WINDOWS_TESTING_BASHRC: $(ECCODES_SRC)\tests\windows_testing.bashrc ECBUILD_SRC: $(GIT_CLONE_DIR)\ecbuild # scripts that are called at very beginning, before repo cloning @@ -78,7 +79,8 @@ build_script: -D ENABLE_JPG=1 ^ -D IEEE_LE=1 ^ -D ENABLE_MEMFS=0 ^ - -D ENABLE_EXTRA_TESTS=OFF ^ + -D ENABLE_EXTRA_TESTS=ON ^ + -D WINDOWS_TESTING_BASHRC=%WINDOWS_TESTING_BASHRC% ^ .. - cmd: nmake - cmd: ctest --output-on-failure diff --git a/tests/bufr_extract_headers.c b/tests/bufr_extract_headers.c index 520d0532e..cebdc7552 100644 --- a/tests/bufr_extract_headers.c +++ b/tests/bufr_extract_headers.c @@ -12,6 +12,7 @@ #include #define MAX_KEYS 100 + int main(int argc, char* argv[]) { char *filename, *keys; @@ -34,7 +35,7 @@ int main(int argc, char* argv[]) printf("ERROR: %s\n",grib_get_error_message(err)); return 1; } - + /* Mimic the behaviour of bufr_get -f -p keys for testing */ err = parse_keyval_string(NULL, keys, 0, GRIB_TYPE_UNDEFINED, requested_print_keys, &requested_print_keys_count); assert(requested_print_keys_count > 0); diff --git a/tests/windows_testing.bashrc b/tests/windows_testing.bashrc index f65068a8b..60b316082 100644 --- a/tests/windows_testing.bashrc +++ b/tests/windows_testing.bashrc @@ -9,3 +9,15 @@ function diff { command diff --strip-trailing-cr "$@" } export -f diff + +# We occasionally cat text files and use the lines as arguments. +# Carriage returns here cause issues and need to be removed. +function cat { + if [[ $# -eq 1 && "$1" =~ ".txt" ]] + then + command cat "$@" | sed 's/\r$//' + else + command cat "$@" + fi +} +export -f cat