From 004ee3748de5b6365cc9db7ac67fac2c15bc8ce9 Mon Sep 17 00:00:00 2001 From: samuelkcrow Date: Thu, 8 Sep 2022 13:40:48 -0700 Subject: [PATCH] add option to keep tmp files when running tests with make --- compiler/tests/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/tests/Makefile b/compiler/tests/Makefile index 24e9a526..2e918eba 100644 --- a/compiler/tests/Makefile +++ b/compiler/tests/Makefile @@ -6,6 +6,7 @@ include $(TOP_DIR)/openram.mk ARGS ?= TEST_TECHS ?= scn4m_subm freepdk45 TECHS ?= scn4m_subm freepdk45 sky130 +KEEP ?= false TEST_DIR = $(TOP_DIR)/compiler/tests TEST_SRCS = $(sort $(notdir $(wildcard $(TEST_DIR)/*_test.py))) @@ -121,8 +122,11 @@ $(TEST_BASES): @mkdir -p results/$*/tmp @$(DOCKER_CMD) sh -c ". /home/cad-user/.bashrc && sleep 1 && python3 -u $(OPENRAM_DIR)/$(getfile).py \ -t $(gettech) -k -v $(ARGS) -p $(OPENRAM_DIR)/results/$* > $(OPENRAM_DIR)/results/$*.out 2>&1 && touch $(OPENRAM_DIR)/results/$*.ok || touch $(OPENRAM_DIR)/results/$*.bad" - @test -f $(TOP_DIR)/compiler/tests/results/$*.ok && echo "$* ... PASS!" && \ - rm -rf $(TOP_DIR)/compiler/tests/results/$* || echo "$* ... FAIL!" +ifeq ($(KEEP),true) + @test -f $(TOP_DIR)/compiler/tests/results/$*.ok && echo "$* ... PASS!" || echo "$* ... FAIL!" +else + @test -f $(TOP_DIR)/compiler/tests/results/$*.ok && echo "$* ... PASS!" && rm -rf $(TOP_DIR)/compiler/tests/results/$* || echo "$* ... FAIL!" +endif .DELETE_ON_ERROR: $(TEST_STAMPS) .PHONY: docker-pull