mirror of https://github.com/YosysHQ/yosys.git
tests: add a quick plugin test
This commit is contained in:
parent
60ffc21e64
commit
f11dd6e208
|
@ -3,3 +3,4 @@
|
|||
/write_gzip.v
|
||||
/write_gzip.v.gz
|
||||
/run-test.mk
|
||||
/plugin.so
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
#include "kernel/rtlil.h"
|
||||
|
||||
YOSYS_NAMESPACE_BEGIN
|
||||
|
||||
struct TestPass : public Pass {
|
||||
TestPass() : Pass("test", "test") { }
|
||||
void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE
|
||||
{
|
||||
size_t argidx = 1;
|
||||
extra_args(args, argidx, design);
|
||||
log("Plugin test passed!\n");
|
||||
}
|
||||
} TestPass;
|
||||
|
||||
YOSYS_NAMESPACE_END
|
|
@ -0,0 +1,6 @@
|
|||
set -e
|
||||
rm -f plugin.so
|
||||
CXXFLAGS=$(../../yosys-config --cxxflags)
|
||||
CXXFLAGS=${CXXFLAGS// -I\/usr\/local\/share\/yosys\/include/ -I..\/..\/share\/include}
|
||||
../../yosys-config --exec --cxx ${CXXFLAGS} --ldflags -shared -o plugin.so plugin.cc
|
||||
../../yosys -m ./plugin.so -p "test" | grep -q "Plugin test passed!"
|
Loading…
Reference in New Issue