From 8bdfed55c7be863350eaa6f47f450b6ee040988d Mon Sep 17 00:00:00 2001 From: Mohamed Gaber Date: Sun, 14 Jan 2024 15:27:56 +0200 Subject: [PATCH] Remove smoke test --- .github/workflows/appimage.yml | 3 - .github/workflows/ci.yml | 3 - Dockerfile | 3 +- Tests/smoke_test.py | 100 --------------------------------- appimage/Makefile | 2 - 5 files changed, 1 insertion(+), 110 deletions(-) delete mode 100644 Tests/smoke_test.py diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 089e848..c23ff16 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -22,9 +22,6 @@ jobs: cd appimage export FAULT_IMAGE_NAME=ghcr.io/aucohl/fault:${{ steps.get_version.outputs.value }} make - - name: Test AppImage - run: | - ./appimage/Fault-x86_64.AppImage smoke-test - name: Copy AppImage run: | cp ./appimage/Fault-x86_64.AppImage /tmp/Fault-${{ steps.get_version.outputs.value }}-x86_64.AppImage diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e434894..99852a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,9 +25,6 @@ jobs: - name: Build Image run: | docker build --target runner -t aucohl/fault:latest . - - name: Run Smoke Test - run: | - docker run --rm -w /test aucohl/fault:latest python3 /test/smoke_test.py - name: Check for new version if: ${{ env.BRANCH_NAME == 'main' }} run: | diff --git a/Dockerfile b/Dockerfile index cb7f807..e620754 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,6 +73,7 @@ COPY . . ENV CC=clang ENV CXX=clang++ RUN swift build --static-swift-stdlib -c release +RUN swift test RUN cp /fault/.build/x86_64-unknown-linux-gnu/release/Fault /build/bin/fault WORKDIR / # --- @@ -80,8 +81,6 @@ WORKDIR / FROM centos:centos7 AS runner COPY --from=builder /build /build WORKDIR /test -COPY ./Tests/smoke_test.py . -COPY ./Tests/RTL/spm/spm.v . COPY ./Tech/osu035 ./osu035 WORKDIR / diff --git a/Tests/smoke_test.py b/Tests/smoke_test.py deleted file mode 100644 index 454e11d..0000000 --- a/Tests/smoke_test.py +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env python3 -import os -import sys -import tempfile -import subprocess - -script_dir = os.path.abspath(os.path.dirname(__file__)) - - -def fault(*args, subcommand=None, **kwargs): - cmd = ["fault"] - - if subcommand is not None: - cmd.append(subcommand) - - for k, v in kwargs.items(): - cmd.append(f"--{k}") - cmd.append(v) - - cmd += list(args) - - print(f"$ {' '.join(cmd)}") - sys.stdout.flush() - sys.stderr.flush() - - subprocess.check_call(cmd) - sys.stdout.flush() - sys.stderr.flush() - - -def main(argv): - try: - with tempfile.TemporaryDirectory() as test_tmp_dir: - netlist = f"{test_tmp_dir}/nl.v" - cut = f"{test_tmp_dir}/cut.v" - sim = f"{test_tmp_dir}/tvs.json" - chain = f"{test_tmp_dir}/chained.v" - asm = f"{test_tmp_dir}/asm" - - lib = f"{script_dir}/osu035/osu035_stdcells.lib" - model = f"{script_dir}/osu035/osu035_stdcells.v" - - fault( - f"{script_dir}/spm.v", - subcommand="synth", - liberty=lib, - top="spm", - output=netlist, - ) - - fault(netlist, subcommand="cut", output=cut) - - fault( - cut, - cellModel=model, - ignoring="rst", - clock="clk", - output=sim, - ) - - fault( - netlist, - subcommand="chain", - cellModel=model, - liberty=lib, - output=chain, - clock="clk", - reset="rst", - ignoring="rst", - ) - - fault( - sim, - chain, - subcommand="asm", - output=f"{asm}.vec.bin", - goldenOutput=f"{asm}.out.bin", - ) - - fault( - chain, - cellModel=model, - liberty=lib, - subcommand="tap", - clock="clk", - reset="rst", - testVectors=f"{asm}.vec.bin", - goldenOutput=f"{asm}.out.bin", - ignoring="rst", - ) - - print("Fault test successful.") - except subprocess.CalledProcessError as e: - print(f"{e}") - print(f"Command: {' '.join(e.cmd)}") - exit(-1) - - -if __name__ == "__main__": - main(sys.argv) diff --git a/appimage/Makefile b/appimage/Makefile index 62561c3..cc8c45e 100644 --- a/appimage/Makefile +++ b/appimage/Makefile @@ -22,9 +22,7 @@ $(APPIMAGE): squashfs-root/build/bin/fault appimagetool $(RESOURCES) mkdir -p ./squashfs-root/test cp ../Tests/RTL/spm/spm.v ./squashfs-root/test/spm.v cp -r ../Tech/osu035 ./squashfs-root/test/osu035 - cp ../Tests/smoke_test.py ./squashfs-root/test/smoke_test.py ./appimagetool ./squashfs-root - @./$(APPIMAGE) smoke-test && echo "> Smoke test successful." || echo "> Smoke test failed." PREFIX ?= /usr/local install: