Skip to content

Commit

Permalink
Backport testcases handling from dev @ 857a084
Browse files Browse the repository at this point in the history
  • Loading branch information
CensoredUsername committed Feb 23, 2024
1 parent e3fe604 commit 02b3076
Show file tree
Hide file tree
Showing 92 changed files with 23,740 additions and 214 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
# python-version: "2.7"
- name: Test by decompiling a script and building un.rpyc
run: |
./unrpyc.py --clobber testcases/script.rpyc
diff -u testcases/script.orig.rpy testcases/script.rpy
./unrpyc.py --clobber --init-offset "testcases/compiled/**/*.rpyc"
diff -ur testcases/expected testcases/compiled -x "*.rpyc"
cd un.rpyc;
./compile.py -p 1
cd ..
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@
/bintray.json

unrpyc.sublime-*

!testcases/originals/**/*.rpy
!testcases/expected/**/*.rpy
!testcases/compiled/**/*.rpyc
11 changes: 11 additions & 0 deletions testcases/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
The folders in this folder contain the following items:

* `originals`: contains several original .rpy files to be used in for testing the decompiler
* `compiled`: contains the compiled `.rpyc` files corresponding to the files in `originals`
* `expected`: contains the expected output of decompiling the `.rpyc` files to `.rpy` files

The contents in `expected` have been manually verified to match `originals`, as `.rpyc` files unfortunately do not contain enough data to reconstruct the original file perfectly.

To make this verification easier, a test script (`validate_expected.py`) has been provided that strips out comments and empty lines. Running it with the --update option will cause it to update the `expected` folder with decompiled `.rpy` files found in the `compiled` folder.

Licenses for the files can be found in the corresponding `originals` folder for each dataset.
Binary file added testcases/compiled/the_question-7.7/gui.rpyc
Binary file not shown.
Binary file added testcases/compiled/the_question-7.7/options.rpyc
Binary file not shown.
Binary file added testcases/compiled/the_question-7.7/screens.rpyc
Binary file not shown.
Binary file added testcases/compiled/the_question-7.7/script.rpyc
Binary file not shown.
Binary file not shown.
Binary file added testcases/compiled/tutorial-7.7/01example.rpyc
Binary file not shown.
Binary file added testcases/compiled/tutorial-7.7/examples.rpyc
Binary file not shown.
Binary file added testcases/compiled/tutorial-7.7/gui.rpyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added testcases/compiled/tutorial-7.7/options.rpyc
Binary file not shown.
Binary file added testcases/compiled/tutorial-7.7/screens.rpyc
Binary file not shown.
Binary file added testcases/compiled/tutorial-7.7/script.rpyc
Binary file not shown.
Binary file added testcases/compiled/tutorial-7.7/testcases.rpyc
Binary file not shown.
Binary file added testcases/compiled/tutorial-7.7/tutorial_atl.rpyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 02b3076

Please sign in to comment.