Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Lua: add a test to check that global values are correctly duplicated
[simgrid.git] / examples / lua / state_cloner / duplicated_globals.tesh
diff --git a/examples/lua/state_cloner/duplicated_globals.tesh b/examples/lua/state_cloner/duplicated_globals.tesh
new file mode 100644 (file)
index 0000000..c8029d7
--- /dev/null
@@ -0,0 +1,11 @@
+# Checks that global values are correctly duplicated in Lua processes
+
+$ lua duplicated_globals.lua
+> [0.000000] [lua/INFO] Global string is 'A global string set by maestro'
+> [Tremblay:set_global_string:(1) 0.000000] [lua/INFO] Changing the global string
+> [Tremblay:set_global_string:(1) 0.000000] [lua/INFO] Global string is 'Calling set_global_string() from Tremblay'
+> [Bourassa:replace:(2) 0.000000] [lua/INFO] Overwriting function please_dont_replace_me()
+> [Bourassa:replace:(2) 0.000000] [lua/INFO] Changing the global string
+> [Bourassa:replace:(2) 0.000000] [lua/INFO] Global string is 'Calling replace() from Bourassa'
+> [Jupiter:please_dont_replace_me:(3) 0.000000] [lua/INFO] Hello from please_dont_replace_me(). I'm lucky, I still exist in this state.
+> [Jupiter:please_dont_replace_me:(3) 0.000000] [lua/INFO] Global string is 'A global string set by maestro'