Add parser test (usually ifdefed out)

This commit is contained in:
Nick Lanham 2012-02-21 10:29:54 +01:00
parent fd14574c5f
commit 8b334e9b67
2 changed files with 17 additions and 0 deletions

View File

@ -13,6 +13,9 @@ drmr.so: drmr.c drmr_hydrogen.c
drmr_ui.so: drmr_ui.c drmr_hydrogen.c
$(CC) -shared -Wall -fPIC -DPIC drmr_ui.c drmr_hydrogen.c `pkg-config --cflags --libs lv2-plugin gtk+-2.0 sndfile samplerate` -lexpat -lm -o drmr_ui.so
htest: drmr_hydrogen.c
$(CC) -D_TEST_HYDROGEN_PARSER -Wall -fPIC -DPIC drmr_hydrogen.c `pkg-config --cflags --libs sndfile samplerate` -lexpat -lm -o htest
install: $(BUNDLE)
mkdir -p $(INSTALL_DIR)
rm -rf $(INSTALL_DIR)/$(BUNDLE)

View File

@ -571,3 +571,17 @@ drmr_sample* load_hydrogen_kit(char *path, double rate, int *num_samples) {
*num_samples = num_inst;
return samples;
}
#ifdef _TEST_HYDROGEN_PARSER
int main(int argc, char* argv[]) {
kits *kits;
int i;
kits = scan_kits();
for (i=0;i<kits->num_kits;i++)
printf("\t%s:\n\t\tpath: %s\n\t\tsamples: %i\n",kits->kits[i].name,kits->kits[i].path,kits->kits[i].samples);
return 0;
}
#endif // _TEST_HYDROGEN_PARSER