Skip to content

Commit

Permalink
New way to perform OSS tests for SPARTA
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxuanchen1997 committed May 2, 2023
1 parent af0b12d commit 62a0365
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 99 deletions.
68 changes: 0 additions & 68 deletions .circleci/config.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CMake

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Install boost
run: sudo apt update && sudo apt install libboost-all-dev
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}

4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ file(GLOB test
"test/*.cpp"
)

include(CTest)
# ${test} contains all paths to the test cpps
foreach(testfile ${test})
# ${testfile} is in the format of test/SomeTest.cpp
Expand All @@ -67,7 +68,6 @@ foreach(testfile ${test})
# ${test_bin} is in the format of SomeTest_test
add_executable(${test_bin} ${testfile})
target_link_libraries(${test_bin} PRIVATE sparta gmock_main)
add_test(NAME ${testfile} COMMAND ${test_bin})
endforeach()

# Copy the script that runs all tests under the build directory
configure_file(run_all_tests.sh run_all_tests.sh COPYONLY)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ cmake --build .
To run the unit tests, please type:

```
./run_all_tests.sh
make test
```

To copy the header files into `/usr/local/include/sparta` and set up a cmake library for SPARTA, you can use the following command:
Expand Down
28 changes: 0 additions & 28 deletions run_all_tests.sh

This file was deleted.

0 comments on commit 62a0365

Please sign in to comment.