From 64e92ccfd218d77d6972c2ce9e79ae73e55377f8 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Tue, 8 Dec 2020 15:33:57 -0500 Subject: [PATCH 1/6] Run API tests --- .github/workflows/ci-tests.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 701b3e56bf7..28d69abe3e3 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -65,7 +65,7 @@ jobs: - name: Linux - Tests os: ubuntu-latest - run_in_pr : false + run_in_pr : true BUILD_DOCS : false DEPLOY_DOCS : false PACKAGE : false @@ -90,7 +90,7 @@ jobs: - name: macOS - Tests os: macos-latest - run_in_pr : false + run_in_pr : true BUILD_DOCS : false DEPLOY_DOCS : false PACKAGE : false @@ -114,7 +114,7 @@ jobs: RUN_TESTS : false - name: Windows - Tests - run_in_pr : false + run_in_pr : true os: windows-latest BUILD_DOCS : false DEPLOY_DOCS : false @@ -267,7 +267,8 @@ jobs: # Disable MinGW's path conversion, see #1035. if [ "$RUNNER_OS" == "Windows" ]; then export MSYS_NO_PATHCONV=1; fi # Run tests - ctest ${CTEST_ARGS} || ctest ${CTEST_ARGS} --rerun-failed || ctest ${CTEST_ARGS} --rerun-failed + ctest ${CTEST_ARGS} -R api + #ctest ${CTEST_ARGS} || ctest ${CTEST_ARGS} --rerun-failed || ctest ${CTEST_ARGS} --rerun-failed env: CTEST_ARGS : "--output-on-failure --force-new-ctest-process -j4 --timeout 480" if: matrix.RUN_TESTS == true && (matrix.run_in_pr == true || github.event_name != 'pull_request') From 5730f2fd2a2eb0c97d2def4cc5ff9a8d405b7860 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Tue, 8 Dec 2020 16:02:31 -0500 Subject: [PATCH 2/6] Simplify the API wrappers --- test/gmtest.in | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/test/gmtest.in b/test/gmtest.in index 663d680b628..b00be442974 100755 --- a/test/gmtest.in +++ b/test/gmtest.in @@ -84,29 +84,9 @@ function psldemo() } # Must have wrappers for all test programs not part of GMT distro: - -for apiprog in \ - testapi_cube \ - testapi_makecpt \ - testapi_matrix \ - testapi_matrix_plot \ - testapi_mixmatrix \ - testapi_userdataset \ - testapi_usergrid \ - testapi_uservectors \ - testapi_vector \ - testapiconv \ - testgrdio \ - testapi_imageshading \ - testapi_matrix_as_grid \ - testapi_vector_strings \ - testapi_vector_plot \ - testapi_vector_io \ - testapi_matrix_io \ - testapi_matrix_360 \ - testapi_matrix_360_ref \ - testapi_grid2matrix -do +# assuming that all test programs start with test*. +for apiprog in $(ls "@GMT_BINARY_DIR@/src/test*"); do + apiprog=$(basename $apiprog) eval "${apiprog}() { valgrind_wrapper \"@GMT_BINARY_DIR@/src/${apiprog}\" \"\$@\"; }" done From c21f847568ecbaa7e609298b9906d00797cd45cb Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Tue, 8 Dec 2020 16:23:06 -0500 Subject: [PATCH 3/6] Debug --- .github/workflows/ci-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 28d69abe3e3..d5cda94a299 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -267,6 +267,8 @@ jobs: # Disable MinGW's path conversion, see #1035. if [ "$RUNNER_OS" == "Windows" ]; then export MSYS_NO_PATHCONV=1; fi # Run tests + pwd + ls -R ./* ctest ${CTEST_ARGS} -R api #ctest ${CTEST_ARGS} || ctest ${CTEST_ARGS} --rerun-failed || ctest ${CTEST_ARGS} --rerun-failed env: From 9dac2d053f6eb69fe19a181ad80bdc597f5faf8b Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sun, 6 Mar 2022 21:10:09 +0800 Subject: [PATCH 4/6] Fix --- test/gmtest.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/gmtest.in b/test/gmtest.in index 356dde22b5c..3e5ebb6109b 100755 --- a/test/gmtest.in +++ b/test/gmtest.in @@ -105,7 +105,7 @@ function psldemo() # Must have wrappers for all test programs not part of GMT distro: # assuming that all test programs start with test*. -for apiprog in $(ls "@GMT_BINARY_DIR@/src/test*"); do +for apiprog in $(ls @GMT_BINARY_DIR@/src/test*); do apiprog=$(basename $apiprog) eval "${apiprog}() { valgrind_wrapper \"@GMT_BINARY_DIR@/src/${apiprog}\" \"\$@\"; }" done From 998d004ff7f9b7712edb9b70266446a698cf9536 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sun, 6 Mar 2022 21:10:45 +0800 Subject: [PATCH 5/6] Enable the tests in PR --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bb82582c022..134ee2762c6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,7 +4,7 @@ name: Tests on: - # pull_request: + pull_request: push: branches: - master From bb954c5595a0c46c6452085b0d8a09d6d34cd56e Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sun, 6 Mar 2022 22:05:25 +0800 Subject: [PATCH 6/6] Fix --- test/gmtest.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/gmtest.in b/test/gmtest.in index 3e5ebb6109b..1e1fd52f358 100755 --- a/test/gmtest.in +++ b/test/gmtest.in @@ -108,6 +108,8 @@ function psldemo() for apiprog in $(ls @GMT_BINARY_DIR@/src/test*); do apiprog=$(basename $apiprog) eval "${apiprog}() { valgrind_wrapper \"@GMT_BINARY_DIR@/src/${apiprog}\" \"\$@\"; }" + # export function definitions to subshells + export -f ${apiprog} done # export function definitions to subshells