From 978dd9637f0cb1bc60d36e7febb2fffa56fa6dca Mon Sep 17 00:00:00 2001
From: Lionel GUEZ <guez@lmd.ens.fr>
Date: Tue, 19 Apr 2022 16:23:08 +0200
Subject: [PATCH] Add test for `cost_function.py`

This test requires a specially prepared file `segmented.gt`:

```
head -n 100000 /data/guez/Oceanic_eddies/Global_1993_2020/Eddy_graph_anti/edgelist.csv >edgelist.csv
~/Detection_eddies/segments.py edgelist.csv segmented.gt
```

because we need input with `%Y/SHPC_(anti|cyclo)` arborescence for the
test.
---
 Tests/tests.json | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Tests/tests.json b/Tests/tests.json
index f8c6e04b..97e576ff 100644
--- a/Tests/tests.json
+++ b/Tests/tests.json
@@ -10,5 +10,15 @@
 	    "$src_dir/segments.py", "$tests_old_dir/EGr2nd15md4/edgelist.csv",
 	    "segments.graphml"
 	]
+    },
+    {
+	"title": "Cost_functions", "command": "$src_dir/cost_function.py",
+	"env": {"PYTHONPATH": "$src_dir/Overlap:$src_dir/Common"},
+	"symlink":
+	[
+	    "$PWD/Global_1993_2020/Eddy_graph_anti/node_id_param.json",
+	    "$PWD/segmented.gt"
+	],
+	"input": "anti\n$PWD/Global_1993_2020\n"
     }
 ]    
-- 
GitLab