Skip to content

Commit 2ad9151

Browse files
YangYang
authored andcommitted
update the test case
1 parent dfbd177 commit 2ad9151

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,23 @@ benchmark: setup
2222

2323
run-python:
2424
@echo "\n--- Running Python Test ---"
25-
@./venv/bin/python python/io_benchmark.py 10
25+
@echo "Creating 10MB test file..."
26+
@mkdir -p data
27+
@python3 -c "with open('data/test_10mb.txt', 'wb') as f: f.write(b'A' * (10 * 1024 * 1024))"
28+
@python3 python/io_benchmark.py 10
2629

2730
run-go:
2831
@echo "\n--- Running Golang Test ---"
32+
@echo "Creating 10MB test file..."
33+
@mkdir -p data
34+
@python3 -c "with open('data/test_10mb.txt', 'wb') as f: f.write(b'A' * (10 * 1024 * 1024))"
2935
@cd golang && go run main.go 10
3036

3137
run-kotlin:
3238
@echo "\n--- Running Kotlin Test ---"
39+
@echo "Creating 10MB test file..."
40+
@mkdir -p data
41+
@python3 -c "with open('data/test_10mb.txt', 'wb') as f: f.write(b'A' * (10 * 1024 * 1024))"
3342
@cd kotlin && (./gradlew run --args="10" --quiet || gradle run --args="10" --quiet)
3443

3544
test-individual: setup

golang/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ type BenchmarkResult struct {
1919
}
2020

2121
func benchmarkIO(fileSizeMB int) (*BenchmarkResult, error) {
22-
inputPath := fmt.Sprintf("data/test_%dmb.txt", fileSizeMB)
23-
outputPath := fmt.Sprintf("data/test_%dmb.go.out", fileSizeMB)
22+
inputPath := fmt.Sprintf("../data/test_%dmb.txt", fileSizeMB)
23+
outputPath := fmt.Sprintf("../data/test_%dmb.go.out", fileSizeMB)
2424

2525
// Check if input file exists
2626
if _, err := os.Stat(inputPath); os.IsNotExist(err) {

0 commit comments

Comments
 (0)