From 81924d7cd504e4f7a162eeac2f550bb00b91358b Mon Sep 17 00:00:00 2001 From: Peter Donovan Date: Wed, 22 May 2024 14:16:39 -0700 Subject: [PATCH] Update known good --- src/extension_version.ts | 2 +- .../C/src/ImportInstanceInMode.html | 123 +++++ .../C/src/federated/ImportsInModes.html | 187 +++++++ .../failing/EnclaveFederatedRequestStop.html | 476 ++++++++++++++++ test/known-good/C/src/lib/InstanceInMode.html | 168 ++++++ .../Cpp/src/target/GenericComposition.html | 520 ++++++++++++++++++ 6 files changed, 1475 insertions(+), 1 deletion(-) create mode 100644 test/known-good/C/src/ImportInstanceInMode.html create mode 100644 test/known-good/C/src/federated/ImportsInModes.html create mode 100644 test/known-good/C/src/federated/failing/EnclaveFederatedRequestStop.html create mode 100644 test/known-good/C/src/lib/InstanceInMode.html create mode 100644 test/known-good/Cpp/src/target/GenericComposition.html diff --git a/src/extension_version.ts b/src/extension_version.ts index 508fc2033..75c2dd357 100644 --- a/src/extension_version.ts +++ b/src/extension_version.ts @@ -1,3 +1,3 @@ 'use strict'; // This is a generated file. Do not edit. -export const version = "807cd213f6cfa3c434fa62ba030af7ac409075f9"; +export const version = "6560e1f527c3f82f6febfc5e0df074111cf61cd1"; diff --git a/test/known-good/C/src/ImportInstanceInMode.html b/test/known-good/C/src/ImportInstanceInMode.html new file mode 100644 index 000000000..eaba5d160 --- /dev/null +++ b/test/known-good/C/src/ImportInstanceInMode.html @@ -0,0 +1,123 @@ + +// Test that importing from a file with a reactor that is only instantiated in + + + +// a mode does not trigger a NPE. + + + +target + + + + + +C + + + { + + + + timeout + + +: + + +0 + + + s + + + +} + + + + + + + +import + + + + + +B + + + + + +from + + + + + +" + + +lib/InstanceInMode.lf + + +" + + + + + + + +main + + + + + +reactor + + + { + + + + + + +b + + + + + += + + + + + +new + + + + + +B + + +() + + + +} + + + + + + diff --git a/test/known-good/C/src/federated/ImportsInModes.html b/test/known-good/C/src/federated/ImportsInModes.html new file mode 100644 index 000000000..e1f93c2ba --- /dev/null +++ b/test/known-good/C/src/federated/ImportsInModes.html @@ -0,0 +1,187 @@ + +target + + + + + +C + + + { + + + + timeout + + +: + + +1 + + + + + +msec + + + +} + + + + + + + +import + + + + + +Count + + + + + +from + + + + + +" + + +../lib/Count.lf + + +" + + + + + + + +reactor + + + + + +R + + + { + + + + + + +initial + + + + + +mode + + + { + + + + + + +c + + + + + += + + + + + +new + + + + + +Count + + +() + + + + } + + + +} + + + + + + + +federated + + + + + +reactor + + + { + + + + + + +fed + + + + + += + + + + + +new + + + + + +R + + +() + + + +} + + + + + + diff --git a/test/known-good/C/src/federated/failing/EnclaveFederatedRequestStop.html b/test/known-good/C/src/federated/failing/EnclaveFederatedRequestStop.html new file mode 100644 index 000000000..afe7e0004 --- /dev/null +++ b/test/known-good/C/src/federated/failing/EnclaveFederatedRequestStop.html @@ -0,0 +1,476 @@ + +/** + + + + * Test that enclaves within federates all stop at the time requested by the first enclave to + + + + * request a stop. Note that the test has no timeout because any finite timeout can, in theory, + + + + * cause the test to fail. The first federate to request a stop does so at 50 ms, so the program + + + + * should terminate quickly if all goes well. + + + + * Placed in failing as we do not have full support for scheduling enclaves yet. + + + + + + +*/ + + + +target + + + + + +C + + + + + + + +reactor + + + + + +Stop + + +( + + + + + + +// Zero value here means "don't stop". + + + + stop_time: + + +time + + + + + += + + + + + +0 + + +) { + + + + + + +timer + + + t(stop_time) + + + + + + + + + + +reaction + + +( + + +t) { + + += + + + + if (self + + +-> + + +stop_time > + + +0 + + +) lf_request_stop(); + + + + + + += + + +} + + + + + + + + + + +reaction + + +( + + +shutdown + + +) { + + += + + + + lf_print( + + +" + + +Stopped at tag ( + + +" + + + PRINTF_TIME + + +" + + +, %d) + + +" + + +, lf_time_logical_elapsed(), lf_tag() + + +. + + +microstep); + + + + if (lf_time_logical_elapsed() ! + + += + + + 50000000LL || lf_tag() + + +. + + +microstep ! + + += + + + + + +1 + + +) { + + + + lf_print_error_and_exit( + + +" + + +Expected stop tag to be (50ms, 1). + + +" + + +); + + + + } + + + + + + += + + +} + + + +} + + + + + + + +reactor + + + + + +Fed + + +(least_stop_time: + + +time + + + + + += + + + + + +0 + + +) { + + + + + + +@ + + +enclave + + + + + + +s1 + + + + + += + + + + + +new + + + + + +Stop + + +() + + + + + + +@ + + +enclave + + + + + + +s2 + + + + + += + + + + + +new + + + + + +Stop + + +(stop_time + + += + + +least_stop_time) + + + +} + + + + + + + +federated + + + + + +reactor + + + { + + + + + + +f1 + + + + + += + + + + + +new + + + + + +Fed + + +() + + + + + + +f2 + + + + + += + + + + + +new + + + + + +Fed + + +(least_stop_time + + += + + + + + +50 + + + ms) + + + +} + + + + + + diff --git a/test/known-good/C/src/lib/InstanceInMode.html b/test/known-good/C/src/lib/InstanceInMode.html new file mode 100644 index 000000000..350729609 --- /dev/null +++ b/test/known-good/C/src/lib/InstanceInMode.html @@ -0,0 +1,168 @@ + +// Define a reactor that is only instantiated inside a mode. + + + +target + + + + + +C + + + + + + + +reactor + + + + + +U + + + { + + + + + + +reaction + + +( + + +startup + + +) { + + += + + + + + += + + +} + + + +} + + + + + + + +reactor + + + + + +B + + + { + + + + + + +reaction + + +( + + +startup + + +) { + + += + + + + + += + + +} + + + + + + + + + + +initial + + + + + +mode + + + A { + + + + + + +u + + + + + += + + + + + +new + + + + + +U + + +() + + + + } + + + +} + + + + + + diff --git a/test/known-good/Cpp/src/target/GenericComposition.html b/test/known-good/Cpp/src/target/GenericComposition.html new file mode 100644 index 000000000..132196106 --- /dev/null +++ b/test/known-good/Cpp/src/target/GenericComposition.html @@ -0,0 +1,520 @@ + +target + + + + + +Cpp + + + { + + + + timeout + + +: + + +1 + + + + + +sec + + + +} + + + + + + + +reactor + + + + + +Counter + + + { + + + + + + +state + + + + + +count + + +: + + + + + +T + + +( + + +0 + + +) + + + + + + +timer + + + t( + + +0 + + +, + + +1 + + + + + +sec + + +) + + + + + + +output + + + + + +out + + +: + + + + + +T + + + + + + + + + + +reaction + + +( + + +t) + + +-> + + + out { + + += + + + + + + +out + + +. + + +set + + +(count); + + + + count + + ++ + + += + + + + + +1 + + +; + + + + + + += + + +} + + + +} + + + + + + + +reactor + + + + + +Printer + + + { + + + + + + +input + + + + + +in + + +: + + + + + +T + + + + + + + + + + +reaction + + +( + + +in) { + + += + + + + auto msg + + += + + + + + +* + + +in + + +. + + +get + + +(); + + + + + + +std + + +:: + + +cout + + + << msg << + + +std + + +:: + + +endl + + +; + + + + + + += + + +} + + + +} + + + + + + + +reactor + + + + + +MyWrapper + + + { + + + + + + +c + + + + + += + + + + + +new + + + + + +Counter + + +< + + +T + + +> + + +() + + + + + + +p + + + + + += + + + + + +new + + + + + +Printer + + +< + + +T + + +> + + +() + + + + + + +c + + +. + + +out + + + + + +-> + + + + + +p + + +. + + +in + + + +} + + + + + + + +main + + + + + +reactor + + + { + + + + + + +m + + + + + += + + + + + +new + + + + + +MyWrapper + + +< + + +int + + +> + + +() + + + +} + + + + + +