diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 1a4481f..dd45926 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -5,7 +5,6 @@ on: branches: ["main"] pull_request: branches: ["main"] - jobs: build: runs-on: ubuntu-latest @@ -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 diff --git a/tests/data/setup.bash b/tests/data/setup.bash index 1e47c87..3b11eff 100644 --- a/tests/data/setup.bash +++ b/tests/data/setup.bash @@ -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} diff --git a/tests/streaming.cpp b/tests/streaming.cpp index e19cfb4..28bf8e6 100644 --- a/tests/streaming.cpp +++ b/tests/streaming.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -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);