Fix #2
Caleb C. Sander authored
54c3e1dd
Name Last commit Last update
tests Fix #2
.gitignore Concurrent tests no longer use phony targets
README.md Fix #2
make.js Fix #2
package.json Fix #2

Project 2 - make

Spec

The spec for this project can be found at make.md.

Testing infrastructure

Several tests are provided in the tests directory. To run them, you need to run npm install once and then npm test each time you want to run the tests.

Making a real project

This is just for fun; you do not need to try this!

The test cases are fairly thorough but their makefiles are a little contrived. If you want to try your make.js on a real project, I have included a makefile for a basic Python interpreter that is part of a CS 24 project. If you have a macOS or Linux machine, you should be able to download the CS 24 starter code and build the subpython executable:

# cd to the directory with the CS 24 code
$ cd project05

# Build the interactive subpython interpreter
$ npm run make ../tests/cs24-project05.js subpython

# Use the subpython interpreter
$ ./subpython -m 100000
CS24 Subpython [Fall 2019]
Using a memory size of 100000 bytes.
>>> x = 1
>>> y = 2
>>> x + y
3

# Remove all built files
$ npm run make ../tests/cs24-project05.js clean

# Run the tests (they fail on the starter code)
$ npm run make ../tests/cs24-project05.js test

If you don't have clang installed, you can change the C compiler to gcc at the top of the makefile. If you've taken CS 24, try building and testing the completed version of the project!