From d057c85c7c5694f7dc27852fd0fc68e8a6642c7a Mon Sep 17 00:00:00 2001 From: Divyang Panchasara Date: Fri, 8 Aug 2025 00:41:33 +0530 Subject: [PATCH] Add multi-language test infrastructure and CI --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ .gitignore | 3 +++ Makefile | 12 ++++++++++++ README.md | 25 +++++++++++++++++++++++++ cpp/Makefile | 10 ++++++++++ cpp/tests/simple_test.cpp | 10 ++++++++++ go/Makefile | 4 ++++ go/calculator.go | 5 +++++ go/calculator_test.go | 9 +++++++++ go/go.mod | 3 +++ python/Makefile | 4 ++++ python/calc.py | 2 ++ python/test_calc.py | 4 ++++ 13 files changed, 112 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 cpp/Makefile create mode 100644 cpp/tests/simple_test.cpp create mode 100644 go/Makefile create mode 100644 go/calculator.go create mode 100644 go/calculator_test.go create mode 100644 go/go.mod create mode 100644 python/Makefile create mode 100644 python/calc.py create mode 100644 python/test_calc.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e709565 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,21 @@ +name: CI + +on: + push: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: 'stable' + - uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install Python dependencies + run: pip install pytest + - name: Run tests + run: make test diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..147ea5e --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +cpp/tests/simple_test +python/__pycache__/ +*.pyc diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ad968f6 --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +.PHONY: test test-cpp test-go test-python + +test: test-cpp test-go test-python + +test-cpp: + $(MAKE) -C cpp test + +test-go: + $(MAKE) -C go test + +test-python: + $(MAKE) -C python test diff --git a/README.md b/README.md index 7bb6a3c..5ac1a41 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,27 @@ # MultixAI- + Unified protocol for multiplexed AI, audio, and video streaming—optimized for real-time apps, AI-driven inference, and seamless WebRTC/WebTransport integration. Secure, extensible, and adapter-ready. + +## Development Setup + +This repository contains multi-language components. The following toolchains are required to build and test the project: + +- **C++17** compiler (e.g., `g++`) and `make` +- **Go 1.21+** +- **Python 3.10+** with `pytest` + +## Testing + +Run all language test suites: + +```sh +make test +``` + +Or run an individual suite: + +```sh +make test-cpp +make test-go +make test-python +``` diff --git a/cpp/Makefile b/cpp/Makefile new file mode 100644 index 0000000..0927fe1 --- /dev/null +++ b/cpp/Makefile @@ -0,0 +1,10 @@ +.PHONY: test clean + +test: tests/simple_test + ./tests/simple_test + +tests/simple_test: tests/simple_test.cpp + g++ -std=c++17 tests/simple_test.cpp -o tests/simple_test + +clean: + rm -f tests/simple_test diff --git a/cpp/tests/simple_test.cpp b/cpp/tests/simple_test.cpp new file mode 100644 index 0000000..072c19a --- /dev/null +++ b/cpp/tests/simple_test.cpp @@ -0,0 +1,10 @@ +#include + +int add(int a, int b) { + return a + b; +} + +int main() { + assert(add(2, 2) == 4); + return 0; +} diff --git a/go/Makefile b/go/Makefile new file mode 100644 index 0000000..f5b03e1 --- /dev/null +++ b/go/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + go test ./... diff --git a/go/calculator.go b/go/calculator.go new file mode 100644 index 0000000..bb63d36 --- /dev/null +++ b/go/calculator.go @@ -0,0 +1,5 @@ +package main + +func Add(a, b int) int { + return a + b +} diff --git a/go/calculator_test.go b/go/calculator_test.go new file mode 100644 index 0000000..1bbc50e --- /dev/null +++ b/go/calculator_test.go @@ -0,0 +1,9 @@ +package main + +import "testing" + +func TestAdd(t *testing.T) { + if Add(2, 2) != 4 { + t.Fatalf("expected 4, got %d", Add(2, 2)) + } +} diff --git a/go/go.mod b/go/go.mod new file mode 100644 index 0000000..3c14d44 --- /dev/null +++ b/go/go.mod @@ -0,0 +1,3 @@ +module github.com/MultixAI/go + +go 1.21 diff --git a/python/Makefile b/python/Makefile new file mode 100644 index 0000000..a41dc19 --- /dev/null +++ b/python/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + pytest diff --git a/python/calc.py b/python/calc.py new file mode 100644 index 0000000..4693ad3 --- /dev/null +++ b/python/calc.py @@ -0,0 +1,2 @@ +def add(a, b): + return a + b diff --git a/python/test_calc.py b/python/test_calc.py new file mode 100644 index 0000000..fb8e75c --- /dev/null +++ b/python/test_calc.py @@ -0,0 +1,4 @@ +from calc import add + +def test_add(): + assert add(2, 2) == 4