From c4254b75b47026a4c983e9fea55fe922b0dde82a Mon Sep 17 00:00:00 2001 From: Intel A80486DX2-66 Date: Mon, 26 Aug 2024 17:26:37 +0300 Subject: [PATCH] b/c...py: run the runtime unit after compiling --- EXAMPLE_USAGE.md | 2 +- bytebeat_compiler.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/EXAMPLE_USAGE.md b/EXAMPLE_USAGE.md index 2be7e89..b8ddede 100644 --- a/EXAMPLE_USAGE.md +++ b/EXAMPLE_USAGE.md @@ -1,7 +1,7 @@ ## Example usage ```text -$ echo 't&((t>>7)-t)&t>>8' | python ./bytebeat_compiler.py - -p 44100 -v && ./build/render_bytebeat +$ echo 't&((t>>7)-t)&t>>8' | python ./bytebeat_compiler.py - -p 44100 -v :: C bytebeat generator: compiler unit Compiling cc -Ofast -march=native -mtune=native -Wall -Wextra -Wpedantic -pedantic -Wno-unused-variable -Wno-unused-but-set-variable -Wno-dangling-else -Wno-parentheses -std=c99 ./build/substituted.c ./src/fwrite_le.c -o ./build/render_bytebeat -I./include diff --git a/bytebeat_compiler.py b/bytebeat_compiler.py index 14619c7..70a9e1a 100644 --- a/bytebeat_compiler.py +++ b/bytebeat_compiler.py @@ -289,4 +289,10 @@ if __name__ == "__main__": ] print(" ".join(command), flush=True) + if subprocess.run(command).returncode != 0: + exit(1) + + command = [OUTPUT_FILE] + print(" ".join(command), flush=True) + exit(subprocess.run(command).returncode)