diff --git a/scripts/auto_test.ipynb b/scripts/auto_test.ipynb index 06513be3..629f6bf3 100644 --- a/scripts/auto_test.ipynb +++ b/scripts/auto_test.ipynb @@ -59,21 +59,21 @@ "import os\n", "import subprocess\n", "\n", + "# Set your OpenAI API key\n", "os.environ['OPENAI_API_KEY'] = ''\n", "\n", - "# Specify project you want to detect\n", + "# Specify the project you want to detect\n", "project_file = 18\n", "\n", - "# Specify the folder path\n", + "# Define the folder path\n", "folder_path = f'./benchmark/contracts/{project_file}'\n", - "\n", "files = os.listdir(folder_path)\n", "\n", "# Function to run the command for a given file\n", "def run_command(file_path):\n", " with open(file_path, 'r', encoding='utf-8') as f:\n", " file_content = f.read()\n", - " \n", + "\n", " command = [\n", " \"python\", \"run.py\",\n", " \"--org\", \"RealWord\",\n", @@ -81,23 +81,24 @@ " \"--task\", file_content,\n", " \"--name\", f\"RealWorld_BA_{project_file}_{os.path.splitext(os.path.basename(file_path))[0]}\"\n", " ]\n", - " \n", + "\n", " try:\n", " result = subprocess.run(command, check=True, capture_output=True, text=True)\n", - " print(f\"Successfully ran {file_path}\")\n", + " print(f\"✅ Successfully ran {file_path}\")\n", " print(result.stdout)\n", " except subprocess.CalledProcessError as e:\n", - " print(f\"Error running {file_path}\")\n", + " print(f\"❌ Error running {file_path}\")\n", " print(e.stderr)\n", "\n", + "# Walk through the folder and process each .sol file\n", "for root, dirs, files in os.walk(folder_path):\n", " for file in files:\n", " if file.endswith('.sol'):\n", " file_path = os.path.join(root, file)\n", - " print(f\"Processing {file_path}...\")\n", + " print(f\"🚀 Processing {file_path}...\")\n", " run_command(file_path)\n", " else:\n", - " print(f\"Skipping {file} (not a .sol file)\")" + " print(f\"⚠️ Skipping {file} (not a .sol file)\")\n" ] }, {