diff --git a/README.md b/README.md index 513bb26b..6cbd46c3 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ If you need to visualize the graph (`--visualize`), make sure you have installed To verify everything is set up correctly, run the following command: ```shell -pytest test.py +pytest test.py -m basic ``` This command traverses the `./test` folder and performs symbolic execution on all Wasm binaries. diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 00000000..3423a918 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +markers = + basic: basic test \ No newline at end of file diff --git a/test.py b/test.py index 82049a50..f24abbd1 100644 --- a/test.py +++ b/test.py @@ -19,6 +19,7 @@ ('password.wasm', '') ]) +@pytest.mark.basic def test_wasm_can_be_analyzed(wasm_path, entry): wasm_path = os.path.join(testcase_dir, wasm_path) cmd = [sys.executable, 'launcher.py', '-f', wasm_path, '-s', '-v', 'info'] @@ -26,6 +27,7 @@ def test_wasm_can_be_analyzed(wasm_path, entry): cmd.extend(['--entry', entry]) subprocess.run(cmd, timeout=900, check=True) +@pytest.mark.basic def test_return_simulation(): wasm_path = './test/test_return.wasm' cmd = [sys.executable, 'launcher.py', '-f', wasm_path, '-s', '-v', 'info', '--source_type', 'rust'] @@ -41,6 +43,7 @@ def test_return_simulation(): state = json.load(f) assert state['Solution']['proc_exit'] == "\u0000", f'exit code should be 0, got {state["Solution"]["proc_exit"]}' +@pytest.mark.basic def test_unreachable_simulation(): wasm_path = './test/test_unreachable.wasm' cmd = [sys.executable, 'launcher.py', '-f', wasm_path, '-s', '-v', 'info', '--source_type', 'rust']