diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4825d9bd..b55e7ec8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,34 +2,34 @@ name: build on: [push, pull_request] +permissions: + contents: read + env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release jobs: - # macos: - # name: macos / clang - # runs-on: macos-10.15 - # env: - # CC: clang - # steps: - # - uses: actions/checkout@v2 - # - name: Prepare1 - # run: brew install gcc glib google-perftools libomp - # - name: Prepare2 - # run: bash scripts/setup.sh - # - 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: Run - # continue-on-error: true - # run: make test + macos: + name: macos / clang + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: Prepare + run: bash scripts/install_dependency.sh + - 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}} --output-on-failure ubuntu: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Prepare run: bash scripts/install_dependency.sh - name: Configure CMake with LSan @@ -49,7 +49,7 @@ jobs: selfhosted: runs-on: self-hosted steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Configure CMake run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_GLCACHE=on -DENABLE_LRB=on - name: Build diff --git a/test/test_evictionAlgo.c b/test/test_evictionAlgo.c index e4e457fc..42519cd2 100644 --- a/test/test_evictionAlgo.c +++ b/test/test_evictionAlgo.c @@ -28,14 +28,14 @@ static void print_results(const cache_t *cache, const cache_stat_t *res) { } printf("};\n"); - printf("uint64_t miss_cnt_true[] = {"); + printf("uint64_t miss_cnt[] = {"); printf("%ld", (long)res[0].n_miss); for (uint64_t i = 1; i < CACHE_SIZE / STEP_SIZE; i++) { printf(", %ld", (long)res[i].n_miss); } printf("};\n"); - printf("uint64_t miss_byte_true[] = {"); + printf("uint64_t miss_byte[] = {"); printf("%ld", (long)res[0].n_miss_byte); for (uint64_t i = 1; i < CACHE_SIZE / STEP_SIZE; i++) { printf(", %ld", (long)res[i].n_miss_byte); @@ -327,10 +327,10 @@ static void test_LeCaR(gconstpointer user_data) { } static void test_Cacheus(gconstpointer user_data) { - uint64_t miss_cnt_true[] = {89776, 82725, 78839, 73048, - 69329, 69184, 69117, 66048}; - uint64_t miss_byte_true[] = {4048868864, 3727920128, 3489738752, 3184179200, - 2981198336, 2968055296, 2925565440, 2789046784}; + uint64_t miss_cnt_true[] = {90052, 82866, 77130, 77115, + 69828, 68435, 67930, 66993}; + uint64_t miss_byte_true[] = {4068200448, 3757362176, 3439912448, 3359079424, + 3018722816, 2928907776, 2867576832, 2834809856}; reader_t *reader = (reader_t *)user_data; common_cache_params_t cc_params = { @@ -607,8 +607,8 @@ static void empty_test(gconstpointer user_data) { ; } int main(int argc, char *argv[]) { g_test_init(&argc, &argv, NULL); - srand(0); // for reproducibility - set_rand_seed(rand()); + srand(0); // for reproducibility + set_rand_seed(42); // Use fixed seed for cross-platform consistency reader_t *reader;