diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 43cd2683c..374299a5b 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -16,11 +16,19 @@ jobs: # well on Windows or Mac. You can convert this to a matrix build if you need # cross-platform coverage. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest ] + python-version: [ "3.7" ] steps: - uses: actions/checkout@v2 - + - name: Setup python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type @@ -32,7 +40,7 @@ jobs: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} sudo -E ${{github.workspace}}/install/install_python.sh env: - SP_DIR: /usr/lib/python3/dist-packages + SP_DIR: ${{github.workspace}}/tests SOURCE_DIR: ${{github.workspace}} BUILD_DIR: ${{github.workspace}}/build @@ -43,10 +51,11 @@ jobs: run: | ctest -C ${{env.BUILD_TYPE}} ../install/install_test.sh - cd ../tests/ && pytest -sv . + cd ../tests/ && python -m pytest -sv . - name: TestCli run: | ${{github.workspace}}/tests/test_cli.sh env: SOURCE_DIR: ${{github.workspace}} BUILD_DIR: ${{github.workspace}}/build + PYTHONPATH: /usr/lib/python${{ matrix.python-version }}/dist-packages diff --git a/analisi/main.cpp b/analisi/main.cpp index 346b104da..55bbcc3d7 100644 --- a/analisi/main.cpp +++ b/analisi/main.cpp @@ -239,6 +239,8 @@ int main(int argc, char ** argv) if (argc<=1 || ( (output_conversion!="" || output_conversion_gro.size()>0 ) && input=="") ||vm.count("help")|| (vm.count("loginput")==0 && ( debug2 || heat_coeff ) ) || skip<=0 || stop_acf<0 || final<0 || (!sub_mean && (sub_mean_start!=0) ) || sub_mean_start<0 || !(kk_l.size()==0 || kk_l.size()==2)){ std::cout << options << "\n"; + if (vm.count("help")) + return 0; return 1; } diff --git a/lib/include/calcolamultithread.h b/lib/include/calcolamultithread.h index ce251cc5c..9c5915446 100644 --- a/lib/include/calcolamultithread.h +++ b/lib/include/calcolamultithread.h @@ -28,7 +28,7 @@ template splitter(int ith, int nthreads, int primo) const { - std::pair res; + std::pair splitter(size_t ith, size_t primo) const { + std::pair res; res.first=ith*npassith; if (ith==nthreads-1) { res.second=end; @@ -73,7 +73,7 @@ class CalcolaMultiThread } } - void calcola(unsigned int primo){ + void calcola(size_t primo){ init_split(); if constexpr (!!(FLAGS & CalcolaMultiThread_Flags::CALL_CALC_INIT)) { static_cast(this)->calc_init(primo); @@ -83,7 +83,7 @@ class CalcolaMultiThread for (ssize_t i=i0;i sh; DataRegression data; double workspace[(l+1)*(l+1)], cheby[(l+1)*2]; diff --git a/tests/test_cli.sh b/tests/test_cli.sh index 81eec8d78..230edeed5 100755 --- a/tests/test_cli.sh +++ b/tests/test_cli.sh @@ -31,6 +31,7 @@ TESTS=( "MSD_normal_full" "-i $INPUT -Q" N_arr=${#TESTS[@]} N=$(( N_arr - 1 )) RETURN=0 +FLIST="" for i in $(seq 0 2 $N ) do ip=$(( i + 1 )) @@ -41,12 +42,16 @@ do if [ -f "$FTEST" ] then OUTPUT_F="`cat $FTEST`" - - if [ -z "`diff <(echo "$OUTPUT") <(echo "$OUTPUT_F")`" ] + #the sign of nan is not defined by the standard + DIFF="`diff <(echo "$OUTPUT" | sed 's/-nan/nan/g') <(echo "$OUTPUT_F" | sed 's/-nan/nan/g') || true `" + if [ -z "$DIFF" ] then echo SUCCESS $NAME else echo FAILED $NAME + echo "$DIFF" + FLIST="$FLIST +FAILED $NAME" RETURN=$(( RETURN + 1 )) fi else @@ -55,4 +60,5 @@ do fi done +echo "$FLIST" exit $RETURN