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
20 changes: 8 additions & 12 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -27,33 +26,30 @@ jobs:
with:
name: builds
path: build*
- name: Upload test data
uses: actions/upload-artifact@v4
with:
name: tests
path: tests/data/*.data
test:
runs-on: ubuntu-latest
needs: build
env:
ILIAD_TEST: tests/data/iliad.data
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: builds
path: builds
- uses: actions/download-artifact@v4
with:
name: tests
path: tests
- name: setup data
run: |
cd tests/data && bash setup.bash
- name: test
run: |
export ILIAD_FILE="tests/iliad.data"
export ILIAD_FILE=${PWD}/$ILIAD_TEST
cd builds/build
chmod +x tests/tests
tests/tests

- name: test_ubsan
run: |
export ILIAD_FILE="tests/iliad.data"
export ILIAD_FILE=${PWD}/$ILIAD_TEST
cd builds/build_ubsan
chmod +x tests/tests
tests/tests
Expand Down
1 change: 1 addition & 0 deletions tests/data/setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ set -eEx
ILIAD_REF="https://www.gutenberg.org/cache/epub/2199/pg2199.txt"
ILIAD_FILE=${PWD}/"iliad.data"
wget ${ILIAD_REF} -O ${ILIAD_FILE}
export ILIAD_FILE=${ILIAD_FILE}
3 changes: 3 additions & 0 deletions tests/streaming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <chrono>
#include <cmath>
#include <cstdlib>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <unordered_map>
Expand Down Expand Up @@ -48,6 +49,8 @@ void fill_answer(std::istream& in) {

TEST(StreamingTests, CountMinSketch) {
std::string iliad_file = std::getenv("ILIAD_FILE");
std::filesystem::path p{iliad_file.c_str()};
EXPECT_TRUE(std::filesystem::exists(p));
std::cout << "using iliad file: " << iliad_file << "\n";
{ /// fill answer
std::ifstream iliad(iliad_file);
Expand Down