Skip to content

Commit eed53f2

Browse files
committed
Exclude C/C++ tests for LFortran.
1 parent 31ae7b0 commit eed53f2

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

.github/actions/test-cc/action.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,21 @@ runs:
2323
elif ([ "$RUNNER_OS" == "Linux" ] && [[ "${{ inputs.compiler }}" == "nvidia-hpc" ]]); then
2424
# Get the compiler version and extract the version number
2525
ccv=$(${{ env.CC }} --version 2>&1 | awk '/nvc/ {print $2}' | cut -d'-' -f1)
26-
elif ([[ "${{ inputs.compiler }}" != "nvidia-hpc" ]]); then
26+
elif ([[ "${{ inputs.compiler }}" != "nvidia-hpc" ]] && [[ "${{ inputs.compiler }}" != "lfortran" ]]); then
2727
ccv=$(${{ env.CC }} --version | head -n 1)
2828
ccv=$(echo "$ccv" | grep -woE '[0123456789.]+' | head -n 1)
2929
fi
30-
[[ "$ccv" == ${{ inputs.version }}* ]] && (echo "found ${{ env.CC }} version: $ccv") || (echo "unexpected ${{ env.CC }} version: $ccv"; exit 1)
30+
if ([[ "${{ inputs.compiler }}" != "lfortran" ]]); then
31+
[[ "$ccv" == ${{ inputs.version }}* ]] && (echo "found ${{ env.CC }} version: $ccv") || (echo "unexpected ${{ env.CC }} version: $ccv"; exit 1)
32+
fi
3133
3234
- name: Test compile (bash)
3335
shell: bash
3436
run: |
35-
${{ env.CC }} -o hw hw.c
36-
output=$(./hw '2>&1')
37-
[[ "$output" == *"hello world"* ]] && echo "$output" || (echo "Unexpected C program output: $output"; exit 1)
38-
rm hw
37+
if ([[ "${{ inputs.compiler }}" != "lfortran" ]]); then
38+
${{ env.CC }} -o hw hw.c
39+
output=$(./hw '2>&1')
40+
[[ "$output" == *"hello world"* ]] && echo "$output" || (echo "Unexpected C program output: $output"; exit 1)
41+
rm hw
42+
fi
3943

.github/actions/test-cxx/action.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,20 @@ runs:
2323
elif ([ "$RUNNER_OS" == "Linux" ] && [[ "${{ matrix.toolchain.compiler}}" == "nvidia-hpc" ]]); then
2424
# Get the compiler version and extract the version number
2525
cxxv=$(${{ env.CXX }} --version 2>&1 | awk '/nvc++/ {print $2}' | cut -d'-' -f1)
26-
elif ([[ "${{ matrix.toolchain.compiler}}" != "nvidia-hpc" ]]); then
26+
elif ([[ "${{ matrix.toolchain.compiler}}" != "nvidia-hpc" ]] && [[ "${{ matrix.toolchain.compiler}}" != "lfortran" ]]); then
2727
cxxv=$(${{ env.CXX }} --version | head -n 1)
2828
cxxv=$(echo "$cxxv" | grep -woE '[0123456789.]+' | head -n 1)
2929
fi
30-
[[ "$cxxv" == ${{ matrix.toolchain.version }}* ]] && (echo "found ${{ env.CXX }} version: $cxxv") || (echo "unexpected ${{ env.CXX }} version: $cxxv"; exit 1)
30+
if ([[ "${{ matrix.toolchain.compiler}}" != "lfortran" ]]); then
31+
[[ "$cxxv" == ${{ matrix.toolchain.version }}* ]] && (echo "found ${{ env.CXX }} version: $cxxv") || (echo "unexpected ${{ env.CXX }} version: $cxxv"; exit 1)
32+
fi
3133
3234
- name: Test compile (bash)
3335
shell: bash
3436
run: |
35-
${{ env.CXX }} -o hw hw.cpp
36-
output=$(./hw '2>&1')
37-
[[ "$output" == *"hello world"* ]] && echo "$output" || (echo "Unexpected C++ program output: $output"; exit 1)
38-
rm hw
39-
37+
if ([[ "${{ matrix.toolchain.compiler}}" != "lfortran" ]]); then
38+
${{ env.CXX }} -o hw hw.cpp
39+
output=$(./hw '2>&1')
40+
[[ "$output" == *"hello world"* ]] && echo "$output" || (echo "Unexpected C++ program output: $output"; exit 1)
41+
rm hw
42+
fi

0 commit comments

Comments
 (0)