<commit_before>#!/usr/bin/env python
"""
Main test harness for RIOS. 

Should be run as a main program. It then runs a selection 
of tests of some capabilities of RIOS. 

"""

if __name__ == '__main__':

    from rios.riostests import riostestutils
    riostestutils.testAll()<commit_msg>ensure GDAL_DATA env var is set for tests<commit_after>#!/usr/bin/env python
"""
Main test harness for RIOS. 

Should be run as a main program. It then runs a selection 
of tests of some capabilities of RIOS. 

"""
# Set GDAL_DATA. This is done normally done by the activate script,
# but this doesn't happen in the testing environment
import os
if 'LIBRARY_PREFIX' in os.environ:
    # Windows
    gdalData = os.path.join(os.environ['LIBRARY_PREFIX'], 'share', 'gdal')
else:
    # Linux/OSX
    gdalData = os.path.join(os.environ['PREFIX'], 'share', 'gdal')

os.environ['GDAL_DATA'] = gdalData

from rios.riostests import riostestutils
riostestutils.testAll()
{'fraction_non_alphanumeric': 0.10337552742616034, 'fraction_numerical': 0.0, 'mean_word_length': 4.129729729729729, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6310693', 'n_tokens_mistral': 323, 'n_tokens_neox': 310, 'n_words': 109}