jeudi 12 novembre 2020

Ruby script not find .txt files

I make a java project, and now i must test it with a ruby script that the teacher gived me. I have a directory "main" that contains 12 subdirectories test (test1, test2, test3,.., test12), each subdir contains 2 files: input.txt and output.txt. In the same directory "main" i have my .class java file and the ruby script. I have to launch the ruby script that execute my java file 12 times; each time it open (in order) one of the 12 subdirs test and pass the 2 .txt files to my java program and test it's performance. The script say i have to launch it by following command:

Usage: run-tests.rb [--args] [cmd]

Options:
 
    cmd     path to the executable to be run (defaults to bin/oc)
 --args     specifies if the executable take arguments to specify
            the input and the ouput file name or not. If not specified
            it is assumed that the executable does not take arguments
            and reads its input from stdin and writes to stdout.

When i launch the script with the following command:

ruby run-tests.rb java /home/user/Desktop/Esercizio\ 4/src main.GraphApp --args input.txt output.txt

the output is:

time for    test1: Error: Could not find or load main class test1.input.txt
Caused by: java.lang.ClassNotFoundException: test1.input.txt
Ok (0.18945 secs)

repeated for all the 12 tests. Can someone help me to solve this problem? seems like the ruby doesn't find the test subdirs with the .txt files

Aucun commentaire:

Enregistrer un commentaire