Skip to content

Commit

Permalink
Added tests for clang on linux and msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-rifkin committed Mar 5, 2022
1 parent 247000b commit b57a2b3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,39 @@ jobs:
- name: run tests
working-directory: tests
run: python3 run-tests.py gcc
test-clang:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install git+https://github.com/jeffkaufman/icdiff.git
- name: build library
run: make COMPILER=clang++
- name: build tests
working-directory: tests
run: make tests COMPILER=clang++
- name: run tests
working-directory: tests
run: python3 run-tests.py clang
test-msvc:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Enable Developer Command Prompt
uses: ilammy/[email protected]
- name: dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install git+https://github.com/jeffkaufman/icdiff.git
- name: build library
run: make COMPILER=msvc
- name: build tests
working-directory: tests
run: make tests COMPILER=msvc
- name: run tests
working-directory: tests
run: python3 run-tests.py msvc

# TODO gcc/clang on windows
3 changes: 2 additions & 1 deletion tests/run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def run_unit_tests(tests):
print("[{}, code {}]".format("Passed" if p.returncode == 0 else "Failed", p.returncode))

def run_integration(expected_output_path):
global ok
print("[Running integration test against {}]".format(expected_output_path))
with open(expected_output_path) as f:
content = f.read().strip()
Expand All @@ -32,6 +33,7 @@ def run_integration(expected_output_path):
out, err = p.communicate()
out = out.decode("utf-8").strip()
if out != content:
ok = False
with open("output.txt", "w") as f:
f.write(out)
dp = subprocess.Popen([
Expand All @@ -43,7 +45,6 @@ def run_integration(expected_output_path):
])
dp.wait()
elif p.returncode != 0 or len(err) != 0:
global ok
ok = False
print("[{}]".format("Passed" if p.returncode == 0 else "Failed"))

Expand Down

0 comments on commit b57a2b3

Please sign in to comment.