1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-08 18:14:21 +03:00
inform7/inter/building-test/Chapter 1/Program Control.w

49 lines
955 B
OpenEdge ABL
Raw Normal View History

2020-03-29 01:18:10 +02:00
[Main::] Program Control.
What shall we test?
@h Main routine.
@d PROGRAM_NAME "building-test"
2020-03-29 01:18:10 +02:00
@
= (early code)
typedef void kind;
kind *K_value = NULL;
@
@e TEST_CLSW
=
int main(int argc, char **argv) {
Foundation::start(argc, argv);
2020-03-29 01:18:10 +02:00
WordsModule::start();
BuildingModule::start();
2020-04-14 19:56:54 +03:00
BytecodeModule::start();
2020-03-29 01:18:10 +02:00
CommandLine::declare_heading(L"building-test: a tool for testing the building module\n");
CommandLine::declare_switch(TEST_CLSW, L"test", 2,
L"perform unit tests from file X");
CommandLine::read(argc, argv, NULL, &Main::respond, &Main::ignore);
WordsModule::end();
BuildingModule::end();
2020-04-14 19:56:54 +03:00
BytecodeModule::end();
2020-03-29 01:18:10 +02:00
Foundation::end();
return 0;
}
void Main::respond(int id, int val, text_stream *arg, void *state) {
switch (id) {
case TEST_CLSW: Unit::run(Filenames::from_text(arg)); break;
}
}
void Main::ignore(int id, text_stream *arg, void *state) {
Errors::fatal("only switches may be used at the command line");
}