1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
#include "testutil.hpp"
#include <nix.hpp>
int main(int argc, char* argv[]) {
if (argc != 2) {
std::cerr << "Please specify a nix file (and nothing else)" << std::endl;
return 1;
}
std::string fname = argv[1];
nix::File nf = nix::File::open(fname, nix::FileMode::ReadOnly);
int idx = 0, errcount = 0;
std::string expname, expdef;
for (const auto &block : nf.blocks()) {
expname = "test_block" + nix::util::numToStr(idx);
expdef = "definition block " + nix::util::numToStr(idx++);
errcount += compare(expname, block.name());
errcount += compare("blocktype", block.type());
errcount += compare(expdef, block.definition());
}
return errcount;
}
|