Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/mcstas-basictest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@ jobs:
if [ -n "$SCOPE" ]; then
mkdir -p run_mctest && cd run_mctest
${MCTEST_EXECUTABLE} --verbose ${NOPLOTS} --mpi=${{ matrix.nmpi }} ${MCTEST_OACC} ${MCTEST_JOBS} --testdir $PWD $SCOPE --suffix=CHANGES_${{ matrix.cogen }}_${{ matrix.method }}_${{ matrix.CC || 'default' }}_${{ matrix.mpi }} $PERMISSIVE --uid=${MYWORKERID} || { echo "${MCTEST_EXECUTABLE} failed with exit code $?"; exit 1; }
if [ "${{ matrix.CC }}" == "clang" ] && [ "$RUNNER_OS" == "Linux" ]; then ${MCTEST_EXECUTABLE} --verbose --lint ${MCTEST_JOBS} --testdir $PWD $SCOPE --suffix=CHANGES_${{ matrix.cogen }}_${{ matrix.method }}_${{ matrix.CC }}_${{ matrix.mpi }} --uid=${MYWORKERID}; fi
if [ -z "${NOPLOTS}" ] && [ -z "${MCTEST_OACC}" ]; then ${MCVIEWTEST_EXECUTABLE} --nobrowse $PWD; fi
else
echo "No component or instrument code changes - nothing to test"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mcxtrace-basictest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@ jobs:
if [ -n "$SCOPE" ]; then
mkdir -p run_mxtest && cd run_mxtest
${MXTEST_EXECUTABLE} --verbose ${NOPLOTS} --mpi=${{ matrix.nmpi }} ${MCTEST_OACC} ${MCTEST_JOBS} --testdir $PWD $SCOPE --suffix=CHANGES_${{ matrix.cogen }}_${{ matrix.method }}_${{ matrix.CC || 'default' }}_${{ matrix.mpi }} $PERMISSIVE --uid=${MYWORKERID} || { echo "${MXTEST_EXECUTABLE} failed with exit code $?"; exit 1; }
if [ "${{ matrix.CC }}" == "clang" ] && [ "$RUNNER_OS" == "Linux" ]; then ${MXTEST_EXECUTABLE} --verbose --lint ${MCTEST_JOBS} --testdir $PWD $SCOPE --suffix=CHANGES_${{ matrix.cogen }}_${{ matrix.method }}_${{ matrix.CC }}_${{ matrix.mpi }} --uid=${MYWORKERID}; fi
if [ -z "${NOPLOTS}" ] && [ -z "${MCTEST_OACC}" ]; then ${MXVIEWTEST_EXECUTABLE} --nobrowse $PWD; fi
else
echo "No component or instrument code changes - nothing to test"
Expand Down
6 changes: 5 additions & 1 deletion tools/Python/mctest/mctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,11 @@ def compile_and_display(test):
logging.info(formatstr % test.instrname)
continue
elif test.linted:
formatstr = "%-" + "%ds: Linter only" % (maxnamelen+1)
with open(join(testdir, test.instrname, "compile_stdout.txt"), errors="replace") as f:
out = f.read().partition("INFO: Linting generated code")[2].partition("\n")[2]
nwarn = re.search(r"(\d+) warnings? generated", out)
formatstr = "%-" + "%ds: Linter only, %d warnings, %d lines of linter output" % (
maxnamelen+1, int(nwarn.group(1)) if nwarn else 0, out.count("\n"))
logging.info(formatstr % test.instrname)
continue
elif not test.compiled:
Expand Down
Loading