test: compare compiled modules with the Lua 5.4 interpreter
The generated code can only be trusted if it behaves like the reference implementation, so the same script runs both ways and the outputs are diffed.
This commit is contained in:
5 files changed
+250
No files matched your search
@@ -0,0 +1,21 @@
|
||||
// Prints the conformance results produced by the compiled core.lua module.
|
||||
#include <iostream>
|
||||
|
||||
#include <luacpp/rt.hpp>
|
||||
|
||||
#include "core.hpp"
|
||||
|
||||
int main() {
|
||||
try {
|
||||
luacpp::State state;
|
||||
luacpp::Value results = state.require("core");
|
||||
int n = static_cast<int>(results.length());
|
||||
for (int i = 1; i <= n; ++i) {
|
||||
std::cout << results.at(i).as_string() << "\n";
|
||||
}
|
||||
} catch (const std::exception& error) {
|
||||
std::cerr << "conformance: " << error.what() << "\n";
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user