stsievert/swix

Tests reference files outside local swix folder

Closed this issue · 1 comments

Motivated by this email:

Thanks for Swix. The program is stuck because it cannot find the file below:
/Users/askoh/askoh/apple/swift/swix-master 2/python_testing/csvs/image.csv

What must I change in the program to make it run to completion.
Inside func write_csv
prefix String "/Users/askoh/Developer/swix/swix/swix/swix/"
filename String "../../python_testing/csvs/image.csv"

str.writeToFile(prefix+"../"+filename, atomically: false, encoding: NSUTF8StringEncoding, error: &error)

Thanks,
Aik-Siong Koh

In the function runTests, read/write CSV references ../../python_testing/csvs/. This means that tests do not run unless that folder is included (i.e., unless the repo is cloned). The tests should run independently of the file structure.

Ideas
  • Delete the file after testing. This might cause issues with iOS and OS X -- I don't think there's a system call on iOS. I'm not inclined to go with this option -- it excludes the Python testing.
  • Include another folder called testing in the local swix folder. I'm inclined to go with this option. The Python testing is reading files related to swix; those files should belong to swix.

I like this method more; by default, don't run these tests. I feel comfortable closing this issue.